Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #179 from alexkappa/connection-v4
Browse files Browse the repository at this point in the history
Connection v4
  • Loading branch information
alexkappa authored Mar 21, 2020
2 parents 3783f3d + 296ebe5 commit c8f3b76
Show file tree
Hide file tree
Showing 67 changed files with 3,554 additions and 906 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
## 0.7.0 (Unreleased)

FEATURES:

* resource/connection: support for the passwordless `email` connection strategy.

ENHANCEMENTS:

* resource/connection: now using the more powerful connection options from `gopkg.in/auth0.v4`.

BUG FIXES:
* resource/tenant, resource/connection: issues setting boolean attributes within nested blocks should now be resolved ([#163](https://github.com/alexkappa/terraform-provider-auth0/issues/163), [#160](https://github.com/alexkappa/terraform-provider-auth0/issues/160))

NOTES:

* Upgrade to `gopkg.in/auth0.v4` (`v4.0.0`)

## 0.6.0 (March 03, 2020)

FEATURES:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ for custom domains (`TestAccCustomDomain`), also require a paid Auth0 subscripti
At the time of writing, the following configuration steps are also required for the test tenant:

* The `Username-Password-Authentication` connection must have _Requires Username_ option enabled for the user tests to
succesfully run.
successfully run.

Supporting the provider
-----------------------

This project is maintained by myself ([@alexkappa](https://github.com/alexkappa)) with contributions from great people across the community.

I am not affiliated with [Auth0](https://auth0.com/) and all work that goes into this provider is done during my spare time. Please be patient with issues and pull requests.

If you or your company relies on this plugin or the [Go SDK](https://github.com/go-auth0/auth0) and would like to ensure its continuing support please consider [donating](https://github.com/sponsors/alexkappa).
23 changes: 23 additions & 0 deletions auth0/internal/debug/debug.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package debug

import (
"fmt"
"log"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func DumpAttr(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
if !ok {
return fmt.Errorf("Not found: %s", n)
}
log.Printf("[DEBUG] Attrs: \n")
for key, value := range rs.Primary.Attributes {
log.Printf("[DEBUG]\t %s: %q\n", key, value)
}
return nil
}
}
2 changes: 1 addition & 1 deletion auth0/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/meta"

"gopkg.in/auth0.v3/management"
"gopkg.in/auth0.v4/management"
)

func Provider() *schema.Provider {
Expand Down
2 changes: 1 addition & 1 deletion auth0/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"

"gopkg.in/auth0.v3/management"
"gopkg.in/auth0.v4/management"
)

func Auth0() (*management.Management, error) {
Expand Down
28 changes: 14 additions & 14 deletions auth0/resource_auth0_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"

"gopkg.in/auth0.v3"
"gopkg.in/auth0.v3/management"
"gopkg.in/auth0.v4"
"gopkg.in/auth0.v4/management"

v "github.com/terraform-providers/terraform-provider-auth0/auth0/internal/validation"
)
Expand Down Expand Up @@ -588,22 +588,22 @@ func buildClient(d *schema.ResourceData) *management.Client {
InitiateLoginURI: String(d, "initiate_login_uri"),
}

List(d, "jwt_configuration").First(func(v interface{}) {

m := v.(map[string]interface{})

List(d, "jwt_configuration").Elem(func(d Data) {
c.JWTConfiguration = &management.ClientJWTConfiguration{
LifetimeInSeconds: Int(MapData(m), "lifetime_in_seconds"),
Algorithm: String(MapData(m), "alg"),
Scopes: Map(MapData(m), "scopes"),
LifetimeInSeconds: Int(d, "lifetime_in_seconds"),
Algorithm: String(d, "alg"),
Scopes: Map(d, "scopes"),
}
})

List(d, "encryption_key").First(func(v interface{}) {
c.EncryptionKey = v.(map[string]string)
})
if m := Map(d, "encryption_key"); m != nil {
c.EncryptionKey = map[string]string{}
for k, v := range m {
c.EncryptionKey[k] = v.(string)
}
}

List(d, "addons").First(func(v interface{}) {
List(d, "addons").Range(func(k int, v interface{}) {

c.Addons = make(map[string]interface{})

Expand Down Expand Up @@ -637,7 +637,7 @@ func buildClient(d *schema.ResourceData) *management.Client {
}
}

List(d, "mobile").First(func(v interface{}) {
List(d, "mobile").Range(func(k int, v interface{}) {

c.Mobile = make(map[string]interface{})

Expand Down
4 changes: 2 additions & 2 deletions auth0/resource_auth0_client_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"

"gopkg.in/auth0.v3"
"gopkg.in/auth0.v3/management"
"gopkg.in/auth0.v4"
"gopkg.in/auth0.v4/management"
)

func newClientGrant() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion auth0/resource_auth0_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/terraform-providers/terraform-provider-auth0/auth0/internal/random"

"gopkg.in/auth0.v3/management"
"gopkg.in/auth0.v4/management"
)

func init() {
Expand Down
Loading

0 comments on commit c8f3b76

Please sign in to comment.