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

Support missing token parameters on vault_okta_auth_backend resource #2210

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

vinay-gopalan
Copy link
Contributor

@vinay-gopalan vinay-gopalan commented Mar 25, 2024

Description

Supports missing common token parameters.

Relates OR Closes #1353

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
  • Acceptance tests where run against all supported Vault Versions

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccOktaAuthBackend_TokenFields'
=== RUN   TestAccOktaAuthBackend_TokenFields
=== PAUSE TestAccOktaAuthBackend_TokenFields
=== CONT  TestAccOktaAuthBackend_TokenFields
--- PASS: TestAccOktaAuthBackend_TokenFields (1.51s)
PASS

@vinay-gopalan vinay-gopalan added this to the 4.3.0 milestone May 30, 2024
@vinay-gopalan vinay-gopalan marked this pull request as ready for review June 11, 2024 22:58
@vinay-gopalan vinay-gopalan changed the title add token fields to okta auth backend config resource Support missing token parameters on vault_okta_auth_backend resource Jun 11, 2024
@@ -262,188 +275,14 @@ resource "vault_okta_auth_backend" "test" {
`, path, organization)
}

func testAccOktaAuthBackend_InitialCheck(s *terraform.State) error {
Copy link
Contributor Author

@vinay-gopalan vinay-gopalan Jun 11, 2024

Choose a reason for hiding this comment

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

This is a legacy style of checking parameters that introduced a panic. Updated to use the newer style of using resource.TestCheckAttr

Default: "0",
ValidateFunc: validateOktaTTL,
StateFunc: normalizeOktaTTL,
Deprecated: "Deprecated. Please use `token_max_ttl` instead.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were previously supported in lieu of the token_ttl and token_max_ttl fields. Since we are adding parity for those fields, these can now be deprecated.

@vinay-gopalan vinay-gopalan requested a review from a team June 12, 2024 21:24
Copy link
Contributor

@Zlaticanin Zlaticanin left a comment

Choose a reason for hiding this comment

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

This all looks good to me! Great job! 👏
I had one question, just to verify - Were these parameters added later on to Okta? Do we need to guard them with a version check, or are these available in most versions?

@vinay-gopalan
Copy link
Contributor Author

This all looks good to me! Great job! 👏 I had one question, just to verify - Were these parameters added later on to Okta? Do we need to guard them with a version check, or are these available in most versions?

Good question! Looks like these fields have existed since before Vault 1.10.x and they just hadn't been included in the resource 😬 So we should be good, thanks for confirming 🙏🏼

@vinay-gopalan vinay-gopalan merged commit c33181b into main Jun 13, 2024
12 checks passed
@vinay-gopalan vinay-gopalan deleted the VAULT-5183/okta-auth-token-fields branch June 13, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vault_okta_auth_backend: Support token_policies (and other) Parameters
3 participants