-
Notifications
You must be signed in to change notification settings - Fork 759
fix: correct ARN parsing for notification targets #1010
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
fix: correct ARN parsing for notification targets #1010
Conversation
|
Hey @tennisleng , Thank you for your contribution! CLA signing has been added to the merge, without it, automated CI testing cannot be initiated. |
Previously TargetID::from_str was used to parse full ARN strings like 'arn:rustfs:sqs:eu-central:primary:webhook'. This caused the TargetID to be incorrectly constructed with id='arn' and name='rustfs:sqs:...'. When the config was validated, calling target_id.to_arn() produced a duplicated ARN prefix: 'arn:rustfs:sqs:eu-central:arn:rustfs:sqs:eu-central:primary:webhook' This fix uses ARN::parse() to properly parse the full ARN string and extract the correct TargetID with id='primary' and name='webhook'. Fixes rustfs#1007
4d65931 to
98de3f1
Compare
|
Hey @tennisleng , Thank you for your contribution, but CI failed. |
|
Hey @tennisleng , Thank you so much for your contribution! We have merged the code. Thank you! |
Summary
This PR fixes an issue where bucket event notifications fail with a duplicated ARN prefix error.
Fixes #1007
Problem
When using minio mc to set bucket event notifications, the ARN validation fails with:
Root Cause
In
ecfs.rsandmain.rs,TargetID::from_strwas used to parse full ARN strings likearn:rustfs:sqs:eu-central:primary:webhook. However,TargetID::from_strexpects the formatID:Name(e.g.,primary:webhook).This caused the TargetID to be incorrectly constructed with:
id = "arn"name = "rustfs:sqs:eu-central:primary:webhook"When the config was validated, calling
target_id.to_arn()produced a duplicated ARN prefix.Fix
Changed the parser to use
ARN::parse()to properly parse the full ARN string and extract the correct TargetID with:id = "primary"name = "webhook"Changes
rustfs/src/storage/ecfs.rs: Updated ARN parsing input_bucket_notification_configurationrustfs/src/main.rs: Updated ARN parsing inadd_bucket_notification_configuration