Skip to content

feat(policy)!: add namespace field to RegisteredResource proto#3110

Merged
alkalescent merged 3 commits intomainfrom
DSPX-2496-namespace-rr-proto
Mar 5, 2026
Merged

feat(policy)!: add namespace field to RegisteredResource proto#3110
alkalescent merged 3 commits intomainfrom
DSPX-2496-namespace-rr-proto

Conversation

@alkalescent
Copy link
Copy Markdown
Contributor

Summary

  • Adds namespace field to RegisteredResource and RegisteredResourceValue proto messages
  • Updates ListRegisteredResourcesRequest with namespace filter field
  • Generated Go protobuf code updated accordingly

This is part 1 of splitting #3106 into two PRs. Part 2 (service/lib changes) depends on this being merged first.

Test plan

  • Proto files compile correctly
  • Generated Go code matches proto definitions
  • No breaking changes to existing proto consumers

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@alkalescent alkalescent requested review from a team as code owners March 4, 2026 19:44
@github-actions github-actions Bot added the comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) label Mar 4, 2026
@gemini-code-assist
Copy link
Copy Markdown
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 introduces foundational namespace support for policy-related registered resources. It modifies core protobuf definitions to include namespace fields, allowing resources to be scoped and filtered by namespace. This change is a prerequisite for broader namespace-aware functionality, laying the groundwork for more granular policy management.

Highlights

  • Namespace Support for Registered Resources: Introduced a "namespace" field to the "RegisteredResource" proto message, enabling resources to be associated with specific namespaces.
  • Namespace Filtering for Resource Creation: Added "namespace_id" and "namespace_fqn" fields to "CreateRegisteredResourceRequest", allowing resource creation within a specified namespace with "oneof" validation.
  • Namespace Context for Resource Retrieval: Included an optional "namespace_fqn" field in "GetRegisteredResourceRequest" to provide namespace context for name-based lookups of registered resources.
  • Namespace Filtering for Resource Listing: Updated "ListRegisteredResourcesRequest" to include optional "namespace_id" and "namespace_fqn" fields, enabling filtering of registered resources by namespace.

🧠 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
  • service/policy/objects.proto
    • Added "Namespace namespace = 4;" to the "RegisteredResource" message.
  • service/policy/registeredresources/registered_resources.proto
    • Added "namespace_id" and "namespace_fqn" fields to "CreateRegisteredResourceRequest" with "oneof" validation.
    • Updated comments for the "values" field in "CreateRegisteredResourceRequest".
    • Added an optional "namespace_fqn" field to "GetRegisteredResourceRequest" for name-based lookups.
    • Introduced optional "namespace_id" and "namespace_fqn" fields to "ListRegisteredResourcesRequest" for filtering.
Ignored Files
  • Ignored by pattern: protocol/**/* (2)
    • protocol/go/policy/objects.pb.go
    • protocol/go/policy/registeredresources/registered_resources.pb.go
Activity
  • No specific review comments or activity have been recorded on this pull request yet, beyond its initial creation.
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.


Proto fields expand, Namespace now holds the new key, Policies align.

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
Copy Markdown
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 introduces a namespace field to the RegisteredResource protobuf message and updates related request messages to support namespacing, which is a good step towards multi-tenancy for registered resources.

I have one suggestion regarding protobuf field numbering in CreateRegisteredResourceRequest for better maintainability.

Additionally, the pull request summary mentions adding a namespace field to RegisteredResourceValue, but this change is not present in the current patch. This might be intentional and planned for a future PR, but it's worth clarifying if RegisteredResourceValue should have its own namespace field for cases where it's retrieved without its parent RegisteredResource object being fully populated.

Comment thread service/policy/registeredresources/registered_resources.proto Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 197.760557ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 99.370288ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 383.834933ms
Throughput 260.53 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.944082693s
Average Latency 427.726092ms
Throughput 116.43 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 189.765099ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 95.343036ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 364.240046ms
Throughput 274.54 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.277088469s
Average Latency 391.321708ms
Throughput 127.30 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 186.828543ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 93.202558ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 382.374672ms
Throughput 261.52 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.338899353s
Average Latency 391.169425ms
Throughput 127.10 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

@alkalescent alkalescent added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 04fd85d Mar 5, 2026
64 of 66 checks passed
@alkalescent alkalescent deleted the DSPX-2496-namespace-rr-proto branch March 5, 2026 21:41
github-merge-queue Bot pushed a commit that referenced this pull request Mar 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.17.0](protocol/go/v0.16.0...protocol/go/v0.17.0)
(2026-03-05)


### ⚠ BREAKING CHANGES

* **policy:** add namespace field to RegisteredResource proto
([#3110](#3110))

### Features

* **policy:** add namespace field to RegisteredResource proto
([#3110](#3110))
([04fd85d](04fd85d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 11, 2026
## Summary
- Adds namespace support to Registered Resources in service layer, DB
queries, and migrations
- Updates identifier library for registered resource value namespace
handling
- Adds integration and unit tests for namespace-scoped registered
resources

**Depends on #3110** (proto changes) being merged first.

This is part 2 of splitting #3106 into two PRs.

## Test plan
- [x] Integration tests pass for registered resources with namespace
- [x] Unit tests pass for identifier library changes
- [x] Migration applies cleanly
- [x] Existing registered resource functionality unaffected

---------

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants