Skip to content

feat(policy): DSPX-2754 DynamicValueMapping protos + generated code#3580

Merged
alkalescent merged 4 commits into
mainfrom
DSPX-2754-protocol-dynamic-value-mapping
Jun 17, 2026
Merged

feat(policy): DSPX-2754 DynamicValueMapping protos + generated code#3580
alkalescent merged 4 commits into
mainfrom
DSPX-2754-protocol-dynamic-value-mapping

Conversation

@alkalescent

@alkalescent alkalescent commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Protocol-first half of the dynamic attribute value entitlement feature (DSPX-2754). Adds the DynamicValueMapping / DynamicValueResolver messages and DynamicValueOperatorEnum to objects.proto, plus a dedicated DynamicValueMappingService in a new policy.dynamicvaluemapping package. Includes regenerated protocol/go and OpenAPI/gRPC docs.
  • No service implementation, DB, SDK client, or PDP wiring here. Those land in the consumer PR.

Why split: the dedicated service introduces a new protocol/go package. The per-module go mod tidy CI check does not use the go workspace, so consumer modules cannot tidy against a package that is not yet in a released protocol/go. Landing and releasing protocol/go first lets the consumer PR require the new version and pass CI.

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

  • cd protocol/go && go build ./... && GOFLAGS=-mod=mod go mod tidy (clean)
  • buf lint service

Related

Summary by CodeRabbit

Release Notes

New Features

  • Added Dynamic Value Mapping service with full CRUD operations (Create, Read, Get, List, Update, Delete)
  • Dynamic Value Mappings enable runtime attribute evaluation using custom resolvers and operators
  • List operations support pagination and filtering by namespace and attribute definition
  • Update operations allow optional modification of resolvers, conditions, and permitted actions

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@alkalescent, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 31 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9045b6fe-620b-4772-bad7-ac9ea14b95ce

📥 Commits

Reviewing files that changed from the base of the PR and between 4d263ae and 0540158.

⛔ Files ignored due to path filters (3)
  • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping.pb.go is excluded by !**/*.pb.go
  • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping_grpc.pb.go is excluded by !**/*.pb.go
  • protocol/go/policy/objects.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (16)
  • docs/grpc/index.html
  • docs/openapi/policy/actions/actions.openapi.yaml
  • docs/openapi/policy/attributes/attributes.openapi.yaml
  • docs/openapi/policy/dynamicvaluemapping/dynamic_value_mapping.openapi.yaml
  • docs/openapi/policy/objects.openapi.yaml
  • docs/openapi/policy/obligations/obligations.openapi.yaml
  • docs/openapi/policy/registeredresources/registered_resources.openapi.yaml
  • docs/openapi/policy/resourcemapping/resource_mapping.openapi.yaml
  • docs/openapi/policy/subjectmapping/subject_mapping.openapi.yaml
  • docs/openapi/policy/unsafe/unsafe.openapi.yaml
  • protocol/go/internal/policy/enums.go
  • protocol/go/internal/policy/enums_test.go
  • protocol/go/policy/dynamicvaluemapping/dynamicvaluemappingconnect/dynamic_value_mapping.connect.go
  • protocol/go/policy/enums.gen.go
  • service/policy/dynamicvaluemapping/dynamic_value_mapping.proto
  • service/policy/objects.proto
📝 Walkthrough

Walkthrough

This PR adds a new dynamic value mapping feature to the policy service. It introduces domain models for runtime entitlement resolution, defines a complete CRUD API service, documents the API in OpenAPI, and provides generated Go Connect-RPC bindings for immediate usability.

Changes

Dynamic Value Mapping API

Layer / File(s) Summary
Domain Model: DynamicValueMapping and Operator Enums
service/policy/objects.proto, docs/openapi/policy/objects.openapi.yaml
Adds DynamicValueOperatorEnum with inverted comparison modes (equals and substring), DynamicValueResolver (selector path + operator), and DynamicValueMapping (links attribute definition to resolver, optional subject condition gate, permitted actions, namespace, metadata).
Protobuf Service Contract and Request/Response Types
service/policy/dynamicvaluemapping/dynamic_value_mapping.proto
Defines DynamicValueMappingService with List (read-only, single-item sort constraint, pagination), Get (read-only), Create (requires resolver and attribute definition by ID or FQN), Update (optional resolver/pre-gate/actions replacement), Delete RPCs; includes sorting enum, field validation, and idempotency markers.
OpenAPI Specification with Endpoints and Schemas
docs/openapi/policy/dynamicvaluemapping/dynamic_value_mapping.openapi.yaml
Complete OpenAPI 3.1 spec with POST endpoints for Create/Delete/Get/List/Update operations, Connect protocol headers (version + timeout), component schemas for domain models and request/response DTOs, and shared connect.error error handling.
Generated Go Connect-RPC Client and Server Bindings
protocol/go/policy/dynamicvaluemapping/dynamicvaluemappingconnect/dynamic_value_mapping.connect.go
Auto-generated service/procedure constants, DynamicValueMappingServiceClient interface with per-RPC unary clients, DynamicValueMappingServiceHandler interface with HTTP path routing, and UnimplementedDynamicValueMappingServiceHandler stub returning CodeUnimplemented for all RPCs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • pflynn-virtru

Poem

🐰 Hopping through schemas with queries so bright,
Dynamic resolvers making decisions just right,
With CRUD in one service, from proto to code,
OpenAPI docs light the developer's road!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the primary change: adding DynamicValueMapping protocol definitions and generated code for the DSPX-2754 feature.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DSPX-2754-protocol-dynamic-value-mapping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@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 implements the protocol-first phase of the dynamic attribute value entitlement feature (DSPX-2754). By introducing new protobuf messages and a dedicated service, it establishes the foundation for resolving entitlement authority dynamically at decision time, moving away from static pre-provisioning. This change is isolated to the protocol layer to facilitate modular go module management and dependency resolution for future consumer implementations.

Highlights

  • Dynamic Value Mapping Protocol: Introduced the DynamicValueMapping and DynamicValueResolver messages to enable dynamic attribute value entitlement, allowing for entitlement decisions based on entity representation at runtime.
  • New Service Definition: Added the DynamicValueMappingService with full CRUD capabilities (List, Get, Create, Update, Delete) to manage these new dynamic mappings.
  • Operator Extension: Added DynamicValueOperatorEnum to service/policy/objects.proto to support resource value comparison operations like IN and IN_CONTAINS.
New Features

🧠 You can now enable Memory (public preview) 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.

Ignored Files
  • Ignored by pattern: docs/openapi/**/* (4)
    • docs/openapi/authorization/authorization.openapi.yaml
    • docs/openapi/policy/dynamicvaluemapping/dynamic_value_mapping.openapi.yaml
    • docs/openapi/policy/objects.openapi.yaml
    • docs/openapi/policy/subjectmapping/subject_mapping.openapi.yaml
  • Ignored by pattern: protocol/**/* (5)
    • protocol/go/go.mod
    • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping.pb.go
    • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping_grpc.pb.go
    • protocol/go/policy/dynamicvaluemapping/dynamicvaluemappingconnect/dynamic_value_mapping.connect.go
    • protocol/go/policy/objects.pb.go
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 the 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 counterproductive. 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.


The values shift and flow in time, Dynamic logic, reason's climb. With proto structures clearly set, The policy engine's not done yet.

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 github-actions Bot added comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) docs Documentation size/m labels Jun 5, 2026

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

Copy link
Copy Markdown
Contributor

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 new DynamicValueMappingService along with its CRUD operations and associated protobuf definitions, such as DynamicValueResolver and DynamicValueOperatorEnum, to support dynamic, definition-level value entitlement. The review feedback highlights several opportunities to improve validation in CreateDynamicValueMappingRequest, including ensuring consistent FQN validation, enforcing mutual exclusivity between namespace fields, and simplifying CEL expressions by leveraging standard validation rules.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread service/policy/dynamicvaluemapping/dynamic_value_mapping.proto
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 336.832358ms
Throughput 296.88 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 33.216360399s
Average Latency 330.581872ms
Throughput 150.53 requests/second

alkalescent added a commit that referenced this pull request Jun 5, 2026
Mirror the proto validation fix from #3580 (namespace oneof, min_len:1 + uri on FQN
fields, direct uuid/uri rules) so the consumer branch stays in sync.

Refs: DSPX-2754, DSPX-3498
Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 459.437717ms
Throughput 217.66 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 46.966216532s
Average Latency 467.832798ms
Throughput 106.46 requests/second

@alkalescent alkalescent marked this pull request as ready for review June 5, 2026 21:56
@alkalescent alkalescent requested review from a team as code owners June 5, 2026 21:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@service/policy/dynamicvaluemapping/dynamic_value_mapping.proto`:
- Around line 41-42: The comment on the field namespace_id is
incorrect/misleading; update the comment for the field namespace_id (in the
dynamic value mapping proto) to remove the reference to Attribute Definition ID
and clearly state it is the Namespace ID to filter by (e.g., "Namespace ID to
filter by"), leaving the separate attribute_definition_id field’s own comment
unchanged so generated docs no longer conflate the two.
- Around line 72-75: The schema currently enforces exclusivity via
buf.validate.message.oneof (validation-only) for the fields namespace_id and
namespace_fqn, which doesn't get reflected in generated OpenAPI; change the
proto to make these mutually exclusive at the protobuf level by moving
namespace_id and namespace_fqn into a real oneof (e.g., oneof namespace_selector
{ string namespace_id = X; string namespace_fqn = Y; }) so the generated OpenAPI
includes the exclusivity, and apply the same change for the other occurrence
mentioned (lines ~107-114) where the buf.validate.message.oneof is used; keep
the field names namespace_id and namespace_fqn and ensure tags/types remain
consistent when creating the oneof.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 231eabb5-f6b3-45c3-8567-e28d9b8703af

📥 Commits

Reviewing files that changed from the base of the PR and between 626ce47 and e0f9220.

⛔ Files ignored due to path filters (3)
  • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping.pb.go is excluded by !**/*.pb.go
  • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping_grpc.pb.go is excluded by !**/*.pb.go
  • protocol/go/policy/objects.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (9)
  • docs/grpc/index.html
  • docs/openapi/authorization/authorization.openapi.yaml
  • docs/openapi/policy/dynamicvaluemapping/dynamic_value_mapping.openapi.yaml
  • docs/openapi/policy/objects.openapi.yaml
  • docs/openapi/policy/subjectmapping/subject_mapping.openapi.yaml
  • protocol/go/go.mod
  • protocol/go/policy/dynamicvaluemapping/dynamicvaluemappingconnect/dynamic_value_mapping.connect.go
  • service/policy/dynamicvaluemapping/dynamic_value_mapping.proto
  • service/policy/objects.proto

Comment thread service/policy/dynamicvaluemapping/dynamic_value_mapping.proto Outdated
Comment thread service/policy/dynamicvaluemapping/dynamic_value_mapping.proto
alkalescent added a commit that referenced this pull request Jun 8, 2026
Mirror the doc-comment fix from #3580 to keep the consumer branch in sync.

Refs: DSPX-2754, DSPX-3498
Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 408.369337ms
Throughput 244.88 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 46.649135744s
Average Latency 465.521121ms
Throughput 107.18 requests/second

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
service/policy/dynamicvaluemapping/dynamic_value_mapping.proto (2)

98-105: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reject requests that set both subject-condition-set inputs.

Right now the contract says new_subject_condition_set is ignored when existing_subject_condition_set_id is also present. That makes create requests lossy for an authorization object: a caller can send a brand-new gate and still create a mapping bound to some preexisting subject condition set. This should be a validation failure, not silent precedence.

Suggested fix
 message CreateDynamicValueMappingRequest {
@@
+  option (buf.validate.message).oneof = {
+    fields: ["existing_subject_condition_set_id", "new_subject_condition_set"]
+    required: false
+  };
+
   // Optional static pre-gate. Reuse an existing SubjectConditionSet (prioritized) ...
   string existing_subject_condition_set_id = 5 [(buf.validate.field).cel = {
@@
-  // ... or create a new one (ignored if existing_subject_condition_set_id is provided)
+  // ... or create a new one
   policy.subjectmapping.SubjectConditionSetCreate new_subject_condition_set = 6;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@service/policy/dynamicvaluemapping/dynamic_value_mapping.proto` around lines
98 - 105, The proto currently allows both existing_subject_condition_set_id and
new_subject_condition_set to be supplied but treats new_subject_condition_set as
ignored; change the contract to reject requests that set both by making them
mutually exclusive: either wrap existing_subject_condition_set_id and
new_subject_condition_set in a oneof, or add a CEL validation on the message
level that enforces exactly-one (e.g., size(existing_subject_condition_set_id)
== 0 && exists(new_subject_condition_set) ||
size(existing_subject_condition_set_id) > 0 &&
!exists(new_subject_condition_set) ) so that attempts to provide both
existing_subject_condition_set_id and new_subject_condition_set fail validation.
Ensure you update any relevant comments and tests that expect the previous
precedence behavior.

20-22: ⚠️ Potential issue | 🟠 Major

Mark DynamicValueMapping CRUD mandatory inputs as buf.validate.field.required (OpenAPI contract drift)

value_resolver is the only input rendered as required in dynamic_value_mapping.openapi.yaml; Get/Update/Delete.id and Create.actions are missing from the OpenAPI required list even though the validators enforce them (UUID validator and repeated.min_items). Add (buf.validate.field).required = true so OpenAPI-based clients can’t generate requests that will be rejected server-side.

Suggested fix
 message GetDynamicValueMappingRequest {
   // Required
-  string id = 1 [(buf.validate.field).string.uuid = true];
+  string id = 1 [
+    (buf.validate.field).required = true,
+    (buf.validate.field).string.uuid = true
+  ];
 }
@@
   // Required: actions permitted on a matched value
   repeated policy.Action actions = 4 [
+    (buf.validate.field).required = true,
     (buf.validate.field).repeated.min_items = 1,
     (buf.validate.field).cel = {
       id: "action_name_or_id_not_empty"
@@
 message UpdateDynamicValueMappingRequest {
   // Required
-  string id = 1 [(buf.validate.field).string.uuid = true];
+  string id = 1 [
+    (buf.validate.field).required = true,
+    (buf.validate.field).string.uuid = true
+  ];
 }
@@
 message DeleteDynamicValueMappingRequest {
   // Required
-  string id = 1 [(buf.validate.field).string.uuid = true];
+  string id = 1 [
+    (buf.validate.field).required = true,
+    (buf.validate.field).string.uuid = true
+  ];
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@service/policy/dynamicvaluemapping/dynamic_value_mapping.proto` around lines
20 - 22, Add explicit required validators to the ID and actions fields so the
OpenAPI output marks them required: update GetDynamicValueMappingRequest.id,
UpdateDynamicValueMappingRequest.id, and DeleteDynamicValueMappingRequest.id to
include (buf.validate.field).required = true (in addition to the existing UUID
validator), and add (buf.validate.field).required = true to
CreateDynamicValueMappingRequest.actions (alongside the repeated.min_items
validator) so OpenAPI clients cannot omit these mandatory inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@service/policy/dynamicvaluemapping/dynamic_value_mapping.proto`:
- Around line 98-105: The proto currently allows both
existing_subject_condition_set_id and new_subject_condition_set to be supplied
but treats new_subject_condition_set as ignored; change the contract to reject
requests that set both by making them mutually exclusive: either wrap
existing_subject_condition_set_id and new_subject_condition_set in a oneof, or
add a CEL validation on the message level that enforces exactly-one (e.g.,
size(existing_subject_condition_set_id) == 0 &&
exists(new_subject_condition_set) || size(existing_subject_condition_set_id) > 0
&& !exists(new_subject_condition_set) ) so that attempts to provide both
existing_subject_condition_set_id and new_subject_condition_set fail validation.
Ensure you update any relevant comments and tests that expect the previous
precedence behavior.
- Around line 20-22: Add explicit required validators to the ID and actions
fields so the OpenAPI output marks them required: update
GetDynamicValueMappingRequest.id, UpdateDynamicValueMappingRequest.id, and
DeleteDynamicValueMappingRequest.id to include (buf.validate.field).required =
true (in addition to the existing UUID validator), and add
(buf.validate.field).required = true to CreateDynamicValueMappingRequest.actions
(alongside the repeated.min_items validator) so OpenAPI clients cannot omit
these mandatory inputs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3651a194-9f2e-41b3-9952-4c2eb8cc05eb

📥 Commits

Reviewing files that changed from the base of the PR and between e0f9220 and 9c89759.

⛔ Files ignored due to path filters (1)
  • protocol/go/policy/dynamicvaluemapping/dynamic_value_mapping.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (3)
  • docs/grpc/index.html
  • docs/openapi/policy/dynamicvaluemapping/dynamic_value_mapping.openapi.yaml
  • service/policy/dynamicvaluemapping/dynamic_value_mapping.proto

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 404.43005ms
Throughput 247.26 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.224287407s
Average Latency 440.367261ms
Throughput 113.06 requests/second

@alkalescent alkalescent force-pushed the DSPX-2754-protocol-dynamic-value-mapping branch from b90b728 to 982045a Compare June 9, 2026 20:30
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 416.647134ms
Throughput 240.01 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.582861965s
Average Latency 434.816147ms
Throughput 114.72 requests/second

@alkalescent alkalescent force-pushed the DSPX-2754-protocol-dynamic-value-mapping branch from 982045a to 6a89798 Compare June 10, 2026 16:10
@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 423.858728ms
Throughput 235.93 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.507374693s
Average Latency 443.986095ms
Throughput 112.34 requests/second

jakedoublev
jakedoublev previously approved these changes Jun 12, 2026
Comment thread service/policy/objects.proto Outdated
Comment thread service/policy/objects.proto
Protocol-first half of the dynamic attribute value entitlement work: adds the
DynamicValueMapping / DynamicValueResolver messages and DynamicValueOperatorEnum to
objects.proto, and a dedicated DynamicValueMappingService
(policy.dynamicvaluemapping), plus regenerated protocol/go and OpenAPI/gRPC docs.

No service implementation here. This lands and releases protocol/go first so the
consumer PR (#3568) can require the new version and pass per-module 'go mod tidy'.

Refs: DSPX-2754, DSPX-3498
Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
Adds the DynamicValueMapping / DynamicValueResolver messages and
DynamicValueOperatorEnum to objects.proto, and a dedicated
DynamicValueMappingService (policy.dynamicvaluemapping), with regenerated
protocol/go and OpenAPI/gRPC docs. Protocol-first half of DSPX-2754; the consumer
implementation (service/sdk/db/PDP) is PR #3568.

Includes review fixes: namespace oneof + min_len:1/uri + direct validation rules on
CreateDynamicValueMappingRequest; per-field List filter comments; and a
namespace_fqn filter (namespace_id|namespace_fqn oneof) on ListDynamicValueMappingsRequest.

Refs: DSPX-2754, DSPX-3498
Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
Split the all-in-one SubjectMappingOperatorEnum into independent axes:
ConditionComparisonOperatorEnum (EQUALS/CONTAINS/STARTS_WITH/ENDS_WITH) and
ConditionQuantifierEnum (ANY/ALL/NONE), plus a case_insensitive flag on
Condition. The legacy operator field is deprecated and retained so the service
layer can normalize old payloads for backward compatibility.

Apply the same comparison model to DynamicValueResolver (comparison +
case_insensitive) and drop the unreleased DynamicValueOperatorEnum. The dynamic
match is inherently existential over the selector-resolved entity values, so it
carries no quantifier. This also removes the confusing "inversion" wording
raised in review.

Proto plus regenerated code and docs only. Normalization, evaluation, and
cross-field validation land in the service PR #3568.

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@alkalescent alkalescent force-pushed the DSPX-2754-protocol-dynamic-value-mapping branch from 4d263ae to f35eb6e Compare June 15, 2026 17:10
@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 422.282173ms
Throughput 236.81 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.784460301s
Average Latency 416.136943ms
Throughput 119.66 requests/second

Comment thread service/policy/objects.proto Outdated
Comment thread service/policy/objects.proto Outdated
Comment thread service/policy/objects.proto
Model Condition.case_insensitive and DynamicValueResolver.case_insensitive as
google.protobuf.BoolValue instead of bool, per review, so an explicit false is
distinguishable from unset. This leaves room to change the default later without
ambiguity. Regenerated protocol/go and docs.

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

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 415.002695ms
Throughput 240.96 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.577515146s
Average Latency 414.416ms
Throughput 120.26 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

alkalescent added a commit that referenced this pull request Jun 16, 2026
…appings

Bring the consumer in line with the #3335 operator decomposition and the
BoolValue case_insensitive change from the protocol PR (#3580):

- Evaluation: add a shared compareEntityValue helper (EQUALS/CONTAINS/
  STARTS_WITH/ENDS_WITH) used by both the static Condition path and the dynamic
  resolver. EvaluateCondition normalizes the deprecated operator into
  comparison + quantifier when unset, preserving existing conditions, and
  applies ANY/ALL/NONE. The dynamic resolver matches existentially over the
  entity values and honors case_insensitive (nil = case-sensitive).
- Validation: check resolver.comparison instead of the removed operator.
- DB: replace the operator column with comparison + case_insensitive in the
  (unreleased) migration, queries, and sqlc/Go layer.
- Tests: update fixtures to comparison; set case_insensitive on the
  case-mismatch case. Static condition tests keep using the deprecated operator
  to exercise normalization.

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
@alkalescent alkalescent added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 090c0f6 Jun 17, 2026
39 of 40 checks passed
@alkalescent alkalescent deleted the DSPX-2754-protocol-dynamic-value-mapping branch June 17, 2026 17:28
alkalescent added a commit that referenced this pull request Jun 17, 2026
Add the sdkconnect wrapper for the DynamicValueMappingService and register it
in the SDK, and bump protocol/go to v0.34.0 (which carries the dynamicvaluemapping
package). This is the sdk step of the DSPX-2754 consumer split (protocol/go #3580
released first; service consumer PR #3568 depends on this sdk release).

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
alkalescent added a commit that referenced this pull request Jun 18, 2026
Service consumer for dynamic value mappings, built on protocol/go v0.34.0 and
sdk v0.23.0:

- DB: dynamic_value_mappings table + queries + CRUD, no-coexistence guard with
  value-level subject mappings, comparison + case_insensitive columns.
- Service: DynamicValueMappingService, validators, and PDP wiring that loads
  dynamic mappings via the SDK and evaluates them alongside subject mappings.
- Evaluation: shared comparison helper (EQUALS/CONTAINS/STARTS_WITH/ENDS_WITH)
  used by both static conditions (with quantifier + deprecated-operator
  normalization) and the dynamic resolver (existential, case_insensitive).

protocol/go protos, the dynamicvaluemapping package, and the sdk wrapper landed
in #3580 and #3635; this PR bumps to those releases.

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
alkalescent added a commit that referenced this pull request Jun 22, 2026
Service consumer for dynamic value mappings, built on protocol/go v0.34.0 and
sdk v0.23.0:

- DB: dynamic_value_mappings table + queries + CRUD, no-coexistence guard with
  value-level subject mappings, comparison + case_insensitive columns.
- Service: DynamicValueMappingService, validators, and PDP wiring that loads
  dynamic mappings via the SDK and evaluates them alongside subject mappings.
- Evaluation: shared comparison helper (EQUALS/CONTAINS/STARTS_WITH/ENDS_WITH)
  used by both static conditions (with quantifier + deprecated-operator
  normalization) and the dynamic resolver (existential, case_insensitive).

protocol/go protos, the dynamicvaluemapping package, and the sdk wrapper landed
in #3580 and #3635; this PR bumps to those releases.

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
alkalescent added a commit that referenced this pull request Jun 23, 2026
Service consumer for dynamic value mappings, built on protocol/go v0.34.0 and
sdk v0.23.0:

- DB: dynamic_value_mappings table + queries + CRUD, no-coexistence guard with
  value-level subject mappings, comparison + case_insensitive columns.
- Service: DynamicValueMappingService, validators, and PDP wiring that loads
  dynamic mappings via the SDK and evaluates them alongside subject mappings.
- Evaluation: shared comparison helper (EQUALS/CONTAINS/STARTS_WITH/ENDS_WITH)
  used by both static conditions (with quantifier + deprecated-operator
  normalization) and the dynamic resolver (existential, case_insensitive).

protocol/go protos, the dynamicvaluemapping package, and the sdk wrapper landed
in #3580 and #3635; this PR bumps to those releases.

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) docs Documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants