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

Use mutex in OIDC configuration handlers #12932

Merged
merged 2 commits into from Oct 27, 2021
Merged

Conversation

austingebauer
Copy link
Member

This PR adds use of the oidcLock in configuration handlers for Vault OIDC provider. The purpose of using this lock is to avoid race conditions where concurrent configuration changes could leave relationships between resources in an inconsistent state. For example, we implement checks to ensure that named resource references (e.g., client->assignment, provider->scopes_supported) exist. Using a mutex for writes ensures that the reference checks won't race.

The mutex is not used to protect unsafe memory in this case. All in-memory data structures (go-memdb, go-cache) internally use a mutex or provide safe concurrent access through other means.

@vercel vercel bot temporarily deployed to Preview – vault October 26, 2021 23:01 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 26, 2021 23:01 Inactive
@austingebauer austingebauer merged commit b8a5d6a into main Oct 27, 2021
@austingebauer austingebauer deleted the oidc-provider-config-mutex branch October 27, 2021 15:23
qk4l pushed a commit to qk4l/vault that referenced this pull request Feb 4, 2022
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.

None yet

4 participants