-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7543f7b
commit 5c69ffc
Showing
10 changed files
with
179 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,22 @@ import ( | |
"github.com/uug-ai/facial-access-control/api/utils" | ||
) | ||
|
||
|
||
var Users = []models.User{ | ||
{Id: 0, FirstName: "admin", LastName: "admin", Email: "[email protected]", Password: "admin", Role: "admin", Language: "en", Status: "pending"}, | ||
{Id: 1, FirstName: "user", LastName: "user", Email: "[email protected]", Password: "user", Role: "user", Language: "en", Status: "invited"}, | ||
{Id: 2, FirstName: "Kilian", LastName: "Smith", Email: "[email protected]", Password: "Kilian", Role: "admin", Language: "en", Status: "onboarded"}, | ||
{Id: 3, FirstName: "Cedric", LastName: "Johnson", Email: "[email protected]", Password: "Cedric", Role: "admin", Language: "en", Status: "pending"}, | ||
{Id: 4, FirstName: "Johann", LastName: "Brown", Email: "[email protected]", Password: "Johann", Role: "admin", Language: "en", Status: "invited"}, | ||
{Id: 5, FirstName: "Romain", LastName: "Davis", Email: "[email protected]", Password: "Romain", Role: "admin", Language: "en", Status: "onboarded"}, | ||
{Id: 6, FirstName: "Alex", LastName: "Wilson", Email: "[email protected]", Password: "Alex", Role: "admin", Language: "en", Status: "pending"}, | ||
{Id: 7, FirstName: "Mickael", LastName: "Taylor", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "invited"}, | ||
{Id: 8, FirstName: "Mickael", LastName: "Thomas", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "onboarded"}, | ||
{Id: 9, FirstName: "Mickael", LastName: "Robinson", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "pending"}, | ||
{Id: 10, FirstName: "Mickael", LastName: "Clark", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "invited"}, | ||
} | ||
{Id: 0, FirstName: "admin", LastName: "admin", Email: "[email protected]", Password: "admin", Role: "admin", Language: "en", Status: "pending", VideoPath: ""}, | ||
{Id: 1, FirstName: "user", LastName: "user", Email: "[email protected]", Password: "user", Role: "user", Language: "en", Status: "invited", VideoPath: "/"}, | ||
{Id: 2, FirstName: "Kilian", LastName: "Smith", Email: "[email protected]", Password: "Kilian", Role: "admin", Language: "en", Status: "onboarded", VideoPath: "/path/to/kilian-video.mp4"}, | ||
{Id: 3, FirstName: "Cedric", LastName: "Johnson", Email: "[email protected]", Password: "Cedric", Role: "admin", Language: "en", Status: "pending", VideoPath: ""}, | ||
{Id: 4, FirstName: "Johann", LastName: "Brown", Email: "[email protected]", Password: "Johann", Role: "admin", Language: "en", Status: "invited", VideoPath: ""}, | ||
{Id: 5, FirstName: "Romain", LastName: "Davis", Email: "[email protected]", Password: "Romain", Role: "admin", Language: "en", Status: "onboarded", VideoPath: "/path/to/romain-video.mp4"}, | ||
{Id: 6, FirstName: "Alex", LastName: "Wilson", Email: "[email protected]", Password: "Alex", Role: "admin", Language: "en", Status: "pending", VideoPath: ""}, | ||
{Id: 7, FirstName: "Mickael", LastName: "Taylor", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "invited", VideoPath: ""}, | ||
{Id: 8, FirstName: "Mickael", LastName: "Thomas", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "onboarded", VideoPath: "/path/to/mickael1-video.mp4"}, | ||
{Id: 9, FirstName: "Mickael", LastName: "Robinson", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "pending", VideoPath: ""}, | ||
{Id: 10, FirstName: "Mickael", LastName: "Clark", Email: "[email protected]", Password: "Mickael", Role: "admin", Language: "en", Status: "invited", VideoPath: ""}, | ||
|
||
} | ||
|
||
var Locations = []models.Location{ | ||
{Id: 1, Name: "Location 1", Address: "Address 1", Lat: 1.0, Lng: 1.0}, | ||
{Id: 2, Name: "Location 2", Address: "Address 2", Lat: 2.0, Lng: 2.0}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,7 @@ const docTemplate = `{ | |
"info": { | ||
"description": "{{escape .Description}}", | ||
"title": "{{.Title}}", | ||
"termsOfService": "https://kerberos.io", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "https://www.kerberos.io", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0 - Commons Clause", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"contact": {}, | ||
"version": "{{.Version}}" | ||
}, | ||
"host": "{{.Host}}", | ||
|
@@ -240,6 +231,41 @@ const docTemplate = `{ | |
} | ||
} | ||
}, | ||
"/api/users/onboard": { | ||
"post": { | ||
"description": "Onboard a user using a fingerprint and a videossss", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"tags": [ | ||
"users" | ||
], | ||
"summary": "Onboard a user using a fingerprint and a video", | ||
"operationId": "onboardUser", | ||
"parameters": [ | ||
{ | ||
"description": "User data", | ||
"name": "user", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/models.User" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Created", | ||
"schema": { | ||
"$ref": "#/definitions/models.User" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/api/users/{email}": { | ||
"get": { | ||
"security": [ | ||
|
@@ -407,27 +433,26 @@ const docTemplate = `{ | |
}, | ||
"role": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"videopath": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"Bearer": { | ||
"type": "apiKey", | ||
"name": "Authorization", | ||
"in": "header" | ||
} | ||
} | ||
}` | ||
|
||
// SwaggerInfo holds exported Swagger Info so clients can modify it | ||
var SwaggerInfo = &swag.Spec{ | ||
Version: "1.0", | ||
Version: "", | ||
Host: "", | ||
BasePath: "/", | ||
BasePath: "", | ||
Schemes: []string{}, | ||
Title: "Swagger Kerberos Agent API", | ||
Description: "This is the API for using and configuring Kerberos Agent.", | ||
Title: "", | ||
Description: "", | ||
InfoInstanceName: "swagger", | ||
SwaggerTemplate: docTemplate, | ||
LeftDelim: "{{", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "This is the API for using and configuring Kerberos Agent.", | ||
"title": "Swagger Kerberos Agent API", | ||
"termsOfService": "https://kerberos.io", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "https://www.kerberos.io", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0 - Commons Clause", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "1.0" | ||
"contact": {} | ||
}, | ||
"basePath": "/", | ||
"paths": { | ||
"/api/locations": { | ||
"get": { | ||
|
@@ -233,6 +220,41 @@ | |
} | ||
} | ||
}, | ||
"/api/users/onboard": { | ||
"post": { | ||
"description": "Onboard a user using a fingerprint and a videossss", | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"tags": [ | ||
"users" | ||
], | ||
"summary": "Onboard a user using a fingerprint and a video", | ||
"operationId": "onboardUser", | ||
"parameters": [ | ||
{ | ||
"description": "User data", | ||
"name": "user", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/models.User" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Created", | ||
"schema": { | ||
"$ref": "#/definitions/models.User" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/api/users/{email}": { | ||
"get": { | ||
"security": [ | ||
|
@@ -400,15 +422,14 @@ | |
}, | ||
"role": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"videopath": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"Bearer": { | ||
"type": "apiKey", | ||
"name": "Authorization", | ||
"in": "header" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
basePath: / | ||
definitions: | ||
models.Authentication: | ||
properties: | ||
|
@@ -49,19 +48,13 @@ definitions: | |
type: string | ||
role: | ||
type: string | ||
status: | ||
type: string | ||
videopath: | ||
type: string | ||
type: object | ||
info: | ||
contact: | ||
email: [email protected] | ||
name: API Support | ||
url: https://www.kerberos.io | ||
description: This is the API for using and configuring Kerberos Agent. | ||
license: | ||
name: Apache 2.0 - Commons Clause | ||
url: http://www.apache.org/licenses/LICENSE-2.0.html | ||
termsOfService: https://kerberos.io | ||
title: Swagger Kerberos Agent API | ||
version: "1.0" | ||
contact: {} | ||
paths: | ||
/api/locations: | ||
get: | ||
|
@@ -256,9 +249,27 @@ paths: | |
summary: Get user | ||
tags: | ||
- users | ||
securityDefinitions: | ||
Bearer: | ||
in: header | ||
name: Authorization | ||
type: apiKey | ||
/api/users/onboard: | ||
post: | ||
consumes: | ||
- application/json | ||
description: Onboard a user using a fingerprint and a videossss | ||
operationId: onboardUser | ||
parameters: | ||
- description: User data | ||
in: body | ||
name: user | ||
required: true | ||
schema: | ||
$ref: '#/definitions/models.User' | ||
produces: | ||
- application/json | ||
responses: | ||
"201": | ||
description: Created | ||
schema: | ||
$ref: '#/definitions/models.User' | ||
summary: Onboard a user using a fingerprint and a video | ||
tags: | ||
- users | ||
swagger: "2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters