Skip to content

feat(core): support namespaced registered resources#767

Open
alkalescent wants to merge 1 commit intomainfrom
DSPX-2496-ns-rr
Open

feat(core): support namespaced registered resources#767
alkalescent wants to merge 1 commit intomainfrom
DSPX-2496-ns-rr

Conversation

@alkalescent
Copy link
Contributor

This PR adds CLI and E2E test support for namespaced registered resources.

@alkalescent alkalescent requested review from a team as code owners March 3, 2026 18:54
@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 otdfctl CLI and underlying policy handlers by introducing comprehensive support for namespaced registered resources. This change allows registered resources to be logically grouped and managed within specific namespaces, improving resource organization and preventing naming conflicts. The updates span across CLI command definitions, backend handler logic, and end-to-end tests to ensure full functionality and stability of this new feature.

Highlights

  • Namespace Support for Registered Resources: Introduced the ability to associate registered resources with namespaces, enhancing organization and isolation within the system.
  • CLI Updates: Modified otdfctl commands for registered resources (create, get, list, values create, values list) to accept an optional or required --namespace flag, allowing users to specify the namespace for operations.
  • Handler Function Enhancements: Updated core handler functions (CreateRegisteredResource, GetRegisteredResource, ListRegisteredResources) to incorporate namespace parameters, enabling the backend to process namespaced resource requests.
  • E2E Test Coverage: Expanded end-to-end tests to validate the new namespace functionality, including creating namespaces and then creating/managing registered resources within those namespaces.
  • Documentation Updates: Updated CLI documentation (docs/man) to reflect the addition of the --namespace flag for relevant registered resource commands.
  • Dependency Updates: Updated Go module dependencies for opentdf/platform/protocol/go and opentdf/platform/sdk, and added a new indirect dependency github.com/cespare/xxhash/v2.

🧠 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
  • cmd/policy/registeredResources.go
    • Added a required 'namespace' flag to the policyCreateRegisteredResource command.
    • Modified the policyCreateRegisteredResource function call to CreateRegisteredResource to include the new namespace parameter.
    • Added an optional 'namespace' flag to the policyGetRegisteredResource command.
    • Modified the policyGetRegisteredResource function call to GetRegisteredResource to include the new namespace parameter.
    • Added an optional 'namespace' flag to the policyListRegisteredResources command.
    • Modified the policyListRegisteredResources function call to ListRegisteredResources to include the new namespace parameter.
    • Modified the policyDeleteRegisteredResource function call to GetRegisteredResource to include an empty namespace parameter.
    • Added an optional 'namespace' flag to the policyCreateRegisteredResourceValue command.
    • Modified the policyCreateRegisteredResourceValue function call to GetRegisteredResource to include the new namespace parameter.
    • Added an optional 'namespace' flag to the policyListRegisteredResourceValues command.
    • Modified the policyListRegisteredResourceValues function call to GetRegisteredResource to include the new namespace parameter.
    • Added 'namespace' flags to the getDoc, listDoc, createDoc, listValuesDoc, and createValueDoc command definitions.
  • docs/man/policy/registered-resources/create.md
    • Updated the description for the 'name' flag to specify uniqueness within a Namespace.
    • Added a new 'namespace' flag with description and marked as required.
  • docs/man/policy/registered-resources/get.md
    • Added a new 'namespace' flag with description for name-based lookups.
  • docs/man/policy/registered-resources/list.md
    • Added a new 'namespace' flag with description to filter results.
  • docs/man/policy/registered-resources/values/create.md
    • Added a new 'namespace' flag with description, required when resource is a name.
  • docs/man/policy/registered-resources/values/list.md
    • Added a new 'namespace' flag with description, required when resource is a name.
  • e2e/registered-resources.bats
    • Added setup steps to create a namespace before creating registered resources.
    • Updated the policy registered-resources create command to include the --namespace flag.
    • Modified various test cases to pass the --namespace flag when creating registered resources.
  • go.mod
    • Updated the version of github.com/opentdf/platform/protocol/go.
    • Updated the version of github.com/opentdf/platform/sdk.
    • Added github.com/cespare/xxhash/v2 as an indirect dependency.
    • Updated the version of go.opentelemetry.io/otel and related modules.
    • Updated the version of golang.org/x/sys.
  • go.sum
    • Added checksums for github.com/cespare/xxhash/v2.
    • Updated checksums for github.com/opentdf/platform/protocol/go.
    • Updated checksums for github.com/opentdf/platform/sdk.
    • Updated checksums for go.opentelemetry.io/otel and related modules.
    • Updated checksums for golang.org/x/sys.
  • pkg/handlers/registeredResources.go
    • Imported the github.com/google/uuid package.
    • Updated the CreateRegisteredResource function signature to accept a namespace parameter.
    • Modified CreateRegisteredResource to determine if the namespace is an ID or FQN and set the appropriate request field.
    • Updated the GetRegisteredResource function signature to accept a namespaceFqn parameter.
    • Modified GetRegisteredResource to include namespaceFqn in the request if provided.
    • Updated the ListRegisteredResources function signature to accept a namespace parameter.
    • Modified ListRegisteredResources to determine if the namespace is an ID or FQN and set the appropriate request field for filtering.
    • Modified the UpdateRegisteredResource function call to GetRegisteredResource to include empty namespace parameters.
Activity
  • No human activity has been recorded on this pull request yet.
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.

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

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.

1 participant