Skip to content

Preserve tag-key case in context_key() (#14) - #18

Merged
jplock merged 3 commits into
mainfrom
fix/issue-14-context-key-tag-case
May 31, 2026
Merged

Preserve tag-key case in context_key() (#14)#18
jplock merged 3 commits into
mainfrom
fix/issue-14-context-key-tag-case

Conversation

@jplock

@jplock jplock commented May 31, 2026

Copy link
Copy Markdown
Member

Fixes #14


Note

Medium Risk
Changes IAM evaluation context key matching for tag-based conditions; correct for AWS semantics but may alter outcomes where policies depended on fully lowercased tag keys.

Overview
Fixes #14 by aligning how RequestContext stores and looks up keys from context_key(), context_key_multi(), and get_context_key().

A new normalize_context_key lowercases only the aws:PrincipalTag/, aws:ResourceTag/, and aws:RequestTag/ prefixes (prefix match is case-insensitive) and keeps the tag name after / unchanged, matching AWS case-sensitive tag keys. All other context keys are still fully lowercased.

Regression tests cover principal/resource/request tag keys, mixed-case prefixes, multi-value tags, non-tag keys, and round-trip via get_context_key.

Reviewed by Cursor Bugbot for commit 3e30d10. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 72838fc. Configure here.

Comment thread src/eval/context.rs
@jplock
jplock merged commit f78ebf4 into main May 31, 2026
10 checks passed
@jplock
jplock deleted the fix/issue-14-context-key-tag-case branch May 31, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Request context: aws:*Tag/* keys set via context_key() cannot be retrieved

1 participant