-
Notifications
You must be signed in to change notification settings - Fork 333
made the regex more generic #3005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dimas-b
left a comment
There was a problem hiding this 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
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java
Show resolved
Hide resolved
runtime/service/src/test/java/org/apache/polaris/service/entity/CatalogEntityTest.java
Outdated
Show resolved
Hide resolved
|
|
||
| @ParameterizedTest | ||
| @ValueSource(strings = {"", "arn:aws:iam::0123456:role/jdoe", "aws-cn"}) | ||
| @ValueSource(strings = {"", "arn:aws:iam:0123456:role/jdoe", "aws-cn"}) |
There was a problem hiding this comment.
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.
|
Thanks a lot for the change, @cccs-cat001 ! Thanks a lot for the review and dev mailing discussion, @dimas-b ! |
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.
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
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)