-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
api.openapi.yml
71 lines (66 loc) · 1.76 KB
/
api.openapi.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
openapi: '3.0.1'
info:
version: '1'
title: !Ref AWS::StackName
x-default-request: &request
security:
Fn::If:
- HasAuthorizer
- [basic: []]
- []
responses:
200:
description: "200 response"
content: {}
x-amazon-apigateway-integration:
responses:
default:
statusCode: 200
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ApiFunction.Arn}/invocations
passthroughBehavior: when_no_match
httpMethod: POST
type: aws_proxy
x-amazon-apigateway-gateway-responses:
UNAUTHORIZED:
statusCode: 401
responseParameters:
gatewayresponse.header.WWW-Authenticate: "'Basic'"
responseTemplates:
application/json:
Fn::Stringify:
errors:
- code: UNAUTHORIZED
paths:
/:
get:
<<: *request
x-amazon-apigateway-integration:
responses:
default:
statusCode: 200
passthroughBehavior: when_no_match
requestTemplates:
application/json: "{\"statusCode\": 200}"
type: mock
/{proxy+}:
get:
<<: *request
head:
<<: *request
components:
securitySchemes:
Fn::If:
- HasAuthorizer
- basic:
type: apiKey
name: Authorization
in: header
x-amazon-apigateway-authtype: custom
x-amazon-apigateway-authorizer:
authorizerUri:
Fn::Sub:
- arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${AuthorizerLambdaArn}/invocations
- AuthorizerLambdaArn: !If [ HasCustomAuthorizer, !Ref AuthCustomLambdaArn, !GetAtt AuthorizerFunction.Arn ]
authorizerResultTtlInSeconds: 300
type: token
- !Ref AWS::NoValue