Skip to content

Commit

Permalink
honour filter policies on SNS subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxholman committed Apr 16, 2021
1 parent 9e6f7a8 commit 1e39f6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/gosns/gosns.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ func Publish(w http.ResponseWriter, req *http.Request) {
"subject": subject,
}).Debug("Publish to Topic")
for _, subs := range app.SyncTopics.Topics[topicName].Subscriptions {

if subs.FilterPolicy != nil && !subs.FilterPolicy.IsSatisfiedBy(messageAttributes) {
continue
}

switch app.Protocol(subs.Protocol) {
case app.ProtocolSQS:
publishSQS(w, req, subs, messageBody, messageAttributes, subject, topicArn, topicName, messageStructure)
Expand Down

0 comments on commit 1e39f6a

Please sign in to comment.