Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Commit

Permalink
SNS cleanup, SNS has been superseded by SQS
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Nov 19, 2018
1 parent 868400b commit f72037c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions server/lib/user-aws-credential-generator.js
Expand Up @@ -9,7 +9,7 @@ class UserAwsCredentialGenerator {
constructor (userId, s3Bucket) {
this.userId = userId
if (!userId) { throw new Error('Missing userId') }
// For SNS and SQS, which don't allow + and /
// For SQS, which don't allow + and /
this.userIdBase62 = this.userId.replace(/[^A-Za-z0-9]/g, '')
this.s3Bucket = s3Bucket
if (!this.s3Bucket) { throw new Error('Missing s3Bucket.') }
Expand Down Expand Up @@ -108,13 +108,6 @@ class UserAwsCredentialGenerator {
],
"Effect": "Allow",
"Resource": "${this.arnSqsPrefix()}*"
},
{
"Action": [
"sns:*"
],
"Effect": "Allow",
"Resource": "${this.arnSnsTopic()}"
}
]
}
Expand All @@ -129,11 +122,6 @@ class UserAwsCredentialGenerator {
return `${config.apiVersion}/${this.userId}`
}

// SNS topic names are limited to 256 characters.
arnSnsTopic () {
return `arn:aws:sns:*:*:${this.s3Bucket}-${config.apiVersion}-${this.userIdBase62}`
}

// SQS queue names are limited to 80 characters.
arnSqsPrefix () {
return `arn:aws:sqs:*:*:${this.s3Bucket}-${config.apiVersion}-${this.userIdBase62}-`
Expand Down

0 comments on commit f72037c

Please sign in to comment.