Skip to content

Commit

Permalink
feat: add version prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Gateru <[email protected]>
  • Loading branch information
felixgateru committed Jan 28, 2025
1 parent e69730d commit b83ee0f
Show file tree
Hide file tree
Showing 43 changed files with 620 additions and 542 deletions.
2 changes: 1 addition & 1 deletion apidocs/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This folder contains an OpenAPI specifications for SuperMQ API.

View specification in Swagger UI at [docs.api.magistrala.abstractmachines.fr](https://docs.api.supermq.abstractmachines.fr)
View specification in Swagger UI at [docs.api.magistrala.abstractmachines.fr](https://docs.api.supermq.abstractmachines.fr)
7 changes: 5 additions & 2 deletions apidocs/openapi/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9001
- url: https://localhost:9001
- url: http://localhost:9001/v1
- url: https://localhost:9001/v1

tags:
- name: Keys
Expand Down Expand Up @@ -100,6 +100,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9001
- url: https://localhost:9001
tags:
- Health
security: []
Expand Down
7 changes: 5 additions & 2 deletions apidocs/openapi/certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9019
- url: https://localhost:9019
- url: http://localhost:9019/v1
- url: https://localhost:9019/v1

tags:
- name: certs
Expand Down Expand Up @@ -139,6 +139,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9019
- url: https://localhost:9019
tags:
- health
security: []
Expand Down
25 changes: 14 additions & 11 deletions apidocs/openapi/channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9005
- url: https://localhost:9005
- url: http://localhost:9005/v1
- url: https://localhost:9005/v1

tags:
- name: Channels
Expand Down Expand Up @@ -454,7 +454,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"

/{domainID}/channels/{chanID}/connect:
post:
operationId: connectClientsToChannel
Expand Down Expand Up @@ -516,6 +516,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9005
- url: https://localhost:9005
tags:
- Health
security: []
Expand Down Expand Up @@ -557,7 +560,7 @@ components:
ParentGroupReqObj:
type: object
properties:
parent_group_id:
parent_group_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
Expand Down Expand Up @@ -667,7 +670,7 @@ components:
- name
- metadata
- description

ChannelUpdateTags:
type: object
properties:
Expand Down Expand Up @@ -817,7 +820,7 @@ components:
format: uuid
required: false
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

Metadata:
name: metadata
description: Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.
Expand Down Expand Up @@ -867,7 +870,7 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ChannelReqObj"

ChannelsCreateReq:
description: JSON-formatted document describing the new channels to be registered
required: true
Expand All @@ -885,15 +888,15 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ChannelUpdate"

ChannelUpdateTagsReq:
description: JSON-formated document describing the tags of channel to be updated.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ChannelUpdate"

ChannelParentGroupReq:
description: JSON-formated document describing the parent group to be set to or removed from a channel.
required: true
Expand All @@ -909,7 +912,7 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ConnectionReqSchema"

ChannelConnReq:
description: JSON-formatted document describing the new connection.
required: true
Expand Down Expand Up @@ -976,7 +979,7 @@ components:
operationId: unassignGroupsFromChannel
parameters:
chanID: $response.body#/id

ChannelsCreateRes:
description: Registered new channels.
headers:
Expand Down
15 changes: 9 additions & 6 deletions apidocs/openapi/clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9006
- url: https://localhost:9006
- url: http://localhost:9006/v1
- url: https://localhost:9006/v1

tags:
- name: Clients
Expand All @@ -28,8 +28,8 @@ tags:
- name: Roles
description: All operations involving roles for clients
externalDocs:
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
- name: Health
description: Health check operations
externalDocs:
Expand Down Expand Up @@ -472,7 +472,7 @@ paths:
- bearerAuth: []
responses:
"201":
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
"400":
description: Failed due to malformed client's ID.
"401":
Expand Down Expand Up @@ -899,6 +899,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9006
- url: https://localhost:9006
tags:
- Health
security: []
Expand Down Expand Up @@ -952,7 +955,7 @@ components:
ParentGroupReqObj:
type: object
properties:
parent_group_id:
parent_group_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
Expand Down
13 changes: 8 additions & 5 deletions apidocs/openapi/domains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9003
- url: https://localhost:9003
- url: http://localhost:9003/v1
- url: https://localhost:9003/v1

tags:
- name: Domains
Expand All @@ -28,8 +28,8 @@ tags:
- name: Roles
description: All operations involving roles for clients
externalDocs:
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
- name: Health
description: Service health check endpoint.
externalDocs:
Expand Down Expand Up @@ -242,7 +242,7 @@ paths:
- bearerAuth: []
responses:
"201":
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
"400":
description: Failed due to malformed domain's ID.
"401":
Expand Down Expand Up @@ -657,6 +657,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9003
- url: https://localhost:9003
tags:
- Health
security: []
Expand Down
15 changes: 9 additions & 6 deletions apidocs/openapi/groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9004
- url: https://localhost:9004
- url: http://localhost:9004/v1
- url: https://localhost:9004/v1

tags:
- name: Groups
Expand All @@ -28,8 +28,8 @@ tags:
- name: Roles
description: All operations involving roles for groups
externalDocs:
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
description: Find out more about roles
url: https://docs.supermq.abstractmachines.fr/
- name: Health
description: Health check operations
externalDocs:
Expand Down Expand Up @@ -516,7 +516,7 @@ paths:
- bearerAuth: []
responses:
"201":
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
$ref: "./schemas/roles.yml#/components/responses/CreateRoleRes"
"400":
description: Failed due to malformed group's ID.
"401":
Expand Down Expand Up @@ -944,6 +944,9 @@ paths:
get:
operationId: health
summary: Retrieves service health check info.
servers:
- url: http://localhost:9004
- url: https://localhost:9004
tags:
- Health
security: []
Expand Down Expand Up @@ -1192,7 +1195,7 @@ components:
ParentGroupReqObj:
type: object
properties:
group_id:
group_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
Expand Down
7 changes: 5 additions & 2 deletions apidocs/openapi/invitations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9020
- url: https://localhost:9020
- url: http://localhost:9020/v1
- url: https://localhost:9020/v1

tags:
- name: Invitations
Expand Down Expand Up @@ -201,6 +201,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9020
- url: https://localhost:9020
tags:
- health
security: []
Expand Down
7 changes: 5 additions & 2 deletions apidocs/openapi/journal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9021
- url: https://localhost:9021
- url: http://localhost:9021/v1
- url: https://localhost:9021/v1

tags:
- name: journal-log
Expand Down Expand Up @@ -108,6 +108,9 @@ paths:
/health:
get:
summary: Retrieves service health check info.
servers:
- url: http://localhost:9021
- url: https://localhost:9021
tags:
- health
security: []
Expand Down
11 changes: 7 additions & 4 deletions apidocs/openapi/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ info:
version: 0.15.1

servers:
- url: http://localhost:9002
- url: https://localhost:9002
- url: http://localhost:9002/v1
- url: https://localhost:9002/v1

tags:
- name: Users
Expand Down Expand Up @@ -666,7 +666,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"

/{domainID}/users:
get:
summary: List users assigned to domain
Expand Down Expand Up @@ -755,6 +755,9 @@ paths:
get:
operationId: health
summary: Retrieves service health check info.
servers:
- url: http://localhost:9002
- url: https://localhost:9002
tags:
- Health
security: []
Expand Down Expand Up @@ -1310,7 +1313,7 @@ components:
pattern: "^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$"
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

ClientID:
name: clientID
description: Unique client identifier.
Expand Down
6 changes: 3 additions & 3 deletions auth/api/http/keys/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestIssue(t *testing.T) {
req := testRequest{
client: client,
method: http.MethodPost,
url: fmt.Sprintf("%s/keys", ts.URL),
url: fmt.Sprintf("%s/v1/keys", ts.URL),
contentType: tc.ct,
token: tc.token,
body: strings.NewReader(tc.req),
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestRetrieve(t *testing.T) {
req := testRequest{
client: client,
method: http.MethodGet,
url: fmt.Sprintf("%s/keys/%s", ts.URL, tc.id),
url: fmt.Sprintf("%s/v1/keys/%s", ts.URL, tc.id),
token: tc.token,
}
repocall := krepo.On("Retrieve", mock.Anything, mock.Anything, mock.Anything).Return(tc.key, tc.err)
Expand Down Expand Up @@ -326,7 +326,7 @@ func TestRevoke(t *testing.T) {
req := testRequest{
client: client,
method: http.MethodDelete,
url: fmt.Sprintf("%s/keys/%s", ts.URL, tc.id),
url: fmt.Sprintf("%s/v1/keys/%s", ts.URL, tc.id),
token: tc.token,
}
repocall := krepo.On("Remove", mock.Anything, mock.Anything, mock.Anything).Return(nil)
Expand Down
Loading

0 comments on commit b83ee0f

Please sign in to comment.