Files
seaweedfs/weed/iam/integration
Chris LuandClaude Opus 5.5 7da99cd760 sts: honor the provider role mapping for web identity roles it names (#12982)
* sts: honor the provider role mapping for web identity roles it names

AssumeRoleWithWebIdentity only checked the role's trust policy, so with
trust policies that allow the provider without claim conditions any
token from that provider could assume any of its roles, including ones
the provider's roleMapping assigns to other claim values. Bearer auth
already uses the mapped roles. A role named by the mapping (a rule or
the default role) is now issued only to tokens the mapping gives that
role; roles the mapping does not name keep the trust-policy-only check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* sts: trim role mapping targets when checking which roles the mapping names

Bearer auth trims mapped roles, so a padded target still assigns that
role; without the trim the web identity check treated the role as
unnamed and left it to the trust policy alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* sts: compare the provider's mapped roles as a list, not a comma-split string

The OIDC provider joins mapped roles with commas, and role names may
contain commas, so splitting the joined attribute could match a piece of
one mapped role against a different role, or miss the mapped role.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* sts: check the session role in the web identity role mapping test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:08:50 -08:00
..