Skip to content

identity/group-alias: add api client lock - #2140

Merged
fairclothjm merged 6 commits into
mainfrom
VAULT-12098/identity-group-alias-lock
Feb 14, 2024
Merged

identity/group-alias: add api client lock#2140
fairclothjm merged 6 commits into
mainfrom
VAULT-12098/identity-group-alias-lock

Conversation

@fairclothjm

@fairclothjm fairclothjm commented Feb 13, 2024

Copy link
Copy Markdown
Collaborator

Description

Relates #1695

I haven't been able to reproduce the issue from #1695 yet, but the lack of locking here is quite suspicious.

Checklist

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

Comment thread CHANGELOG.md
* Add support for configuration of plugin WIF to the AWS Secret Backend. Requires Vault 1.16+ ([#2138](https://github.com/hashicorp/terraform-provider-vault/pull/2138)).
* Add support for Oracle database plugin configuration options `split_statements` and `disconnect_sessions`: ([#2085](https://github.com/hashicorp/terraform-provider-vault/pull/2085))

IMPROVEMENTS:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Or BUG? I went with improvement since I have not been able to verify that this fixes the reported error.

@fairclothjm fairclothjm added this to the 3.25.0 milestone Feb 13, 2024
@fairclothjm

Copy link
Copy Markdown
Collaborator Author

@github-actions github-actions Bot added size/S and removed size/XS labels Feb 13, 2024

@vinay-gopalan vinay-gopalan left a comment

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.

Thanks for looking into this! Though it is hard to come up with a testcase using just the TF testing framework that can validate the exact fix for the issue, I do think this is a valid addition to the code, as it matches the Group Alias resource behavior to the Entity Alias resource (both of which support performance secondaries and standbys). Had 1 nit but looks good to me otherwise 👍🏼

}

func identityGroupAliasCreate(d *schema.ResourceData, meta interface{}) error {
lock, unlock := getEntityLockFuncs(d, identityGroupAliasIDPath)

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.

nit: is it worth updating the function name to something more generic, like getLockFuncs since it is not specific to entities?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think I will keep it as-is since an Identity Group is a collection of Entities and the lock keys that we create are specific to entities in that the key is tied to the mount accessor. I don't see this function being used much or at all outside of entities use cases.

@github-actions github-actions Bot added size/M and removed size/S labels Feb 14, 2024
@fairclothjm
fairclothjm merged commit 07da515 into main Feb 14, 2024
@fairclothjm
fairclothjm deleted the VAULT-12098/identity-group-alias-lock branch February 14, 2024 19:12
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.

2 participants