-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add directory paths to KV capabilities checks #24404
Conversation
Build Results: |
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 a couple of questions surrounding fullSecretPath
.
@@ -95,9 +95,14 @@ export default class KvSecretMetadataModel extends Model { | |||
}; | |||
} | |||
|
|||
get permissionsPath() { | |||
return this.fullSecretPath || this.path; |
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.
Curious why fullSecretPath
wouldn't always be the value to use if it represents the full path to the secret.
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.
Because it's generated by the serializer (not easy to see from the diff). And the payload does not always return data.keys. See here.
An example of when the serializer wouldn't return this.fullSecretPath is when we're looking at a secret's details.
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 fixing this! 🎉
* add getter to metadata model * add changelog and data model fix * add test coverage * add nested create coverage * Update 24404.txt * remove from data model * return to how it was
Fixes Issue #24130
Follow the instructions from the original issue to duplicate. The bug occurred because we were passing in
path
to the capabilities check butpath
does not include the full path name.Ex: for secret
beep/bop/boop
We would always pass in
boop
even if we were searching for the list return ofbeep/bop/
Now we pass in
beep/
orbeep/bop/
orbeep/bop/bop
depending on the path in the URL for the view.Screenshots using the policy on the issue
Before:
After: