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

Port: Premature Rotation For autorotate #12563

Merged
merged 29 commits into from
Sep 22, 2021
Merged

Port: Premature Rotation For autorotate #12563

merged 29 commits into from
Sep 22, 2021

Conversation

HridoyRoy
Copy link
Contributor

@HridoyRoy HridoyRoy commented Sep 15, 2021

@HridoyRoy HridoyRoy requested a review from a team September 15, 2021 18:13
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 15, 2021 19:35 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 15, 2021 19:35 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 15, 2021 20:00 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 15, 2021 20:00 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 16, 2021 14:14 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 16, 2021 14:14 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 16, 2021 16:29 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 16, 2021 16:29 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 17, 2021 17:34 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 17, 2021 17:34 Inactive
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 17, 2021 17:49 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 17, 2021 17:49 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 21, 2021 15:37 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 21, 2021 15:37 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 21, 2021 16:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 21, 2021 16:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 21, 2021 22:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 21, 2021 22:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 21, 2021 22:06 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 21, 2021 22:06 Inactive
Copy link
Contributor

@calvn calvn left a comment

Choose a reason for hiding this comment

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

One question on initQueue that came up during testing review. Otherwise looks good!

@vercel vercel bot temporarily deployed to Preview – vault September 21, 2021 23:55 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 21, 2021 23:55 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 22, 2021 00:07 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 22, 2021 00:07 Inactive
@calvn calvn added this to the 1.9 milestone Sep 22, 2021
@calvn calvn merged commit 0af4218 into main Sep 22, 2021
@calvn calvn deleted the vault-2485 branch September 22, 2021 00:45
calvn pushed a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>
# Conflicts:
#	builtin/logical/database/path_roles.go
#	builtin/logical/database/rotation.go
calvn added a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>
calvn added a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>
calvn added a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>
# Conflicts:
#	builtin/logical/database/path_roles.go
#	builtin/logical/database/rotation.go

Co-authored-by: Hridoy Roy <[email protected]>
calvn added a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>

Co-authored-by: Hridoy Roy <[email protected]>
Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
calvn added a commit that referenced this pull request Sep 22, 2021
* port of ldap fix for early cred rotation

* some more porting

* another couple lines to port

* final commits before report

* remove deadlock

* needs testing

* updates

* Sync with OpenLDAP PR

* Update the update error handling for items not found in the queue

* WIP unit tests
* Need to configure DB mount correctly, with db type mockv5
* Need to find a way to inject errors into that mock db

* throw error on role creation failure

* do not swallow error on role creation

* comment out wip tests and add in a test for disallowed role

* Use newly generated password in WAL

Co-authored-by: Michael Golowka <[email protected]>

* return err on popFromRotationQueueByKey error; cleanup on setStaticAccount

* test: fix TestPlugin_lifecycle

* Uncomment and fix unit tests
* Use mock database plugin to inject errors
* Tidy test code to rely less on code internals where possible
* Some stronger test assertions

* Undo logging updates

* Add changelog

* Remove ticker and background threads from WAL tests

* Keep pre-existing API behaviour of allowing update static role to act as a create

* Switch test back to update operation

* Revert my revert, and fix some test bugs

* Fix TestBackend_StaticRole_LockRegression

* clean up defer on TestPlugin_lifecycle

* unwrap reqs on cleanup

* setStaticAccount: don't hold a write lock

* TestStoredWALsCorrectlyProcessed: set replication state to unknown

Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
Co-authored-by: Calvin Leung Huang <[email protected]>

Co-authored-by: Hridoy Roy <[email protected]>
Co-authored-by: Tom Proctor <[email protected]>
Co-authored-by: Michael Golowka <[email protected]>
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.

6 participants