forked from aws/aws-lambda-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiot.go
46 lines (39 loc) · 1.78 KB
/
iot.go
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
package events
// IoTCoreCustomAuthorizerRequest represents the request to an IoT Core custom authorizer.
// See https://docs.aws.amazon.com/iot/latest/developerguide/config-custom-auth.html
type IoTCoreCustomAuthorizerRequest struct {
Token string `json:"token"`
SignatureVerified bool `json:"signatureVerified"`
Protocols []string `json:"protocols"`
ProtocolData *IoTCoreProtocolData `json:"protocolData,omitempty"`
ConnectionMetadata *IoTCoreConnectionMetadata `json:"connectionMetadata,omitempty"`
}
type IoTCoreProtocolData struct {
TLS *IoTCoreTLSContext `json:"tls,omitempty"`
HTTP *IoTCoreHTTPContext `json:"http,omitempty"`
MQTT *IoTCoreMQTTContext `json:"mqtt,omitempty"`
}
type IoTCoreTLSContext struct {
ServerName string `json:"serverName"`
}
type IoTCoreHTTPContext struct {
Headers map[string]string `json:"headers,omitempty"`
QueryString string `json:"queryString"`
}
type IoTCoreMQTTContext struct {
ClientID string `json:"clientId"`
Password []byte `json:"password"`
Username string `json:"username"`
}
type IoTCoreConnectionMetadata struct {
ID string `json:"id"`
}
// IoTCoreCustomAuthorizerResponse represents the response from an IoT Core custom authorizer.
// See https://docs.aws.amazon.com/iot/latest/developerguide/config-custom-auth.html
type IoTCoreCustomAuthorizerResponse struct {
IsAuthenticated bool `json:"isAuthenticated"`
PrincipalID string `json:"principalId"`
DisconnectAfterInSeconds uint32 `json:"disconnectAfterInSeconds"`
RefreshAfterInSeconds uint32 `json:"refreshAfterInSeconds"`
PolicyDocuments []*IAMPolicyDocument `json:"policyDocuments"`
}