Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
developerkunal authored Jun 27, 2024
2 parents 6bfded1 + 0181f8d commit 6764773
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cli/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (i *terraformInputs) parseResourceFetchers(api *auth0.API) ([]resourceDataF
fetchers = append(fetchers, &attackProtectionResourceFetcher{})
case "auth0_branding":
fetchers = append(fetchers, &brandingResourceFetcher{})
case "auth0_client":
case "auth0_client", "auth0_client_credentials":
fetchers = append(fetchers, &clientResourceFetcher{api})
case "auth0_client_grant":
fetchers = append(fetchers, &clientGrantResourceFetcher{api})
Expand Down
5 changes: 5 additions & 0 deletions internal/cli/terraform_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ func (f *clientResourceFetcher) FetchData(ctx context.Context) (importDataList,
ResourceName: "auth0_client." + sanitizeResourceName(client.GetName()),
ImportID: client.GetClientID(),
})

data = append(data, importDataItem{
ResourceName: "auth0_client_credentials." + sanitizeResourceName(client.GetName()),
ImportID: client.GetClientID(),
})
}

if !clients.HasNext() {
Expand Down
16 changes: 16 additions & 0 deletions internal/cli/terraform_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,34 @@ func TestClientResourceFetcher_FetchData(t *testing.T) {
ResourceName: "auth0_client.my_test_client_1",
ImportID: "clientID_1",
},
{
ResourceName: "auth0_client_credentials.my_test_client_1",
ImportID: "clientID_1",
},
{
ResourceName: "auth0_client.my_test_client_2",
ImportID: "clientID_2",
},
{
ResourceName: "auth0_client_credentials.my_test_client_2",
ImportID: "clientID_2",
},
{
ResourceName: "auth0_client.my_test_client_3",
ImportID: "clientID_3",
},
{
ResourceName: "auth0_client_credentials.my_test_client_3",
ImportID: "clientID_3",
},
{
ResourceName: "auth0_client.my_test_client_4",
ImportID: "clientID_4",
},
{
ResourceName: "auth0_client_credentials.my_test_client_4",
ImportID: "clientID_4",
},
}

data, err := fetcher.FetchData(context.Background())
Expand Down

0 comments on commit 6764773

Please sign in to comment.