Skip to content

feat: DSPX-2580 key management quickstart provider root key example#234

Open
eugenioenko wants to merge 1 commit intomainfrom
feat/DSPX-2580-provider-root-key-example
Open

feat: DSPX-2580 key management quickstart provider root key example#234
eugenioenko wants to merge 1 commit intomainfrom
feat/DSPX-2580-provider-root-key-example

Conversation

@eugenioenko
Copy link
Contributor

@eugenioenko eugenioenko commented Mar 10, 2026

Pull request overview

Adds documentation for using the key-management KEY_MODE_PROVIDER_ROOT_KEY flow in the quickstart, clarifying how to register keys where wrapping/unwrapping is delegated to an external KMS/HSM while the wrapped key material is still stored in the platform DB.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for using the key-management KEY_MODE_PROVIDER_ROOT_KEY flow in the quickstart, clarifying how to register keys where wrapping/unwrapping is delegated to an external KMS/HSM while the wrapped key material is still stored in the platform DB.

Changes:

  • Replace the previous “remote key reference” transition text with an explanation + example request for KEY_MODE_PROVIDER_ROOT_KEY
  • Document the field-level differences between KEY_MODE_CONFIG_ROOT_KEY and KEY_MODE_PROVIDER_ROOT_KEY (including provider_config_id)
  • Update the “Important additional comments” note to include KEY_MODE_PROVIDER_ROOT_KEY for base64 wrapped_key expectations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the key management quickstart documentation by integrating an example for KEY_MODE_PROVIDER_ROOT_KEY. This addition clarifies how users can configure the platform to utilize external Key Management Systems (KMS) or Hardware Security Modules (HSM) for wrapping private keys, thereby improving flexibility and security for key storage.

Highlights

  • KEY_MODE_PROVIDER_ROOT_KEY Example: Introduced a new section in the key management quickstart guide, providing a detailed JSON example and explanation for registering a key using KEY_MODE_PROVIDER_ROOT_KEY, which leverages external KMS/HSM for key wrapping.
  • wrapped_key Encoding Clarification: Updated the documentation to explicitly state that the wrapped_key is expected to be base64 encoded when creating keys with KEY_MODE_CONFIG_ROOT_KEY or the newly added KEY_MODE_PROVIDER_ROOT_KEY.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/components/policy/keymanagement/quickstart.md
    • Added a comprehensive example and explanation for the KEY_MODE_PROVIDER_ROOT_KEY to illustrate its usage with external key management systems.
    • Modified a note to include KEY_MODE_PROVIDER_ROOT_KEY when describing the base64 encoding requirement for wrapped_key.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new example for KEY_MODE_PROVIDER_ROOT_KEY to the key management quickstart documentation. The changes are clear and provide a good explanation of this key mode. I've made one suggestion to improve the consistency of the new JSON example to avoid potential confusion for users.

Note: Security Review has been skipped due to the limited scope of the PR.

@eugenioenko eugenioenko force-pushed the feat/DSPX-2580-provider-root-key-example branch 5 times, most recently from 4da9bd4 to 6465ef6 Compare March 10, 2026 18:59
@eugenioenko eugenioenko force-pushed the feat/DSPX-2580-provider-root-key-example branch from 6465ef6 to 8b1a9a7 Compare March 10, 2026 19:01
},
"private_key_ctx": {
"wrapped_key": "<base64-encoded-wrapped-private-key>",
"key_id": "arn:aws:kms:us-east-1:123456789012:key/mrk-1234abcd-12ab-34cd-56ef-1234567890ab",
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use a generic provider_id. Don't want to imply AWS KMS support in OpenTDF. Also please scrub for any other AWS KMS references in the doc

- **private_key_ctx.wrapped_key** contains the private key already wrapped (encrypted) by the external KMS/HSM, base64-encoded. The platform stores this ciphertext and delegates unwrapping to the external KMS/HSM at rewrap time.
- **private_key_ctx.key_id** identifies the specific wrapping key within the provider (e.g. a KMS key ID or alias). KAS uses this when it needs to unwrap the private key during a rewrap operation.

### KEY_MODE_REMOTE (mode 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we standardize terminology to use envelope mode (2) and delegated mode (3)?

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