Skip to content

Commit 501fe8c

Browse files
authored
Updated incorrect sns event fields to match correct format (#26)
1 parent a8c815e commit 501fe8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/AWSLambdaEvents/SNS.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public struct SNSEvent: Decodable {
5454
public var timestamp: Date
5555
public let signingCertURL: String
5656
public let message: String
57-
public let unsubscribeUrl: String
57+
public let unsubscribeURL: String
5858
public let subject: String?
5959
}
6060
}
@@ -68,9 +68,9 @@ extension SNSEvent.Message: Decodable {
6868
case messageAttributes = "MessageAttributes"
6969
case signatureVersion = "SignatureVersion"
7070
case timestamp = "Timestamp"
71-
case signingCertURL = "SigningCertUrl"
71+
case signingCertURL = "SigningCertURL"
7272
case message = "Message"
73-
case unsubscribeUrl = "UnsubscribeUrl"
73+
case unsubscribeURL = "UnsubscribeURL"
7474
case subject = "Subject"
7575
}
7676
}

Tests/AWSLambdaEventsTests/SNSTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class SNSTests: XCTestCase {
3232
"Timestamp": "2020-01-08T14:18:51.203Z",
3333
"SignatureVersion": "1",
3434
"Signature": "LJMF/xmMH7A1gNy2unLA3hmzyf6Be+zS/Yeiiz9tZbu6OG8fwvWZeNOcEZardhSiIStc0TF7h9I+4Qz3omCntaEfayzTGmWN8itGkn2mfn/hMFmPbGM8gEUz3+jp1n6p+iqP3XTx92R0LBIFrU3ylOxSo8+SCOjA015M93wfZzwj0WPtynji9iAvvtf15d8JxPUu1T05BRitpFd5s6ZXDHtVQ4x/mUoLUN8lOVp+rs281/ZdYNUG/V5CwlyUDTOERdryTkBJ/GO1NNPa+6m04ywJFa5d+BC8mDcUcHhhXXjpTEbt8AHBmswK3nudHrVMRO/G4zmssxU2P7ii5+gCfA==",
35-
"SigningCertUrl": "https://sns.eu-central-1.amazonaws.com/SimpleNotificationService-6aad65c2f9911b05cd53efda11f913f9.pem",
36-
"UnsubscribeUrl": "https://sns.eu-central-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:079477498937:EventSources-SNSTopic-1NHENSE2MQKF5:6fabdb7f-b27e-456d-8e8a-14679db9e40c",
35+
"SigningCertURL": "https://sns.eu-central-1.amazonaws.com/SimpleNotificationService-6aad65c2f9911b05cd53efda11f913f9.pem",
36+
"UnsubscribeURL": "https://sns.eu-central-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:079477498937:EventSources-SNSTopic-1NHENSE2MQKF5:6fabdb7f-b27e-456d-8e8a-14679db9e40c",
3737
"MessageAttributes": {
3838
"binary":{
3939
"Type": "Binary",
@@ -72,7 +72,7 @@ class SNSTests: XCTestCase {
7272
XCTAssertEqual(record.sns.signatureVersion, "1")
7373
XCTAssertEqual(record.sns.signature, "LJMF/xmMH7A1gNy2unLA3hmzyf6Be+zS/Yeiiz9tZbu6OG8fwvWZeNOcEZardhSiIStc0TF7h9I+4Qz3omCntaEfayzTGmWN8itGkn2mfn/hMFmPbGM8gEUz3+jp1n6p+iqP3XTx92R0LBIFrU3ylOxSo8+SCOjA015M93wfZzwj0WPtynji9iAvvtf15d8JxPUu1T05BRitpFd5s6ZXDHtVQ4x/mUoLUN8lOVp+rs281/ZdYNUG/V5CwlyUDTOERdryTkBJ/GO1NNPa+6m04ywJFa5d+BC8mDcUcHhhXXjpTEbt8AHBmswK3nudHrVMRO/G4zmssxU2P7ii5+gCfA==")
7474
XCTAssertEqual(record.sns.signingCertURL, "https://sns.eu-central-1.amazonaws.com/SimpleNotificationService-6aad65c2f9911b05cd53efda11f913f9.pem")
75-
XCTAssertEqual(record.sns.unsubscribeUrl, "https://sns.eu-central-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:079477498937:EventSources-SNSTopic-1NHENSE2MQKF5:6fabdb7f-b27e-456d-8e8a-14679db9e40c")
75+
XCTAssertEqual(record.sns.unsubscribeURL, "https://sns.eu-central-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:079477498937:EventSources-SNSTopic-1NHENSE2MQKF5:6fabdb7f-b27e-456d-8e8a-14679db9e40c")
7676

7777
XCTAssertEqual(record.sns.messageAttributes?.count, 2)
7878

0 commit comments

Comments
 (0)