mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-11 19:29:16 +08:00

* MF-1565 - Document Bearer Authorization header Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth, bootstrap, http and readers openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add enc key for bootstrap Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use global security Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bearer formats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Polish descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix boostrap and typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
openapi: 3.0.1
|
|
info:
|
|
title: Mainflux Provision service
|
|
description: HTTP API for Provision service
|
|
version: "1.0.0"
|
|
|
|
paths:
|
|
/mapping:
|
|
post:
|
|
summary: Adds new device to proxy
|
|
description: Adds new device to proxy
|
|
tags:
|
|
- provision
|
|
requestBody:
|
|
$ref: "#/components/requestBodies/ProvisionReq"
|
|
responses:
|
|
'201':
|
|
description: Created
|
|
'400':
|
|
description: Failed due to malformed JSON.
|
|
"401":
|
|
description: Missing or invalid access token provided.
|
|
'500':
|
|
$ref: "#/components/responses/ServiceError"
|
|
get:
|
|
summary: Gets current mapping.
|
|
description: Gets current mapping. This can be used in UI
|
|
so that when bootstrap config is created from UI matches
|
|
configuration created with provision service.
|
|
tags:
|
|
- provision
|
|
responses:
|
|
'200':
|
|
$ref: "#/components/responses/ProvisionRes"
|
|
"401":
|
|
description: Missing or invalid access token provided.
|
|
'500':
|
|
$ref: "#/components/responses/ServiceError"
|
|
/health:
|
|
get:
|
|
summary: Retrieves service health check info.
|
|
tags:
|
|
- health
|
|
responses:
|
|
'200':
|
|
$ref: "#/components/responses/HealthRes"
|
|
'500':
|
|
$ref: "#/components/responses/ServiceError"
|
|
|
|
components:
|
|
requestBodies:
|
|
ProvisionReq:
|
|
description: MAC address of device or other identifier
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- external_id
|
|
- external_key
|
|
properties:
|
|
external_id:
|
|
type: string
|
|
external_key:
|
|
type: string
|
|
name:
|
|
type: string
|
|
|
|
responses:
|
|
ServiceError:
|
|
description: Unexpected server-side error occurred.
|
|
ProvisionRes:
|
|
description: Current mapping JSON representation.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
HealthRes:
|
|
description: Service Health Check.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "./schemas/HealthInfo.yml"
|
|
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
description: |
|
|
* Users access: "Authorization: Bearer <user_token>"
|
|
|
|
security:
|
|
- bearerAuth: []
|