-
Notifications
You must be signed in to change notification settings - Fork 19
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 write-ahead-logs to cleanup any orphaned Service Principals #42
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catsby
changed the title
Wal app delete
Use write-ahead-logs to cleanup any orphaned Service Principals
Jul 21, 2020
kalafut
reviewed
Jul 23, 2020
kalafut
approved these changes
Jul 23, 2020
Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com>
calvn
approved these changes
Jul 23, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor question, otherwise looks good! Liked the TestSP_WAL_Cleanup
test a lot!
Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
catsby
added a commit
that referenced
this pull request
Aug 18, 2020
* Use WAL for App cleanup * Fix typo * Reduce maxWALAge * Add StringToTimeHookFunc to decoding of WAL entries * add new errMockProvider struct to simulate an error * rough test * small refactor * refactor * Update path_service_principal_test.go Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> * Update path_service_principal.go Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
catsby
added a commit
that referenced
this pull request
Aug 18, 2020
* Use WAL for App cleanup * Fix typo * Reduce maxWALAge * Add StringToTimeHookFunc to decoding of WAL entries * add new errMockProvider struct to simulate an error * rough test * small refactor * refactor * Update path_service_principal_test.go Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> * Update path_service_principal.go Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
This was referenced Aug 18, 2020
catsby
added a commit
that referenced
this pull request
Aug 18, 2020
…#44) * Use WAL for App cleanup * Fix typo * Reduce maxWALAge * Add StringToTimeHookFunc to decoding of WAL entries * add new errMockProvider struct to simulate an error * rough test * small refactor * refactor * Update path_service_principal_test.go Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> * Update path_service_principal.go Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
kalafut
pushed a commit
that referenced
this pull request
Aug 18, 2020
* Use write-ahead-logs to cleanup any orphaned Service Principals (#42) * Use WAL for App cleanup * Fix typo * Reduce maxWALAge * Add StringToTimeHookFunc to decoding of WAL entries * add new errMockProvider struct to simulate an error * rough test * small refactor * refactor * Update path_service_principal_test.go Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> * Update path_service_principal.go Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com> * add time * update test to use old error words Co-authored-by: Jim Kalafut <jkalafut@hashicorp.com> Co-authored-by: Calvin Leung Huang <cleung2010@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Use Vault's WAL integration to ensure any service principals that are created when credentials are requested are then cleaned up if we fail to assign the roles. This could happen in instances where eventually consistency or otherwise timeouts occur during role assignment. For most cases, if the assignment succeeds the WAL will be deleted harmlessly. Included is a test
TestSP_WAL_Cleanup
that simulates a failure to assign a role and ensures the WAL record triggers a deletion.Contributor Checklist
Tests: