Repository navigation
feat(chart): accept issuer settings - #341
Conversation
The security check of the chart refused every trusted issuer that is not a URL. Accept maps of FOCA's IssuerConfig (issuer, namespace, audience, claim_groups, userinfo_claims) whose issuer is a non-blank string without surrounding whitespace, as Cloud Registry's chart does: - an issuer's claim_groups replaces the global one for its tokens (unless unset or null), so group mappings need a group claim of at least one issuer, as in FOCA; - a global audience is required only unless each issuer has a list of non-blank audiences of its own (requireAudience, computed). This lets chart users keep the subjects of the issuer trusted so far bare (namespace: ""), as the upgrade notes recommend. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes: refuse issuer maps with unknown keys, or with an audience or group claim that FOCA refuses, and a global audience that is no list of strings (the library checks it only if required). Name the group claims of issuers in the group-claim error, simplify requireAudience, test it directly, and mention issuer audiences in the access control docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check the keys of issuer maps before their issuer, so that a misspelt `issuer` key is named, and describe the audience checks in the header of protes.checkSecurity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe chart now supports FOCA-compatible trusted issuer maps alongside URLs, validates issuer-specific and global security settings during Helm rendering, computes audience requirements from issuer configuration, and documents the resulting configuration and upgrade behavior with extensive chart tests. Sequence diagram for issuer-specific token settingssequenceDiagram
participant Token
participant FOCA
participant AccessControl
participant ChartConfig
Token->>FOCA: Authenticate using issuer settings
FOCA->>FOCA: Select issuer by iss claim
FOCA->>FOCA: Apply issuer audience and claim_groups
FOCA->>AccessControl: Provide authenticated subject and groups
AccessControl->>ChartConfig: Resolve roles from group_mapping
ChartConfig-->>AccessControl: Use issuer claim_groups or global claim
Flow diagram for Helm issuer security validationflowchart TD
A[Helm values: security.auth.issuers] --> B{Each issuer entry}
B -->|URL| C[Validate issuer string]
B -->|Map| D[Validate issuer and allowed settings]
D --> E[Validate audience and claim_groups]
C --> F[Determine requireAudience]
E --> F
F --> G{Every issuer map has audience?}
G -->|No| H[requireAudience: true]
G -->|Yes| I[requireAudience: false]
H --> J[Library validates global audience]
I --> K[Chart validates global audience type]
J --> L[Render generated security config]
K --> L
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #341 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 2195 2195
=========================================
Hits 2195 2195 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Linked issues
#337 feat(chart): accept issuer settings · 5 of 5 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Accept issuer maps with a non-empty, whitespace-trimmed issuer. | ✅ Met | The chart accepts URL strings and maps, validates the map's issuer, and rejects unknown keys. |
| 2 | Let an issuer's claim_groups satisfy the group-claim check. | ✅ Met | The check accounts for issuer-level claims, including empty claims that disable groups for that issuer. |
| 3 | Add chart tests and update the chart README. | ✅ Met | The change adds chart coverage for issuer maps and updates deployment/README.md. |
| 4 | The chart renders with issuer maps and fails on invalid ones. | ✅ Met | Tests cover valid maps, mixed URL/map entries, and invalid issuer values and settings. |
| 5 | Chart tests and helm lint pass. | ✅ Met | The PR reports 139 chart tests passing and helm lint passing with the CI value sets. |
Sourcery assessment
Needs a human reviewer. Issuer-specific audiences determine which tokens are accepted, and issuer-specific group claims determine which groups feed role mappings; a wrong setting could grant access to unintended users. Reverting the chart would stop the configuration change but would not undo access or exposure that already occurred.
Summary
The Helm chart now accepts trusted token issuers as maps with their own settings (FOCA 0.18's
IssuerConfig:issuer,namespace,audience,claim_groups,userinfo_claims), not only as URLs. This follows Cloud Registry's solution (elixir-cloud-aai/cloud-registry#264) and adds a few more checks:issueris a non-blank string without surrounding whitespace. Maps with other keys fail rendering and name the key (FOCA forbids extra keys). The same applies to a misspeltissuer.audiencemust be null or a non-empty list of non-blank strings. A global audience is required (the library'srequireAudience, now computed byprotes.requireAudience) unless every issuer is a map with an audience of its own, as in FOCA. When it isn't required, the chart checks that a set global audience is null or a list of strings, because the library then skips its check.claim_groupsmust be null or a string without surrounding whitespace; empty means the issuer contributes no groups. It replaces the global claim for that issuer's tokens, unless it is unset or null. Group mappings need a usable claim of at least one issuer, as FOCA checks, and the error message now names the issuers' claims too.values.yamlcomments, the access control docs (Deployment settings, with an example and the warning that group claim values are not namespaced) and upgrading.md (thenamespace: ""remedy now works in the chart, too).The app still validates
namespaceanduserinfo_claimson startup, as well as duplicate issuers; the chart README says so.Closes #337
Verification
pytest tests/test_chart.py: 139 passed (Helm v3.22.1, as in CI). There are new tests for invalid issuers, issuer settings (round trip through FOCA'sSecurityConfig), mixed URLs and maps, audience requirements,requireAudienceasserted directly,verify_audience: falsewith issuer maps, replaced group claims and invalid issuer settings. The tests were written first, and the new ones failed before the change.helm lint deployment --strictwith the three CI value sets: passed.pre-commit run --all-files: passed. Locally the actionlint hook was skipped, because its download was cut off; I ran the standaloneactionlint1.7.12 instead, and it passed.mkdocs build --strict: passed.requireAudienceis simpler and tested directly; the access control docs mention issuer audiences.issuerkey is named; the header comment ofcheckSecurityis updated.Declined review findings
"null"string intest_issuer_group_claim_replaced: the parametrisation mirrors Cloud Registry's test, and the docstring explains the encoding.Open questions
None.
🤖 Generated with Claude Code