Skip to content

Commit

Permalink
Add authorization to HTTP endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
vincemtnz committed Jan 12, 2018
1 parent de672b2 commit 9e55053
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,26 @@ functions:
method: get
path: members
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}
members-show:
handler: members-service/members.show
events:
- http:
method: get
path: members/{id}
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}
members-update:
handler: members-service/updateMember.handler
events:
- http:
method: put
path: members/{id}
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}

trigger-champaign-member-update:
handler: members-service/triggerChampaignMemberUpdate.handler
Expand All @@ -87,6 +93,8 @@ functions:
method: post
path: members/unsubscribe
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}

members-braintree-data:
handler: payments-service/braintree_data.show
Expand All @@ -95,6 +103,8 @@ functions:
method: get
path: members/braintree_data
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}

members-gocardless-subscriptions:
handler: payments-service/gocardless_subscriptions.index
Expand All @@ -103,6 +113,8 @@ functions:
method: get
path: members/{id}/gocardless_subscriptions
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}

payments-subscriptions-del-ak:
handler: payments-service/subscriptions-delete-actionkit.handler
Expand Down Expand Up @@ -135,6 +147,8 @@ functions:
method: delete
path: payments-service/{provider}/subscriptions/{id}
cors: true
authorizer:
arn: ${self:provider.environment.COGNITO_POOL_ARN}
request:
parameters:
paths:
Expand Down
1 change: 1 addition & 0 deletions settings/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ environment:
DB_LOG_TABLE: ${env:DB_LOG_TABLE}
UNSUBSCRIBE_PAGE_NAME: ${env:UNSUBSCRIBE_PAGE_NAME}
BRAINTREE_MERCHANT_CURRENCIES: ${env:BRAINTREE_MERCHANT_CURRENCIES}
COGNITO_POOL_ARN: ${env:COGNITO_POOL_ARN}
1 change: 1 addition & 0 deletions settings/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ environment:
DB_LOG_TABLE: ${env:DB_LOG_TABLE}
UNSUBSCRIBE_PAGE_NAME: ${env:UNSUBSCRIBE_PAGE_NAME}
BRAINTREE_MERCHANT_CURRENCIES: ${env:BRAINTREE_MERCHANT_CURRENCIES}
COGNITO_POOL_ARN: ${env:COGNITO_POOL_ARN}

0 comments on commit 9e55053

Please sign in to comment.