Skip to content

Conversation

@cccs-cat001
Copy link
Contributor

We found a use case where the AWS ARN regex pattern was too specific and caused us issues connecting to our private S3 storage that's not on AWS. This fixes that issue.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @cccs-cat001 ! In general the regex change looks reasonable to me. However, given that some existing applications may rely on the more strict regex (I do not know for sure), I've started a dev ML discussion too. Let's wait a few days for people to raise concerns (if any).

https://lists.apache.org/thread/dvgtn32h722h9xtvty84h21474q1b4jr

dimas-b
dimas-b previously approved these changes Nov 7, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Nov 7, 2025

@ParameterizedTest
@ValueSource(strings = {"", "arn:aws:iam::0123456:role/jdoe", "aws-cn"})
@ValueSource(strings = {"", "arn:aws:iam:0123456:role/jdoe", "aws-cn"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have another test for a valid non-aws role string which can pass the validation? So that, any regression will be caught if the regex change happens.

@flyrain flyrain merged commit 034959e into apache:main Nov 7, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Nov 7, 2025
@flyrain
Copy link
Contributor

flyrain commented Nov 7, 2025

Thanks a lot for the change, @cccs-cat001 ! Thanks a lot for the review and dev mailing discussion, @dimas-b !

dimas-b added a commit to dimas-b/polaris that referenced this pull request Nov 17, 2025
Following up on apache#3005, which allowed a wide range of ARN values in the validation RegEx, remove an additional explicit check for `aws-cn` being present in the ARN as a sub-string.

Update existing unit tests to process `aws-cn` ARNs as common `aws` ARNs.

Note: the old validation code does not look correct because it used to check for `aws-cn` anywhere in the ARN string, not just in its "partition" component.
@dimas-b dimas-b mentioned this pull request Nov 17, 2025
6 tasks
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.

3 participants