Skip to content

chore(ers): add array-valued claims BDD coverage - #3839

Open
khvirtru wants to merge 1 commit into
opentdf:mainfrom
khvirtru:test/claims-array-ers-coverage
Open

chore(ers): add array-valued claims BDD coverage#3839
khvirtru wants to merge 1 commit into
opentdf:mainfrom
khvirtru:test/claims-array-ers-coverage

Conversation

@khvirtru

@khvirtru khvirtru commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds BDD coverage for array-valued claims flowing through multi-strategy ERS
  • Tests that JSON arrays (e.g., groups: ["engineering", "devops"]) survive the full pipeline: claims provider → output mapping → flattening → subject mapping evaluation → authorization decision
  • Uses .groups[] wildcard selector in subject condition sets — the flattening library produces indexed/wildcard keys, not a plain .groups key for arrays

Scenarios

# Scenario Claims Expected
1 Matching array element groups: ["engineering", "devops"] PERMIT
2 No matching element groups: ["marketing", "sales"] DENY
3 anyOf with multiple values groups: ["security", "devops"] matches security PERMIT

Test plan

  • Cucumber BDD Tests CI job passes
  • All 3 scenarios pass with claims-only ERS (no LDAP)
  • No regressions in existing BDD scenarios

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage for array-valued claims in multi-strategy authorization scenarios.
    • Verified wildcard subject selectors, including matching and nonmatching arrays.
    • Added validation for rules that permit access when any array value matches.

Test that array claims (e.g., groups: ["engineering", "devops"]) survive
the full multi-strategy ERS pipeline through to authorization decisions.
Uses .groups[] wildcard selector for subject condition sets since the
flattening library produces indexed/wildcard keys, not plain array keys.

Three scenarios: matching element PERMIT, no match DENY, anyOf with
multiple attribute values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ken Ho <kho@virtru.com>
@khvirtru
khvirtru requested a review from a team as a code owner August 5, 2026 19:00
@github-actions github-actions Bot added the size/s label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 791462c2-5e3c-458d-9e0c-b7661c71d08e

📥 Commits

Reviewing files that changed from the base of the PR and between 4a98105 and 446ae8b.

📒 Files selected for processing (1)
  • tests-bdd/features/claims-array-ers.feature

📝 Walkthrough

Walkthrough

The PR adds BDD coverage for array-valued groups claims in multi-strategy ERS. The scenarios test .groups[] wildcard mapping, matching and nonmatching arrays, and anyOf evaluation.

Changes

Array-valued claims ERS coverage

Layer / File(s) Summary
Claims mapping and decision scenarios
tests-bdd/features/claims-array-ers.feature
Adds shared ERS setup and scenarios for PERMIT on matching arrays, DENY on nonmatching arrays, and PERMIT when anyOf matches one array value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: elizabethhealy

Poem

A rabbit maps groups in a row,
Through wildcard paths the values flow.
Engineering grants the right,
Missing groups deny the flight,
Security makes anyOf glow.

🚥 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 title clearly summarizes the main change: adding BDD coverage for array-valued claims in ERS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant