Skip to content

Conversation

NishantJoshi00
Copy link
Contributor

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.

) -> 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
Contributor

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
Contributor 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

@dracarys18
Copy link
Contributor

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
Willem-Barkhuizen added a commit to Willem-Barkhuizen/hyperswitch-helm that referenced this pull request Jun 30, 2025
\#### Summary
This commit adds the required secrets supporting the changes made to the
`hyperswitch-encryption-service` package in the following two PRs:

* [feat(custodian): add support for authorization for accessing keys](juspay/hyperswitch-encryption-service#24)
* [refactor: kms encrypt blake3 hash key](juspay/hyperswitch-encryption-service#35)

\#### Testing

Pointed our local CDK package, also containing changes to be PR'ed, at
this chart and the resultant `keymanager` pod launched successfully.

Some extracts:

* `keymanager-secrets-hs-keymanager` Secret
```
apiVersion: v1
data:
  CRIPTA__CERTS__ROOT_CA:
  CRIPTA__CERTS__TLS_CERT: <SECRET>
  CRIPTA__CERTS__TLS_KEY: <SECRET>
  CRIPTA__SECRETS__ACCESS_TOKEN: <SECRET>
  CRIPTA__SECRETS__HASH_CONTEXT: <SECRET>
  CRIPTA__SECRETS__KMS_CONFIG__KEY_ID: <SECRET>
  CRIPTA__SECRETS__KMS_CONFIG__REGION: <SECRET>
kind: Secret
metadata:
  annotations:
...
type: Opaque
```

* `keymanager-hs-keymanager-<ID>` Pod
```
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2025-06-27T17:48:56Z"
  generateName: keymanager-hs-keymanager-<ID>
...
  uid: <UID>
spec:
  containers:
  - env:
...
    - name: CRIPTA__SECRETS__ACCESS_TOKEN
      valueFrom:
        secretKeyRef:
          key: CRIPTA__SECRETS__ACCESS_TOKEN
          name: keymanager-secrets-hs-keymanager
    - name: CRIPTA__SECRETS__HASH_CONTEXT
      valueFrom:
        secretKeyRef:
          key: CRIPTA__SECRETS__HASH_CONTEXT
          name: keymanager-secrets-hs-keymanager
...
```

* `keymanager` Pod logs
```
{"timestamp":"2025-06-27T17:49:10.256534Z","level":"INFO","fields":{"message":"Application starting [Server { port: 5000, host: \"0.0.0.0\" }...}
{"timestamp":"2025-06-27T17:49:10.578842Z","level":"INFO","fields":{"message":"Metrics Server started at [Server { port: 6128, host: \"0.0.0.0\" }]"},"target":"cripta"}
```

---

Signed-Off-By: Willem Barkhuizen (<[email protected]>)
Willem-Barkhuizen added a commit to Willem-Barkhuizen/hyperswitch-helm that referenced this pull request Jun 30, 2025
\#### Summary
This commit adds the required secrets supporting the changes made to the
`hyperswitch-encryption-service` package in the following two PRs:

* [feat(custodian): add support for authorization for accessing keys](juspay/hyperswitch-encryption-service#24)
* [refactor: kms encrypt blake3 hash key](juspay/hyperswitch-encryption-service#35)

\#### Testing

Pointed our local CDK package, also containing changes to be PR'ed, at
this chart and the resultant `keymanager` pod launched successfully.

Some extracts:

* `keymanager-secrets-hs-keymanager` Secret
```
apiVersion: v1
data:
  CRIPTA__CERTS__ROOT_CA:
  CRIPTA__CERTS__TLS_CERT: <SECRET>
  CRIPTA__CERTS__TLS_KEY: <SECRET>
  CRIPTA__SECRETS__ACCESS_TOKEN: <SECRET>
  CRIPTA__SECRETS__HASH_CONTEXT: <SECRET>
  CRIPTA__SECRETS__KMS_CONFIG__KEY_ID: <SECRET>
  CRIPTA__SECRETS__KMS_CONFIG__REGION: <SECRET>
kind: Secret
metadata:
  annotations:
...
type: Opaque
```

* `keymanager-hs-keymanager-<ID>` Container
```
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2025-06-27T17:48:56Z"
  generateName: keymanager-hs-keymanager-<ID>
...
  uid: <UID>
spec:
  containers:
  - env:
...
    - name: CRIPTA__SECRETS__ACCESS_TOKEN
      valueFrom:
        secretKeyRef:
          key: CRIPTA__SECRETS__ACCESS_TOKEN
          name: keymanager-secrets-hs-keymanager
    - name: CRIPTA__SECRETS__HASH_CONTEXT
      valueFrom:
        secretKeyRef:
          key: CRIPTA__SECRETS__HASH_CONTEXT
          name: keymanager-secrets-hs-keymanager
...
```

* `keymanager` Pod logs
```
{"timestamp":"2025-06-27T17:49:10.256534Z","level":"INFO","fields":{"message":"Application starting [Server { port: 5000, host: \"0.0.0.0\" }...}
{"timestamp":"2025-06-27T17:49:10.578842Z","level":"INFO","fields":{"message":"Metrics Server started at [Server { port: 6128, host: \"0.0.0.0\" }]"},"target":"cripta"}
```

---

Signed-Off-By: Willem Barkhuizen (<[email protected]>)
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