Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mainflux/mainflux into MF…
Browse files Browse the repository at this point in the history
…-1416
  • Loading branch information
rodneyosodo committed Mar 21, 2022
2 parents 80d2a7b + 127044e commit 2778396
Show file tree
Hide file tree
Showing 103 changed files with 1,396 additions and 1,354 deletions.
46 changes: 11 additions & 35 deletions api/openapi/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ paths:
be uniquely identified by its ID.
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
requestBody:
$ref: "#/components/requestBodies/KeyRequest"
responses:
Expand All @@ -35,7 +33,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ApiKeyId"
responses:
'200':
Expand All @@ -53,7 +50,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ApiKeyId"
responses:
'204':
Expand All @@ -70,7 +66,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/requestBodies/GroupCreateReq"
responses:
'201':
Expand All @@ -92,7 +87,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tree"
Expand All @@ -115,7 +109,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
responses:
'200':
Expand All @@ -135,7 +128,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
requestBody:
$ref: "#/components/requestBodies/GroupUpdateReq"
Expand All @@ -159,7 +151,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
Expand All @@ -185,7 +176,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
Expand All @@ -211,7 +201,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
Expand All @@ -235,7 +224,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
requestBody:
$ref: "#/components/requestBodies/MembersReq"
Expand All @@ -257,7 +245,6 @@ paths:
description: |
Array of member ids that are in the group specified with groupID.
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
Expand All @@ -276,7 +263,6 @@ paths:
tags:
- auth
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/UserGroupID"
requestBody:
$ref: "#/components/requestBodies/ShareGroupAccessReq"
Expand All @@ -297,7 +283,6 @@ paths:
description: |
Array of groups that member belongs to.
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/MemberId"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
Expand All @@ -317,8 +302,6 @@ paths:
Also, only policies defined on the system are allowed to add. For more details, please see the docs for Authorization.
tags:
- auth
parameters:
- $ref: "#/components/parameters/AdminAuthorization"
requestBody:
$ref: "#/components/requestBodies/PoliciesReq"
responses:
Expand All @@ -343,8 +326,6 @@ paths:
Also, only policies defined on the system are allowed to delete. For more details, please see the docs for Authorization.
tags:
- auth
parameters:
- $ref: "#/components/parameters/AdminAuthorization"
requestBody:
$ref: "#/components/requestBodies/PoliciesReq"
responses:
Expand Down Expand Up @@ -559,14 +540,6 @@ components:
type: string

parameters:
Authorization:
name: Authorization
description: User's access token.
in: header
schema:
type: string
format: jwt
required: true
ApiKeyId:
name: id
description: API Key ID.
Expand Down Expand Up @@ -643,14 +616,6 @@ components:
schema:
type: boolean
default: false
AdminAuthorization:
name: Authorization
description: Admin's access token.
in: header
schema:
type: string
format: jwt
required: true

requestBodies:
KeyRequest:
Expand Down Expand Up @@ -757,3 +722,14 @@ components:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"

securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
68 changes: 32 additions & 36 deletions api/openapi/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ paths:
the provided access token.
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
requestBody:
$ref: "#/components/requestBodies/ConfigCreateReq"
responses:
Expand All @@ -38,7 +36,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/State"
Expand All @@ -58,7 +55,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
responses:
'200':
Expand All @@ -78,7 +74,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigUpdateReq"
Expand All @@ -103,7 +98,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
responses:
'204':
Expand All @@ -123,7 +117,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigCertUpdateReq"
Expand All @@ -149,7 +142,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigConnUpdateReq"
Expand All @@ -173,8 +165,9 @@ paths:
Retrieves a configuration with given external ID and external key.
tags:
- configs
security:
- bootstrapAuth: []
parameters:
- $ref: "#/components/parameters/ConfigAuth"
- $ref: "#/components/parameters/ExternalId"
responses:
'200':
Expand All @@ -194,8 +187,9 @@ paths:
Retrieves a configuration with given external ID and encrypted external key.
tags:
- configs
security:
- bootstrapEncAuth: []
parameters:
- $ref: "#/components/parameters/EncConfigAuth"
- $ref: "#/components/parameters/ExternalId"
responses:
'200':
Expand All @@ -214,7 +208,6 @@ paths:
tags:
- configs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: '#/components/requestBodies/ConfigStateUpdateReq'
Expand Down Expand Up @@ -344,31 +337,6 @@ components:
- content

parameters:
Authorization:
name: Authorization
description: User's access token.
in: header
schema:
type: string
format: jwt
required: true
ConfigAuth:
name: configAuthorization
description: Configuration external key.
in: header
schema:
type: string
required: true
EncConfigAuth:
name: configAuthorization
description: |
Hex-encoded configuration external key encrypted using
the AES algorithm and SHA256 sum of the external key
itself as an encryption key.
in: header
schema:
type: string
required: true
ConfigId:
name: configId
description: Unique Config identifier. It's the ID of the corresponding Thing.
Expand Down Expand Up @@ -533,3 +501,31 @@ components:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"

securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
bootstrapAuth:
type: http
scheme: bearer
bearerFormat: string
description: |
* Things access: "Authorization: Thing <external_key>"
bootstrapEncAuth:
type: http
scheme: bearer
bearerFormat: aes-sha256-uuid
description: |
* Things access: "Authorization: Thing <external_enc_key>"
Hex-encoded configuration external key encrypted using
the AES algorithm and SHA256 sum of the external key
itself as an encryption key.
security:
- bearerAuth: []
23 changes: 11 additions & 12 deletions api/openapi/certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ paths:
description: Creates a certificate for thing
tags:
- certs
parameters:
- $ref: "#/components/parameters/Authorization"
requestBody:
$ref: "#/components/requestBodies/CertReq"
responses:
Expand All @@ -32,7 +30,6 @@ paths:
tags:
- certs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/CertID"
responses:
'200':
Expand All @@ -53,7 +50,6 @@ paths:
tags:
- certs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/CertID"
responses:
'200':
Expand All @@ -73,7 +69,6 @@ paths:
tags:
- certs
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/ThingID"
responses:
'200':
Expand All @@ -100,13 +95,6 @@ paths:

components:
parameters:
Authorization:
name: Authorization
description: User's access token. Used instead of credentials in env or config.toml.
in: header
schema:
type: string
required: false
ThingID:
name: thingID
description: Thing ID
Expand Down Expand Up @@ -256,3 +244,14 @@ components:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"

securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
Loading

0 comments on commit 2778396

Please sign in to comment.