-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Cubbyhole cleanup #6006
Cubbyhole cleanup #6006
Conversation
Could we add a test that will make sure cubbyhole entries are cleaned up once a token is revoked? |
@briankassouf Test for cubbyhole deletion is added. |
@vishalnayak when I pull this branch and go through the steps to reproduce in the linked ticket, I'm still seeing that the count returned doesn't return to the original one.
|
@tyrannosaurus-becks Can you please see which storage key is getting dangled? |
@vishalnayak when I start with a fresh, initialized postgres db with no other secrets (in my previous example it wasn't fresh), I initially have 17 records in the
|
ClientToken: root, | ||
} | ||
|
||
resp := testMakeTokenViaRequest(t, ts, tokenReq) |
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.
I wonder if we can inject some legacy style tokens to make sure we are not accidentally removing salted cubbyhole IDs?
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.
I'll think if I can do this tomorrow morning.
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.
If the token IDs are supplied, we force SHA1 hashing. I've added such tokens into the sample space for both tests.
@tyrannosaurus-becks That might be an issue with the MySQL backend, maybe try with the file or consul backend? |
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.
Just one comment around further testing, otherwise looks good
@tyrannosaurus-becks That is really surprising. I am really clueless as to what could be happening with postgres. I have tested this with the file backend and it is working. You would have done the right thing, but I am tempted to ask you to recheck if the binary has the fix :-) |
Keep in mind that there may be two separate problems. It's the responsibility of the storage backend to remove a prefix no longer in use. Investigating that may have identified a totally different issue that affects more than just postgres. I don't know for sure that this is what's going on but we've had other issues in the past related to various storage backends not cleaning up prefixes appropriately. |
@tyrannosaurus-becks I have verified the fix to be working in both file and consul backends. |
@vishalnayak I re-tested and you were exactly right! I'd been testing with a different binary than the branch's. This is working for me! I verified the key count returned to the original. |
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.
Thanks for making those test changes, looks good!
Fixes #5959