Skip to content

Added ProviderType attribute in saml settings#1303

Merged
skj-skj merged 6 commits intomainfrom
skj/saml-provider-type
Apr 7, 2026
Merged

Added ProviderType attribute in saml settings#1303
skj-skj merged 6 commits intomainfrom
skj/saml-provider-type

Conversation

@skj-skj
Copy link
Copy Markdown
Contributor

@skj-skj skj-skj commented Apr 1, 2026

Description

This PR introduces support for configuring the provider-type SAML setting. It allows administrators to specify the identity provider type (e.g., okta, entra, or generic saml) directly in their TFE admin SAML configuration.

Testing plan

  1. Added validation for the ProviderType field inside TestAdminSettings_SAML_Read to confirm the value is successfully read.
  2. Added a new sub-test ("with provider type defined") inside TestAdminSettings_SAML_Update to verify updates pass for valid provider types (okta, entra, saml, unknown) and appropriately error out on invalid ones.

External links

Output from tests

image

Rollback Plan

we can revert this pr

Changes to Security Controls

NA

@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

datadog-terraform-cloud-hashicorp bot commented Apr 1, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a15f4a7 | Docs | Was this helpful? Give us feedback!

@skj-skj skj-skj requested a review from Copilot April 1, 2026 13:11
@skj-skj skj-skj self-assigned this Apr 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the provider-type SAML admin setting by exposing it in the Go client models and covering it with integration tests.

Changes:

  • Add ProviderType to AdminSAMLSetting.
  • Add ProviderType to AdminSAMLSettingsUpdateOptions so the setting can be updated via the API.
  • Extend SAML admin integration tests to read and update provider-type.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
CHANGELOG.md Documents the new ProviderType field for SAML admin settings.
admin_setting_saml.go Adds JSONAPI attribute mapping for provider-type on read and update option structs.
admin_setting_saml_integration_test.go Adds assertions and a new subtest to exercise ProviderType behavior end-to-end.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@skj-skj skj-skj marked this pull request as ready for review April 6, 2026 08:45
@skj-skj skj-skj requested a review from a team as a code owner April 6, 2026 08:45
Copy link
Copy Markdown
Contributor

@Maed223 Maed223 left a comment

Choose a reason for hiding this comment

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

Smoke tested and works as expected. Just an open question below.

WantAssertionsSigned *bool `jsonapi:"attr,want-assertions-signed,omitempty"`
SignatureSigningMethod *string `jsonapi:"attr,signature-signing-method,omitempty"`
SignatureDigestMethod *string `jsonapi:"attr,signature-digest-method,omitempty"`
ProviderType *string `jsonapi:"attr,provider-type,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think having a type with a set of consts would be a helpful user hint here

Such as:

type ProviderType string

const (
   ProviderTypeOkta    ProviderType = "okta"
   ...
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Though if the value here isn't being constrained in any way, then ignore this point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thx for the suggestion, I have added the type.

})

t.Run("with provider type defined", func(t *testing.T) {
providerTypesForTesting := []string{"okta", "entra", "saml", "unknown", "error"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The inclusion of the assertion on "unknown" here feels a bit off, though I'm not very familiar with the backing API. If the intention is to have a constrained set, then the way the test is currently setup could hide regressions. Open question for me is whether the provider type is intentionally open ended to allow non-standard values.

Nit: this test could be better expressed being table driven. Just so the expected intentions/outcomes are easily parseable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

backend can only have these 4 values: "okta", "entra", "saml" and "unknown".
"unknown" is for backward compatibility, so it will be the default value.

I have update the test to table driven, thx for the suggestion.
and I have also added validtion as well.

@skj-skj skj-skj merged commit 0fafe76 into main Apr 7, 2026
15 checks passed
@skj-skj skj-skj deleted the skj/saml-provider-type branch April 7, 2026 14:24
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants