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-2304 - Add endpoint to verify thing channel connection #2360

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

nyagamunene
Copy link
Contributor

@nyagamunene nyagamunene commented Jul 29, 2024

What type of PR is this?

This PR adds functionality to verify the connection between a channel and a thing by providing a dedicated endpoint.

What does this PR do?

  • Implements a VerifyConnection service.
  • Adds an endpoint to utilize the VerifyConnection service.
  • Includes tests to ensure the correctness of the new functionality.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, tests have been included.

Did you document any new or modified features?

Yes, documentation has been updated to reflect the new feature.

Notes

Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyagamunene CI is failing, please fix.

@nyagamunene
Copy link
Contributor Author

@nyagamunene CI is failing, please fix.

Fixed

auth/service.go Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
auth/service.go Outdated Show resolved Hide resolved
pkg/clients/clients.go Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the gRPC API, I get response in GRPC like

{
    "connections": [],
    "status": "all_connected"
}

image

Please use postman or some other tools to test gRPC API response

things/service.go Outdated Show resolved Hide resolved
things/api/http/requests.go Outdated Show resolved Hide resolved
things/api/http/requests.go Outdated Show resolved Hide resolved
pkg/clients/clients.go Show resolved Hide resolved
pkg/clients/clients.go Outdated Show resolved Hide resolved
Connections []ConnectionStatus
}

type ConnectionStatus struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to this to export struct ?
Does it can be internal struct type connectionStatus struct ?

things/api/grpc/responses.go Outdated Show resolved Hide resolved
things/api/grpc/endpoint.go Show resolved Hide resolved
things/things.go Show resolved Hide resolved
things/api/http/responses.go Show resolved Hide resolved
things/api/grpc/endpoint.go Show resolved Hide resolved
@nyagamunene
Copy link
Contributor Author

Please check the gRPC API, I get response in GRPC like

{
    "connections": [],
    "status": "all_connected"
}

image

Please use postman or some other tools to test gRPC API response

Am able to getting a response on my end but let me confirm if its a bug
image

things/api/logging.go Show resolved Hide resolved
things/api/logging.go Show resolved Hide resolved
auth.proto Show resolved Hide resolved
things/api/grpc/responses.go Show resolved Hide resolved
things/api/logging.go Show resolved Hide resolved
Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the gRPC request with body with group_ids like below

{
    "thing_ids": ["{{thing_id}}"]
}

Getting response like

{
    "connections_status": [],
    "status": "all_connected"
}

Is it possible to add validation in gRPC requests?

auth.proto Outdated Show resolved Hide resolved
auth.proto Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
auth.proto Show resolved Hide resolved
things/api/grpc/server.go Outdated Show resolved Hide resolved
things/api/grpc/client.go Outdated Show resolved Hide resolved
things/api/grpc/client.go Outdated Show resolved Hide resolved
things/service.go Outdated Show resolved Hide resolved
arvindh123
arvindh123 previously approved these changes Aug 23, 2024
cli/things.go Outdated Show resolved Hide resolved
pkg/sdk/go/sdk.go Outdated Show resolved Hide resolved
pkg/sdk/go/sdk.go Outdated Show resolved Hide resolved
pkg/sdk/go/things_test.go Show resolved Hide resolved
things/api/http/clients.go Outdated Show resolved Hide resolved
things/api/logging.go Outdated Show resolved Hide resolved
things/api/logging.go Outdated Show resolved Hide resolved
cli/things.go Outdated Show resolved Hide resolved
pkg/apiutil/errors.go Outdated Show resolved Hide resolved
pkg/apiutil/errors.go Outdated Show resolved Hide resolved
pkg/sdk/go/channels.go Outdated Show resolved Hide resolved
pkg/sdk/go/sdk.go Outdated Show resolved Hide resolved
pkg/sdk/go/sdk.go Outdated Show resolved Hide resolved
pkg/sdk/go/things.go Outdated Show resolved Hide resolved
pkg/sdk/go/things.go Outdated Show resolved Hide resolved
JeffMboya
JeffMboya previously approved these changes Aug 23, 2024
JeffMboya
JeffMboya previously approved these changes Aug 26, 2024
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants