Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
78 lines (76 loc) · 2.4 KB
/
Copy pathopenapi.yaml
File metadata and controls
78 lines (76 loc) · 2.4 KB
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
---
openapi: 3.0.3
info:
title: engineering-agents
description: |
Receives events from Slack for the STRIDEr Slack app. Slack is the only
caller. See docs/handbook/09-slack-messaging.md.
version: 1.0.0
servers:
- url:
Fn::Sub: "https://${Hostname}"
description: Production endpoint
paths:
"/slack/events":
post:
summary: Receive a Slack event
description: |
Slack signs every request with the app's signing secret. There is no
authorizer and no request validator on this route, on purpose: an
authorizer is not given the request body, which the signature is
computed over, so the function makes the check; and a validator writes
what it finds to the log, where what people wrote in Slack must not go.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SlackRequest"
responses:
'200':
description: Accepted, or the answer to Slack's check of this address
content:
application/json:
schema:
$ref: "#/components/schemas/SlackResponse"
'400':
description: The body is not JSON
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
'401':
description: The signature is missing, wrong or more than five minutes old
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
'500':
description: The message could not be queued. Slack sends it again.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
x-amazon-apigateway-integration:
type: AWS_PROXY
httpMethod: POST
uri:
Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ReceiveSlackEventFunction.Arn}/invocations"
components:
schemas:
SlackRequest:
description: Whatever Slack sends. Slack decides its shape.
type: object
additionalProperties: true
SlackResponse:
type: object
properties:
challenge:
type: string
ErrorResponse:
type: object
properties:
message:
type: string
required:
- message