Skip to content

fix(ers): preserve resolved token-chain context - #3808

Open
jrschumacher wants to merge 1 commit into
fix/3790-resolve-entities-jwt-claims-contextfrom
fix/3801-chain-no-rehydrate
Open

fix(ers): preserve resolved token-chain context#3808
jrschumacher wants to merge 1 commit into
fix/3790-resolve-entities-jwt-claims-contextfrom
fix/3801-chain-no-rehydrate

Conversation

@jrschumacher

Copy link
Copy Markdown
Member

Summary

  • preserve final mapped multi-strategy token-chain payloads in v2 entity chains instead of projecting to lossy typed identities
  • consume only marked pre-resolved token-chain claims directly in authz, while keeping explicit entity-chain resolution on the normal ERS ResolveEntities path
  • add access-layer regression tests, multi-strategy integration coverage, and token-based BDD coverage for the no-rehydrate flow

Testing

  • cd service && golangci-lint run ./entityresolution/multi-strategy/... ./internal/access/v2 ./entityresolution/integration
  • cd service && go test ./entityresolution/multi-strategy/... ./internal/access/v2 ./entityresolution/integration -run "Test(ResolveEntities_ClaimsProviderUsesInlineClaimsContext|ResolveEntities_UserNameEntityDoesNotSeedClaimsContext|EntityRepresentationFromClaimsEntity_RequiresPreResolvedPrefix|ResolveEntitiesFromEntityChain_UsesPreResolvedClaimsEntitiesDirectly|MultiStrategy_ClaimsOnly|MultiStrategy_SQLOnly|MultiStrategyEntityResolutionV2|Integration_CreateEntityChainsFromTokens_PreservesLDAPAttributesInChain|Integration_ResolveEntities_ReturnsPopulatedRepresentation|Integration_TokenChainPreservesResolvedClaims|Integration_FailureIsolation_MixedBatch)" -count=1
  • go test ./tests-bdd/cukes -run "TestConvertInterfaceToAny_PlainClaimsJSON" -count=1

Notes

  • Full local Godog execution is currently blocked in this environment by existing local platform startup/port issues unrelated to these code changes.

Fixes #3801

@jrschumacher
jrschumacher requested a review from a team as a code owner July 31, 2026 07:52
@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 166.463788ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 372.844193ms
Throughput 268.21 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.230601093s
Average Latency 450.656692ms
Throughput 110.54 requests/second

@jrschumacher
jrschumacher force-pushed the fix/3801-chain-no-rehydrate branch from 77907ff to 9febb1d Compare July 31, 2026 08:02
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1cece44f-b7a0-4a2e-94ed-3f42e316f25b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@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 207.422309ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 0
Failed Decrypts 100
Total Time 273.290013ms
Throughput 0.00 requests/second

Error Summary

Error Message Occurrences
splitKey.unable to reconstruct split key: map[{https://localhost:8080 }:tdf: rewrap request 403
kao unwrap failed for split {https://localhost:8080 }: permission_denied: request error
rpc error: code = PermissionDenied desc = forbidden: pdp-denied]
tdf: rewrap request 403
kao unwrap failed for split {https://localhost:8080 }: permission_denied: request error
rpc error: code = PermissionDenied desc = forbidden: pdp-denied 100 occurrences

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 0
Failed Requests 5000
Concurrent Requests 50
Total Time 40.88377479s
Throughput 0.00 requests/second

Error Summary:

Error Message Occurrences
read error: reader.WriteTo failed: splitKey.unable to reconstruct split key: map[{https://localhost:8080 }:tdf: rewrap request 403
kao unwrap failed for split {https://localhost:8080 }: permission_denied: request error
rpc error: code = PermissionDenied desc = forbidden: pdp-denied]
tdf: rewrap request 403
kao unwrap failed for split {https://localhost:8080 }: permission_denied: request error
rpc error: code = PermissionDenied desc = forbidden: pdp-denied
5000 occurrences

@jrschumacher jrschumacher changed the title fix(entityresolution): preserve resolved token-chain context fix(ers): preserve resolved token-chain context Jul 31, 2026
Signed-off-by: Ryan Schumacher <jschumacher@virtru.com>
@jrschumacher
jrschumacher force-pushed the fix/3801-chain-no-rehydrate branch from 9febb1d to afd0ac4 Compare July 31, 2026 08:16
@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 210.349164ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 437.175012ms
Throughput 228.74 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 54.826904906s
Average Latency 546.346572ms
Throughput 91.20 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ers): preserve multi-strategy routing context across v2 entity-chain resolution

1 participant