Skip to content

fix(sdk): deduplicate attributes in TDF manifest policy #2184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakedoublev
Copy link
Contributor

Resolves #1978

@jakedoublev jakedoublev marked this pull request as ready for review May 6, 2025 23:36
@jakedoublev jakedoublev requested review from a team as code owners May 6, 2025 23:36
@jakedoublev jakedoublev requested a review from Copilot May 6, 2025 23:36
Copy link
Contributor

@Copilot 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

This PR fixes an issue with duplicated attributes in the TDF manifest policy by implementing deduplication logic in the policy object creation. The key changes include:

  • Adding a new test (TestCreatePolicyObjectDeduplication) to verify attribute deduplication.
  • Introducing a deduplication mechanism in createPolicyObject using a map to filter out duplicate attributes.
  • Adjusting the initialization of the Dissem field to occur once outside the loop.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
sdk/tdf_test.go Added a test to confirm that duplicate attributes are properly deduplicated.
sdk/tdf.go Updated createPolicyObject to filter duplicate attributes and moved Dissem initialization.

Copy link
Contributor

github-actions bot commented May 6, 2025

Benchmark results, click to expand

Benchmark Results:

Metric Value
Approved Decision Requests 5000
Denied Decision Requests 0
Total Time 443.537807ms

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 362.218984ms
Throughput 276.08 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 1m16.949067328s
Average Latency 767.492839ms
Throughput 64.98 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 4945
Failed Requests 55
Concurrent Requests 50
Total Time 1m7.587635371s
Average Latency 672.116617ms
Throughput 73.16 requests/second

Error Summary:

Error Message Occurrences
ReadNanoTDF error: getNanoRewrapKey: rewrapError: internal: internal error
rpc error: code = Internal desc = could not perform access
55 occurrences

Standard Benchmark Metrics Skipped or Failed

Copy link
Contributor

github-actions bot commented May 6, 2025

Benchmark results, click to expand

Benchmark Results:

Metric Value
Approved Decision Requests 5000
Denied Decision Requests 0
Total Time 441.139634ms

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 386.117556ms
Throughput 258.99 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 1m17.101661627s
Average Latency 768.577588ms
Throughput 64.85 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 4943
Failed Requests 57
Concurrent Requests 50
Total Time 1m8.08893261s
Average Latency 676.343493ms
Throughput 72.60 requests/second

Error Summary:

Error Message Occurrences
ReadNanoTDF error: getNanoRewrapKey: rewrapError: internal: internal error
rpc error: code = Internal desc = could not perform access
57 occurrences

Standard Benchmark Metrics Skipped or Failed

Copy link
Contributor

github-actions bot commented May 7, 2025

Benchmark results, click to expand

Benchmark Results:

Metric Value
Approved Decision Requests 5000
Denied Decision Requests 0
Total Time 482.012475ms

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 394.749239ms
Throughput 253.33 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 1m20.387627079s
Average Latency 800.669919ms
Throughput 62.20 requests/second

NANOTDF Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 4942
Failed Requests 58
Concurrent Requests 50
Total Time 1m9.201455294s
Average Latency 687.531634ms
Throughput 71.41 requests/second

Error Summary:

Error Message Occurrences
ReadNanoTDF error: getNanoRewrapKey: rewrapError: internal: internal error
rpc error: code = Internal desc = could not perform access
58 occurrences

Standard Benchmark Metrics Skipped or Failed

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.

SDK should deduplicate attribute FQNs stored in TDF Manifest Policy
1 participant