-
Notifications
You must be signed in to change notification settings - Fork 0
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
Vault Support (GSI-973) #8
Conversation
Update lock files, openapi, config, readme Add vault config to sms config
Remove custom errors -- are not used
Compartmentalize VaultConfig
Pull Request Test Coverage Report for Build 11593029394Details
💛 - Coveralls |
Given that only the case of EKSS exists at the moment, the current SMS configuration is enough but also limited to only one SMS per path in the vault. It would be more convenient not to have only one Security vise it should be safe because the policies attached to the token grant the necessary permissions for those paths. It may require catching the case of permission error in the code to return an appropriate response to the requester. |
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.
In addition to what was already said, there's one small doc inconsistency
secrets_handler: dummies.SecretsHandlerPortDummy, | ||
_token: Annotated[TokenAuthContext, require_token], | ||
): | ||
"""Delete one or more secrets from the vault""" |
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.
It's deleting all of them, though
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.
Agh, outdated docstring. Thought I got all of that. Thanks
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 say: it looks good, thank you.
tests/fixtures/dummies.py
Outdated
"""Delete all secrets stored in the vault.""" | ||
self.secrets = [] | ||
self.secrets.pop(vault_path, None) |
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.
This would also remove the key from the dict.
Is this intended?
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've removed the whole dummy class and replaced it with Mock in 536198b
AsyncTestClient(app=app) as client, | ||
): | ||
response = await client.get("/secrets/doesnotexist", headers=HEADERS) | ||
assert response.status_code == 200 |
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.
Why is this a 200?
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 think because you cannot distinguish the invalid path from an empty path, it returns an empty list in either case, and I think it should.
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.
Regardless of if you return an empty list or raise an error, you can't tell if it's a path problem or an empty vault.
But a non-existent vault has no secrets, so I don't really see a problem with doing it that way.
GET /secrets/{vault_path}
: returns a list of all keys in the specified vaultDELETE /secrets/{vault_path}
: deletes all keys in the specified vault