Skip to content

Support bracketed list strings in OIDC teams claim - #7467

Merged
nscuro merged 1 commit into
DependencyTrack:mainfrom
Akhil-1527:bracketed-teams-claim
Sep 27, 2026
Merged

nscuro merged 1 commit into
DependencyTrack:mainfrom
Akhil-1527:bracketed-teams-claim

Conversation

@Akhil-1527

Copy link
Copy Markdown
Contributor

Description

String values of the OIDC teams claim are already split on commas, but some identity providers wrap the list in square brackets. Groups federated through AWS Cognito, for example, arrive as "[uuid1, uuid2, uuid3]". The brackets stayed on the first and last team names, so those teams never matched. This strips one pair of surrounding brackets before splitting.

Addressed Issue

Closes #3908

Additional Details

I kept the existing auto-detection rather than adding a strategy flag, since string claims are already handled without extra config. Only a bracket pair that wraps the whole value is removed, so something like [foo is left alone. "[]" now gives an empty list, same as "", instead of a team named [].

The dt.oidc.teams-claim description in application.properties is updated too, since the generated configuration docs come from there.

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
  • This PR is a substantial change (per the ADR criteria), and I have added an ADR under docs/adr/

Some identity providers can only put strings into custom claims. For
example, groups federated through AWS Cognito arrive in a custom attribute
as "[uuid1, uuid2, uuid3]". Splitting that on commas left the brackets on
the first and last team names, so those teams never matched, and "[]"
turned into a team named "[]".

Strip one pair of surrounding square brackets before splitting a string
teams claim.

Signed-off-by: Akhil CH <[email protected]>
@owasp-dt-bot

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage (70.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (97aa8e5) 45808 40203 87.76%
Head commit (d84f849) 45812 (+4) 40207 (+4) 87.77% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7467) 5 5 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@nscuro nscuro added this to the 5.2 milestone Sep 27, 2026
@nscuro nscuro added the enhancement New feature or request label Sep 27, 2026
@nscuro
nscuro merged commit 55103ce into DependencyTrack:main Sep 27, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow custom claim parser during OIDC login procedure for teams resolution

3 participants