Use Ceph Monitor's KV store to persist keys/secrets#28
Draft
JoshuaGabriel wants to merge 5 commits into
Draft
Conversation
Load or create the auth server RSA signing key from monitor config-key storage so JWTs remain valid across process restarts. Signed-off-by: Joshua Blanch <joshua.blanch@clyso.com>
Signed-off-by: Joshua Blanch <joshua.blanch@clyso.com>
if we have multiple ceph-api processes starting at the same time, they can both miss in load() and generate a key then also call config-key set at the same time. Signed-off-by: Joshua Blanch <joshua.blanch@clyso.com>
store fosite's GlobalSecret in config-key alongside JWT key. Signed-off-by: Joshua Blanch <joshua.blanch@clyso.com>
rename storeJWTKey and LoadJWTKey to have similar logic to GlobalSecret pair Signed-off-by: Joshua Blanch <joshua.blanch@clyso.com>
This file contains hidden or 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
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.
As of now we are storing everything ceph-api needs into the fs. If we are planning to deploy this on the cluster we should persist keys/secrets/tokens (everything) on the monitor's kv.
This is the simplest way to have some persistence besides bringing in an external db or just on the filesystem.
This PR implements storing the JWT key and the GlobalSecret fosite uses.
Storing it under:
ceph-api/auth/jwt-key/active
ceph-api/auth/global-secret/active
we should nest this way to make use of 'config-key dump' interface instead of listing as much as possible
This PR is stacked on top of #27