Skip to content

Commit

Permalink
Merge pull request #164 from jfrog/prep-for-release-1.18.1
Browse files Browse the repository at this point in the history
Fix validation and acceptance tests
  • Loading branch information
alexhung authored Nov 26, 2024
2 parents cf12c88 + dba200c commit be2e60c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 1.18.1 (November 26, 2024).
# 1.18.1 (November 26, 2024). Tested on Artifactory 7.98.9 with Terraform 1.9.8 and OpenTofu 1.8.6

BUG FIXES:

* resource/platform_oidc_configuration: Add GitHub actions `issuer` customization for enterprise. See [Customizing the issuer value for an enterprise](https://docs.github.com/en/enterprise-cloud@latest/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-issuer-value-for-an-enterprise).
* resource/platform_oidc_configuration: Update validation for `issuer` attribute to support GitHub actions customization for enterprise. See [Customizing the issuer value for an enterprise](https://docs.github.com/en/enterprise-cloud@latest/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-issuer-value-for-an-enterprise). PR: [#163](https://github.com/jfrog/terraform-provider-platform/pull/163) and [#164](https://github.com/jfrog/terraform-provider-platform/pull/164)

## 1.18.0 (November 21, 2024). Tested on Artifactory 7.98.8 with Terraform 1.9.8 and OpenTofu 1.8.5
## 1.18.0 (November 21, 2024). Tested on Artifactory 7.98.9 with Terraform 1.9.8 and OpenTofu 1.8.6

IMPROVEMENTS:

Expand Down
4 changes: 2 additions & 2 deletions pkg/platform/resource_oidc_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ func (r odicConfigurationResource) ValidateConfig(ctx context.Context, req resou
return
}

if data.ProviderType.ValueString() == gitHubProviderType && strings.HasPrefix(data.IssuerURL.ValueString(), gitHubProviderURL) {
if data.ProviderType.ValueString() == gitHubProviderType && !strings.HasPrefix(data.IssuerURL.ValueString(), gitHubProviderURL) {
resp.Diagnostics.AddAttributeError(
path.Root("issuer_url"),
"Invalid Attribute Configuration",
fmt.Sprintf("issuer_url must starts with %s when provider_type is set to '%s'.", gitHubProviderURL, gitHubProviderType),
fmt.Sprintf("issuer_url must start with %s when provider_type is set to '%s'.", gitHubProviderURL, gitHubProviderType),
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/platform/resource_oidc_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestAccOIDCConfiguration_invalid_provider_type_issuer_url(t *testing.T) {
Steps: []resource.TestStep{
{
Config: config,
ExpectError: regexp.MustCompile(`must be start with https:\/\/token\.actions\.githubusercontent\.com[^\/]`),
ExpectError: regexp.MustCompile(`.*must start with https:\/\/token\.actions\.githubusercontent\.com[^\/].*`),
},
},
})
Expand Down Expand Up @@ -275,7 +275,7 @@ func TestAccOIDCConfiguration_custom_provider_type_issuer_url(t *testing.T) {
Steps: []resource.TestStep{
{
Config: config,
Check: resource.TestCheckResourceAttr(fqrn, "issuer_url", testData["issuer_url"])},
Check: resource.TestCheckResourceAttr(fqrn, "issuer_url", testData["issuerURL"])},
},
})
}

0 comments on commit be2e60c

Please sign in to comment.