Skip to content

Conversation

c-r33d
Copy link
Contributor

@c-r33d c-r33d commented Oct 6, 2025

Proposed Changes

1.) Add logic to retrieve obligations from request header during rewrap
2.) Add logic to populate required obligations on kas response object

Smoke tests tried manually (no key split or bulk rewrap):

  • Obligations are not fulfilled, rewrap fails
  • Obligations are fulfilled, rewrap succeeds

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

@github-actions github-actions bot added comp:kas Key Access Server size/m labels Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 365.250236ms
Throughput 273.78 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 38.785283836s
Average Latency 384.503537ms
Throughput 128.91 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.244073845s
Average Latency 271.528112ms
Throughput 183.53 requests/second

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 357.622976ms
Throughput 279.62 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.515349573s
Average Latency 402.985934ms
Throughput 123.41 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 28.344221788s
Average Latency 282.570642ms
Throughput 176.40 requests/second

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 370.646319ms
Throughput 269.80 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 37.980750434s
Average Latency 378.148449ms
Throughput 131.65 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 26.657790586s
Average Latency 265.825274ms
Throughput 187.56 requests/second

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 387.653252ms
Throughput 257.96 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.418006204s
Average Latency 391.851992ms
Throughput 126.85 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.346660492s
Average Latency 272.714909ms
Throughput 182.84 requests/second

@c-r33d c-r33d marked this pull request as ready for review October 6, 2025 17:05
@c-r33d c-r33d requested review from a team as code owners October 6, 2025 17:05
@c-r33d
Copy link
Contributor Author

c-r33d commented Oct 6, 2025

/gemini review

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 introduces support for obligations in KAS. The changes include retrieving fulfillable obligations from a new request header, passing them to the authorization service during access checks, and populating the required obligations from the PDP decision into the KAS response metadata. The implementation looks solid, with new logic to handle obligation context and good test coverage for the new functionality. I've identified a critical issue that could lead to a panic and a minor suggestion for performance improvement.

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 378.927252ms
Throughput 263.90 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.6247369s
Average Latency 394.048145ms
Throughput 126.18 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 28.295746544s
Average Latency 282.137175ms
Throughput 176.71 requests/second

elizabethhealy
elizabethhealy previously approved these changes Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 364.84995ms
Throughput 274.09 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 40.931593746s
Average Latency 407.413979ms
Throughput 122.16 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 28.237829476s
Average Latency 281.387082ms
Throughput 177.07 requests/second

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 361.85397ms
Throughput 276.35 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.152285166s
Average Latency 389.378767ms
Throughput 127.71 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.295414449s
Average Latency 272.069186ms
Throughput 183.18 requests/second

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 366.589544ms
Throughput 272.78 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 38.794781927s
Average Latency 386.396654ms
Throughput 128.88 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.293840597s
Average Latency 271.839017ms
Throughput 183.19 requests/second

@c-r33d
Copy link
Contributor Author

c-r33d commented Oct 7, 2025

/gemini review

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 introduces support for policy obligations in KAS. It adds logic to parse fulfillable obligations from the X-Rewrap-Additional-Context request header and includes required obligations in the X-Required-Obligations metadata of the rewrap response. The changes are well-structured, and the new helper functions getAdditionalRewrapContext and populateRequiredObligationsOnResponse are accompanied by thorough unit tests.

However, I've identified a critical bug in the nanoTDFRewrap function due to a copy-paste error, which could lead to incorrect behavior. Additionally, the core logic changes within the tdf3Rewrap and nanoTDFRewrap functions, which integrate this new obligation handling, are not covered by unit tests. It's crucial to add tests for these changes to ensure the feature works as expected and prevent future regressions. I've also left a suggestion to simplify some of the new logic for improved readability.

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

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

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Standard Benchmark Metrics Skipped or Failed

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 369.70429ms
Throughput 270.49 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.102122451s
Average Latency 389.234003ms
Throughput 127.87 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.74229042s
Average Latency 276.26596ms
Throughput 180.23 requests/second

@c-r33d c-r33d enabled auto-merge October 7, 2025 14:37
@c-r33d c-r33d added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit bb1bca0 Oct 7, 2025
68 of 72 checks passed
@c-r33d c-r33d deleted the feat/DSPX-1356-kas-obligations branch October 7, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:kas Key Access Server size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants