feat(s3): support Filter rules in PutBucketNotificationConfiguration#178
Conversation
|
Hi @fguery, Thanks for taking the time to contribute! We've seen your PR and will take a look soon. To ensure this implementation stays robust, could you also open a PR in our compatibility suite at https://github.com/hectorvent/floci-compatibility-tests? This helps us validate that your changes keep working perfectly as the project evolves. The Floci team |
|
I think mtpettyp way of handling the XML parser is a bit cleaner; I can do that too -- up to you :) |
Yeah, sounds good. Could bring that idea to this PR? Thanks |
…ng a while new XML parser
|
Thanks @fguery |
Summary
PutBucketNotificationConfigurationsilently drops queue/topic configurations when theXML body contains
<Filter>elements (used for key prefix/suffix filtering). The genericXmlParser.getElementText()throws on container elements like<Filter><S3Key><FilterRule>...,and the blanket
catch (XMLStreamException ignored)swallows the error, aborting the parsemid-stream. The notification config is stored as empty.
This PR adds a dedicated
NotificationConfigurationParserthat handles the full notificationschema in a single StAX pass — parsing, storing, evaluating, and round-tripping filter rules. I wasn't
able to use it to parse nested elements, and I didn't want to do too many changes there.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Verified with AWS CLI v2.26.1 against a local Floci dev instance.
Before:
get-bucket-notification-configurationreturns emptyQueueConfigurations: []when the PUT body contains
<Filter>elements.After:
FilterRulesintact)incoming/data.csvwith filterprefix=incoming/+suffix=.csvdelivers exactly 1 SQS message;
outgoing/data.csvandincoming/data.txtare correctlyfiltered out
Wire format follows:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html
Checklist
./mvnw testpasses locally