Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add new OIDC credentials creation and assigment (Azure data sou… #773

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

TomerHeber
Copy link
Collaborator

…rce)

Part of #743

Solution

  1. Refactored to use common code.
  2. Moved oidc jwt key to organization data resource (makes more sense).
  3. Added azure oidc data source.
  4. Added integration tests.
  5. Added acceptance tests for azure oidc data source.

@@ -29,8 +29,6 @@ func TestAwsOidcCredentialDataSource(t *testing.T) {
Type: string(client.AwsAssumedRoleCredentialsType),
}

oidcSub := "oidc sub 123345 !!!"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to organization data.

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

func TestAzureOidcCredentialDataSource(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests duplication to be refactored on the next commit.

@@ -49,5 +54,10 @@ func dataOrganizationRead(ctx context.Context, d *schema.ResourceData, meta inte
return diag.Errorf("schema resource data serialization failed: %v", err)
}

oidcSub, err := apiClient.OidcSub()
if err == nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may fail if oidc is disabled. Set the value if successful.

Copy link
Contributor

@Yossi-kerner Yossi-kerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good left one question

env0/data_oidc_credentials.go Show resolved Hide resolved
@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Dec 26, 2023
@TomerHeber TomerHeber merged commit fcf27bc into main Dec 26, 2023
4 checks passed
@TomerHeber TomerHeber deleted the feat-oidc-azure-data-#743 branch December 26, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature integration-tests provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants