forked from TimothyJones/github-cognito-openid-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yml
110 lines (106 loc) · 2.71 KB
/
template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
./slack-api-identity-proxy
# More info about Globals: https://slack.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Runtime: nodejs10.x
Timeout: 15
Environment:
Variables:
SLACK_CLIENT_ID:
Ref: SlackClientIdParameter
SLACK_CLIENT_SECRET:
Ref: SlackClientSecretParameter
COGNITO_REDIRECT_URI:
Ref: CognitoRedirectUriParameter
SLACK_API_URL:
Ref: SlackUrlParameter
SLACK_LOGIN_URL:
Ref: SlackLoginUrlParameter
Parameters:
SlackClientIdParameter:
Type: String
SlackClientSecretParameter:
Type: String
CognitoRedirectUriParameter:
Type: String
SlackUrlParameter:
Type: String
Default: "https://slack.com"
MinLength: 1
SlackLoginUrlParameter:
Type: String
Default: "https://slack.com"
MinLength: 1
Resources:
OpenIdDiscovery:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist-lambda
Handler: openIdConfiguration.handler
Events:
GetResource:
Type: Api
Properties:
Path: /.well-known/openid-configuration
Method: get
Authorize:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist-lambda
Handler: authorize.handler
Events:
GetResource:
Type: Api
Properties:
Path: /authorize
Method: get
Token:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist-lambda
Handler: token.handler
Events:
GetResource:
Type: Api
Properties:
Path: /token
Method: get
PostResource:
Type: Api
Properties:
Path: /token
Method: post
UserInfo:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist-lambda
Handler: userinfo.handler
Events:
GetResource:
Type: Api
Properties:
Path: /userinfo
Method: get
PostResource:
Type: Api
Properties:
Path: /userinfo
Method: post
Jwks:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist-lambda
Handler: jwks.handler
Events:
GetResource:
Type: Api
Properties:
Path: /.well-known/jwks.json
Method: get
Outputs:
SlackShimIssuer:
Description: "Slack OpenID Shim Issuer"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"