-
Notifications
You must be signed in to change notification settings - Fork 673
SMQ-3137 - Proxy CoAP using mgate #2222
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
Conversation
|
@felixgateru Please resolve conflicts. |
01c3593 to
bedc5b3
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
bedc5b3 to
d7da4fa
Compare
e84d707 to
c9dcaaa
Compare
docker/.env
Outdated
| SMQ_COAP_ADAPTER_PORT=5683 | ||
| SMQ_COAP_ADAPTER_SERVER_CERT= | ||
| SMQ_COAP_ADAPTER_SERVER_KEY= | ||
| SMQ_COAP_ADAPTER_SERVER_CA_FILE= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- DTLS certs are not mapped inside the container
- DTLS certs are not correctly inputed
SMQ_COAP_ADAPTER_SERVER_CERT_FILE=""
- On
docker/ssl/Makefile, lets add this so that we can generate CoAP server certs
COAP_GRPC_SERVER_CONF_FILE_NAME=coap-server.conf
COAP_GRPC_SERVER_CN=coap
COAP_GRPC_SERVER_CRT_FILE_NAME=coap-server
coap_grpc_certs:
$(call gen_grpc_cert,$(COAP_GRPC_SERVER_CRT_FILE_NAME),$(COAP_GRPC_SERVER_CN))
- We should consider an env variable that enables
COAP_DTLSsame asGRPC_MTLS
c9dcaaa to
1783a8d
Compare
rodneyosodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also consider updating the docs repo for this new feature
rodneyosodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
26f3e6b to
737dc19
Compare
737dc19 to
0a2dce6
Compare
| } | ||
|
|
||
| clientID := authnRes.GetId() | ||
| authzRes, err := svc.channels.Authorize(ctx, &grpcChannelsV1.AuthzReq{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to remove the channel authorization while unsubscribing ?
Lines 116 to 128 in 69b849c
| authzRes, err := svc.channels.Authorize(ctx, &grpcChannelsV1.AuthzReq{ | |
| DomainId: domainID, | |
| ClientId: authnRes.GetId(), | |
| ClientType: policies.ClientType, | |
| Type: uint32(connections.Subscribe), | |
| ChannelId: chanID, | |
| }) | |
| if err != nil { | |
| return errors.Wrap(svcerr.ErrAuthorization, err) | |
| } | |
| if !authzRes.Authorized { | |
| return svcerr.ErrAuthorization | |
| } |
arvindh123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we
5a2c870 to
549f259
Compare
d3865c3 to
2fc1dc7
Compare
|
@dborovcanin, please review and let's merge |
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
2fc1dc7 to
031f3fb
Compare
coap/handler.go
Outdated
| LogInfoSubscribed = "subscribed with client_id %s to topics %s" | ||
| LogInfoConnected = "connected with client_id %s" | ||
| LogInfoDisconnected = "disconnected client_id %s and username %s" | ||
| LogInfoPublished = "published with client_id %s to the topic %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export unless necessary. Also, add fmt suffix to indicate this is format. Like subscribedInfoFmt, connectedInfoFmt...
docker/ssl/.gitignore
Outdated
| *conf | ||
| client.crt | ||
| client.key | ||
| *coap-server* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
031f3fb to
fcab001
Compare
What type of PR is this?
This is a feature because it updates the coap adapter to use mgate to procy plain udp traffic and dtls traffic.
What does this do?
This pr updates the coap adapter to use mgate for proxtying
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
No
Did you document any new/modified feature?
No
Notes