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

feat(custodian): add support for authorization for accessing keys #24

Merged
merged 5 commits into from
Oct 9, 2024

Conversation

NishantJoshi00
Copy link
Member

Description

Adding custodian support. Adding support for Basic authentication on top of mTLS, to make sure that the keys being accessed belong to the respective party.

src/config.rs Show resolved Hide resolved
src/core/crypto/custodian.rs Outdated Show resolved Hide resolved
src/core/crypto/crux.rs Outdated Show resolved Hide resolved
) -> errors::CustomResult<DecryptedDataGroup, errors::CryptoError> {
let version = FxHashSet::from_iter(self.0.values().map(|d| d.version));
let decrypted_keys = Key::get_multiple_keys(state, identifier, version)
.await
.switch()?;

let mut stored_tokens = decrypted_keys.values().map(|k| &k.token);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let mut stored_tokens = decrypted_keys.values().map(|k| &k.token);
let stored_tokens = decrypted_keys.values().map(|k| &k.token);

Copy link
Member Author

Choose a reason for hiding this comment

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

It's required, as it's a opaque type that will be acted upon: when we call .all on it

src/core/crypto/crux.rs Outdated Show resolved Hide resolved
src/core/crypto/crux.rs Outdated Show resolved Hide resolved
@dracarys18
Copy link
Member

Sure looks good to me, please test it once

@dracarys18 dracarys18 merged commit 92b82c6 into main Oct 9, 2024
@dracarys18 dracarys18 deleted the key-custodian branch October 9, 2024 07:05
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.

3 participants