-
Notifications
You must be signed in to change notification settings - Fork 1
/
socket.yml
232 lines (231 loc) · 6.41 KB
/
socket.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: aws-face-auth
description: User face authentication socket with aws rekognition. For basic authentication use 'rest-auth' socket
version: 0.0.2
keywords:
- user
- face-auth
- auth
- authentication
- register
- aws
- rekognition
config:
AWS_REGION:
description: AWS region
required: true
AWS_SECRET_ACCESS_KEY:
description: AWS secret access key
long_description: |
Visit link to know more about managing keys
(http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html).
required: true
AWS_ACCESS_KEY_ID:
description: AWS access key id
long_description: |
Visit link to know more about managing keys
(http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html).
required: true
FACE_MATCH_THRESHOLD:
description: Specifies the minimum confidence in the face match to return. Minimum value of 0 and Maximum value of 100.
required: true
classes:
user:
- name: face_auth
type: boolean
filter_index: true
- name: external_image_id
type: string
filter_index: true
endpoints:
create-collection:
description: Creates a collection in an AWS Region
parameters:
collectionId:
type: string
description: "ID for the collection that you are creating"
example: "SyncanoFaces"
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
"collectionArn": "12345",
"statusCode": 200
}
-
exit_code: 400
description: Failed
example: |
{
"statusCode": 400,
"code": "ResourceAlreadyExistsException",
"message":"A collection with the specified ID already exists."
}
delete-collection:
description: Deletes a collection in an AWS Region
parameters:
collectionId:
type: string
description: "ID of the collection to delete"
example: "SyncanoFaces"
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
"statusCode": 200
}
-
exit_code: 400
description: Failed
example: |
{
"statusCode": 400,
"code": "AccessDeniedException",
"message":"You are not authorized to perform the action."
}
face-register:
description: Register face to existing user account for face authentication.
long_description: >
Client-side to send user's username and password(expected user to approve by confirming password) to register face to user's account.
parameters:
username:
type: string
description: "User email"
example: "you@domain.com"
password:
type: string
description: "User password"
example: ""
collectionId:
type: string
description: "ID of the collection"
example: "SyncanoFaces"
image:
type: string
description: "Path to image or an S3 object key"
bucketName:
type: string
description: "Name of s3 bucket. Leave empty if image not on s3 bucket."
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
message: "User face registered for face authentication."
}
-
exit_code: 400
description: Failed
example: |
{
message: "Fail to register face."
}
face-login:
description: Login to a user account using face image
parameters:
collectionId:
type: string
description: "ID of the collection"
example: "SyncanoFaces"
image:
type: string
description: "Path to image or an S3 object key"
bucketName:
type: string
description: "Name of s3 bucket. Leave empty if image not on s3 bucket."
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
token: "cb21ff98ac8c7dda8fcd01",
username: "you@domain.com"
}
-
exit_code: 400
description: Failed
example: |
{
message: "Authentication fail."
}
remove-face-auth:
description: Remove face authentication for particular user
parameters:
username:
type: string
description: "Username of user"
example: "you@domain.com"
token:
type: string
description: "User token"
example: "cb21fac8c7dda8fcd0129b0adb0254dea5c8e"
collectionId:
type: string
description: "ID of the collection"
example: "SyncanoFaces"
image:
type: string
description: "Path to image or an S3 object key"
bucketName:
type: string
description: "Name of s3 bucket. Leave empty if image not on s3 bucket."
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
message: "User account removed from face authentication."
}
-
exit_code: 400
description: Failed
example: |
{
message: "Face authentication not enabled for user account."
}
verify-face-auth:
description: Checks if user face authentication is enabled
parameters:
username:
type: string
description: "Username of user"
example: "you@domain.com"
token:
type: string
description: "User token"
example: "cb21fac8c7dda8fcd0129b0adb0254dea5c8e"
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: |
{
message: "Face auth enabled on user account.",
is_face_auth: true
}
-
exit_code: 200
description: Failed
example: |
{
message: "Face auth not enabled on user account.",
is_face_auth: false
}