Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MG-2302 - Fix bootstrap config with multiple channels #2377

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
53d2287
Add verify connections endpoint and service layer
nyagamunene Jul 29, 2024
bc5386d
fix failing ci
nyagamunene Jul 29, 2024
3d768d5
Add sdk and cli support
nyagamunene Jul 29, 2024
13a0546
Fix lint errors
nyagamunene Jul 29, 2024
a74a17f
Fix lint errors
nyagamunene Jul 29, 2024
f6ec532
Add verify connections api documentation
nyagamunene Jul 30, 2024
df19873
Change from get to post method
nyagamunene Jul 30, 2024
c5e0b7c
Update sdk
nyagamunene Jul 30, 2024
db2b6c8
Update endpoint test
nyagamunene Jul 30, 2024
c8a2e38
convert verify connections to a grpc endpoint
nyagamunene Aug 5, 2024
1632e84
Add test cases and fix grpc endpoint
nyagamunene Aug 6, 2024
e9b8054
Fix golangci-lint
nyagamunene Aug 6, 2024
17afe82
Update protoc version
nyagamunene Aug 6, 2024
697f523
Fix metric.go
nyagamunene Aug 6, 2024
5c1571a
Fix naming of the slice
nyagamunene Aug 8, 2024
8c3068b
Fix failing ci
nyagamunene Aug 8, 2024
e3810a9
Move verify connections endpoint from auth to things
nyagamunene Aug 9, 2024
a551b7c
Fix failing ci
nyagamunene Aug 9, 2024
9bca953
Fix failing ci
nyagamunene Aug 9, 2024
b82b1ef
Fix failing tests
nyagamunene Aug 9, 2024
62f3c0e
Fix failing endpoint tests
nyagamunene Aug 9, 2024
c42183e
Fix failing endpoint tests
nyagamunene Aug 10, 2024
77764a4
Change port for the test
nyagamunene Aug 10, 2024
8dcba14
Add main test
nyagamunene Aug 10, 2024
f857152
Rename thingauthclient
nyagamunene Aug 11, 2024
483b469
Refactor verify connections to use go routines
nyagamunene Aug 11, 2024
172a0e5
Address comments
nyagamunene Aug 12, 2024
08f555c
fix failing ci
nyagamunene Aug 12, 2024
1076491
fix failing ci
nyagamunene Aug 12, 2024
d95e46e
fix failing linter
nyagamunene Aug 12, 2024
757f040
Address comments
nyagamunene Aug 12, 2024
7231205
Fix failing linter
nyagamunene Aug 12, 2024
869d727
Address comments
nyagamunene Aug 15, 2024
64465e5
Fix naming of fields
nyagamunene Aug 16, 2024
c33a429
Add verification for verifyconnections
nyagamunene Aug 21, 2024
af0b5a2
Fix schemathesis test
nyagamunene Aug 21, 2024
5d7351d
Change status to string
nyagamunene Aug 23, 2024
98d4b99
Remove index
nyagamunene Aug 23, 2024
b10d0fe
Address naming of variables
nyagamunene Aug 23, 2024
748832c
Rename test
nyagamunene Aug 26, 2024
e36917d
Add connections struct
nyagamunene Aug 26, 2024
d39faf7
Fix ci
nyagamunene Aug 26, 2024
366c10e
Add retrieve channel by id method and its tests
nyagamunene Aug 7, 2024
f858468
Fix failing tests
nyagamunene Aug 7, 2024
a157db6
Add authzclient to bootstrap
nyagamunene Aug 11, 2024
566a5b7
Fix bootstrap main.go
nyagamunene Aug 11, 2024
24e40f6
Fix bootstrap service formating
nyagamunene Aug 11, 2024
4122029
Fix failing ci
nyagamunene Aug 11, 2024
0c08ec8
Fix failing ci
nyagamunene Aug 11, 2024
a4397f2
Fix failing ci
nyagamunene Aug 11, 2024
a0d4d91
Rename thingauthclient
nyagamunene Aug 11, 2024
3ff6161
Rebase with MG-2304
nyagamunene Aug 15, 2024
3f1184c
Rename from group to channel
nyagamunene Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/openapi/http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ paths:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
Expand Down
1 change: 1 addition & 0 deletions api/openapi/readers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ paths:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
Expand Down
104 changes: 104 additions & 0 deletions api/openapi/things.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,35 @@ paths:
"500":
$ref: "#/components/responses/ServiceError"

/things/verify-connections:
post:
operationId: verifyConnections
summary: Verify Connections
description: |
Verify the connections between a list of channels and things, and provide
a list showing which channels and things are connected and which are disconnected.
tags:
- Things
requestBody:
$ref: "#/components/requestBodies/VerifyConnectionsReq"
security:
- bearerAuth: []
responses:
"200":
$ref: "#/components/responses/VerifyConnectionsPageRes"
"400":
description: Failed due to malformed JSON.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"415":
description: Missing or invalid content type.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"

/channels/{chanID}/things:
get:
operationId: listThingsInaChannel
Expand Down Expand Up @@ -967,6 +996,7 @@ paths:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
Expand Down Expand Up @@ -1066,6 +1096,35 @@ components:
- user_ids
- relation

VerifyReqObj:
type: object
properties:
things_id:
type: array
minItems: 0
items:
type: string
description: things IDs
example:
[
"bb7edb32-2eac-4aad-aebe-ed96fe073879",
"bb7edb32-2eac-4aad-aebe-ed96fe073879",
]
channels_id:
type: array
minItems: 0
items:
type: string
description: channels IDs
example:
[
"cb7edb32-2eac-4aad-aebe-ed96fe073879",
"cb7edb32-2eac-4aad-aebe-ed96fe073879",
]
required:
- things_id
- channels_id

AssignReqObj:
type: object
properties:
Expand Down Expand Up @@ -1367,6 +1426,36 @@ components:
- total
- offset

VerifyConnectionsPage:
type: object
properties:
status:
type: string
example: all_connected
description: All things and channels are connected.
connection_status:
type: array
items:
type: object
properties:
things_id:
type: string
example: "bb7edb32-2eac-4aad-aebe-ed96fe073879"
channels_id:
type: string
example: "cb7edb32-2eac-4aad-aebe-ed96fe073879"
status:
type: string
example: "connected"
required:
- things_id
- channels_id
- status
description: Array of things and channels connection statuses
required:
- status
- connection_status

ChannelsPage:
type: object
properties:
Expand Down Expand Up @@ -1738,6 +1827,14 @@ components:
schema:
$ref: "#/components/schemas/PolicyReqObj"

VerifyConnectionsReq:
description: JSON-formated document listing connected and disconnected things and channels.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyReqObj"

AssignReq:
description: JSON-formated document describing the policy related to assigning members to a channel
required: true
Expand Down Expand Up @@ -1889,6 +1986,13 @@ components:
schema:
$ref: "#/components/schemas/ThingsPage"

VerifyConnectionsPageRes:
description: Verified connection between channels and things.
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyConnectionsPage"

ChannelCreateRes:
description: Registered new channel.
headers:
Expand Down
6 changes: 4 additions & 2 deletions api/openapi/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,13 @@ paths:
"500":
$ref: "#/components/responses/ServiceError"

/users/search:
/users/search:
get:
operationId: searchUsers
summary: Search users
description: |
Search users by name and identity.
Search users by name and ID when logged in as a normal user.
As a superadmin, search by name, identity, and ID.
tags:
- Users
parameters:
Expand Down Expand Up @@ -1062,6 +1063,7 @@ paths:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
Expand Down
Loading
Loading