-
Notifications
You must be signed in to change notification settings - Fork 0
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
Upgrade dependencies #270
Upgrade dependencies #270
Conversation
WalkthroughThe recent updates enhance the project's dependency management and refine the handling of OAuth clients. Key changes include version upgrades for various libraries, consolidation of OAuth client types for improved clarity, and aesthetic improvements in Protobuf definitions and API schemas. These modifications streamline the codebase, ensure compatibility with the latest tools and practices, and contribute to better maintainability and performance. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Service
participant OAuthClient
Client->>Service: Request resource access
Service->>OAuthClient: Validate OAuth client
OAuthClient-->>Service: Return validation result
Service-->>Client: Provide resource or error message
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration 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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (20)
go.sum
is excluded by!**/*.sum
pb/clear_cache.pb.go
is excluded by!**/*.pb.go
pb/create_resource.pb.go
is excluded by!**/*.pb.go
pb/delete_resource.pb.go
is excluded by!**/*.pb.go
pb/disown_device.pb.go
is excluded by!**/*.pb.go
pb/get_configuration.pb.go
is excluded by!**/*.pb.go
pb/get_device.pb.go
is excluded by!**/*.pb.go
pb/get_device_resource_links.pb.go
is excluded by!**/*.pb.go
pb/get_devices.pb.go
is excluded by!**/*.pb.go
pb/get_identity_certificate.pb.go
is excluded by!**/*.pb.go
pb/get_json_web_keys.pb.go
is excluded by!**/*.pb.go
pb/get_resource.pb.go
is excluded by!**/*.pb.go
pb/initialize.pb.go
is excluded by!**/*.pb.go
pb/offboard_device.pb.go
is excluded by!**/*.pb.go
pb/onboard_device.pb.go
is excluded by!**/*.pb.go
pb/own_device.pb.go
is excluded by!**/*.pb.go
pb/reset.pb.go
is excluded by!**/*.pb.go
pb/service.pb.gw.go
is excluded by!**/*.pb.gw.go
pb/service_grpc.pb.go
is excluded by!**/*.pb.go
pb/update_resource.pb.go
is excluded by!**/*.pb.go
Files selected for processing (10)
- dependency/googleapis (1 hunks)
- go.mod (7 hunks)
- pb/get_configuration.go (2 hunks)
- pb/get_configuration.proto (1 hunks)
- pb/service.swagger.json (17 hunks)
- service/config/remoteProvisioning/config.go (2 hunks)
- service/grpc/device.go (3 hunks)
- service/grpc/getDevices.go (3 hunks)
- service/grpc/getResource.go (3 hunks)
- test/test.go (1 hunks)
Files skipped from review due to trivial changes (2)
- go.mod
- pb/get_configuration.proto
Additional comments not posted (24)
dependency/googleapis (1)
1-1
: Submodule update approved.The submodule
github.com/googleapis/googleapis
has been updated to commitd4acb64370d333024a167551e7da854506109ba2
.service/config/remoteProvisioning/config.go (2)
23-23
: Updated import statement approved.The import statement has been updated to include
grpcgwPb
fromgithub.com/plgd-dev/hub/v2/grpc-gateway/pb
.
34-36
: Approved updated OAuth client fields and new field addition.The fields
WebOauthClient
andDeviceOauthClient
have been updated to usegrpcgwPb.OAuthClient
, and a new fieldM2MOauthClient
has been added.Ensure that the new field
M2MOauthClient
is correctly used throughout the codebase.service/grpc/getResource.go (2)
22-22
: Approved import statement update.The import statement has been updated to include
slices
.
50-50
: Approved change to useslices.Contains
.The
getResourceAndRefreshCache
function now usesslices.Contains
instead ofstrings.Contains
for checking iflink.ResourceTypes
containsplgdDevice.ResourceType
.pb/get_configuration.go (2)
23-23
: LGTM! Import changes are appropriate.The import of
github.com/plgd-dev/hub/v2/grpc-gateway/pb
is necessary to support the updated function signature and client type changes.
106-109
: LGTM! Function signature update enhances flexibility.The function
ValidateWebOAuthClient
now accepts a parameter of type*pb.OAuthClient
instead of*pb.WebOAuthClient
, allowing broader validation capabilities.service/grpc/device.go (1)
187-189
: LGTM! Improved slice operation.The method
getResourceLinkAndCheckAccess
now usesslices.Contains
instead ofstrings.Contains
for checking ifResourceTypes
includes a specific resource type, which is more appropriate for slice operations.Ensure that the usage of
slices
is consistent throughout the codebase.Verification successful
Consistent usage of
slices.Contains
across the codebase.The
slices.Contains
function is used appropriately in multiple files for slice operations. The usage is consistent and aligns with the intended purpose of checking for the presence of an item in a slice.
service/grpc/getDevices.go
service/grpc/getResource.go
service/grpc/device.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `slices` in the codebase. # Test: Search for the usage of `slices`. Expect: Consistent usage across the codebase. rg --type go 'slices\.'Length of output: 452
test/test.go (2)
216-219
: LGTM! Updated OAuth client structures.The function
NewRemoteProvisioningConfig
now usesgrpcgwPb.OAuthClient
forWebOauthClient
, aligning with the updated implementation.
Line range hint
223-227
:
LGTM! Updated OAuth client structures.The function
NewRemoteProvisioningConfig
now usesgrpcgwPb.OAuthClient
forDeviceOauthClient
, aligning with the updated implementation.service/grpc/getDevices.go (1)
150-155
: Approved change to use standard libraryslices
packageThe replacement of
pkgStrings
with the standard libraryslices
package for checking the presence of resource types improves code clarity and maintainability. The logic remains intact.pb/service.swagger.json (13)
356-356
: Approved change to useClientApplicationOnboardDeviceBody
schemaThe reference to the
ClientApplicationOnboardDeviceBody
schema improves modularity and reusability.
401-401
: Approved change to useClientApplicationOwnDeviceBody
schemaThe reference to the
ClientApplicationOwnDeviceBody
schema improves modularity and reusability.
453-453
: Approved change to useClientApplicationFinishOwnDeviceBody
schemaThe reference to the
ClientApplicationFinishOwnDeviceBody
schema improves modularity and reusability.
804-804
: Approved change to useClientApplicationFinishInitializeBody
schemaThe reference to the
ClientApplicationFinishInitializeBody
schema improves modularity and reusability.
858-867
: Approved addition ofClientApplicationFinishInitializeBody
schemaThe new
ClientApplicationFinishInitializeBody
schema definition consolidates properties related to finishing the initialization process, enhancing modularity and reusability.
868-877
: Approved addition ofClientApplicationFinishOwnDeviceBody
schemaThe new
ClientApplicationFinishOwnDeviceBody
schema definition consolidates properties related to finishing the device ownership process, enhancing modularity and reusability.
878-902
: Approved addition ofClientApplicationOnboardDeviceBody
schemaThe new
ClientApplicationOnboardDeviceBody
schema definition consolidates properties related to onboarding a device, enhancing modularity and reusability.
903-912
: Approved addition ofClientApplicationOwnDeviceBody
schemaThe new
ClientApplicationOwnDeviceBody
schema definition consolidates properties related to owning a device, enhancing modularity and reusability.
1310-1342
: Approved addition ofpbOAuthClient
schemaThe new
pbOAuthClient
schema definition consolidates OAuth client properties, enhancing modularity and reusability.
1233-1233
: Approved change to useservicepbUIConfiguration
schemaThe reference to the
servicepbUIConfiguration
schema aligns with the updated service architecture and enhances modularity.
1405-1415
: Approved change to usepbOAuthClient
schemaThe reference to the
pbOAuthClient
schema consolidates OAuth client properties, enhancing modularity and reusability.
1102-1107
: Approved addition oflocalEndpoints
propertyThe new
localEndpoints
property expands the API's ability to convey more detailed information about device states and interactions.
1463-1467
: Approved addition ofresourceTypes
propertyThe new
resourceTypes
property expands the API's ability to convey more detailed information about device resource changes.Also applies to: 1496-1500, 1529-1533, 1602-1606
Submodule: github.com/googleapis/googleapis d4acb64370d333024a167551e7da854506109ba2 Direct: github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 github.com/lestrrat-go/jwx/v2 v2.1.1 github.com/plgd-dev/device/v2 v2.5.3-0.20240805143631-9644c22de141 github.com/plgd-dev/go-coap/v3 v3.3.5-0.20240805141850-12858340a4f3 github.com/plgd-dev/hub/v2 v2.22.1-0.20240806063421-ca707fac297c google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 Indirect: github.com/go-co-op/gocron/v2 v2.11.0 github.com/lestrrat-go/httprc v1.0.6 github.com/pion/transport/v3 v3.0.7 github.com/tidwall/gjson v1.17.3 github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.53.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 golang.org/x/crypto v0.25.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 golang.org/x/mod v0.19.0 golang.org/x/net v0.27.0 golang.org/x/oauth2 v0.22.0 golang.org/x/sync v0.8.0 golang.org/x/sys v0.23.0 golang.org/x/term v0.22.0 golang.org/x/tools v0.23.0 google.golang.org/genproto/googleapis/api v0.0.0-20240805194559-2c9e96a0b5d4 google.golang.org/genproto/googleapis/rpc v0.0.0-20240805194559-2c9e96a0b5d4
2a9b38e
to
d2f113f
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (20)
go.sum
is excluded by!**/*.sum
pb/clear_cache.pb.go
is excluded by!**/*.pb.go
pb/create_resource.pb.go
is excluded by!**/*.pb.go
pb/delete_resource.pb.go
is excluded by!**/*.pb.go
pb/disown_device.pb.go
is excluded by!**/*.pb.go
pb/get_configuration.pb.go
is excluded by!**/*.pb.go
pb/get_device.pb.go
is excluded by!**/*.pb.go
pb/get_device_resource_links.pb.go
is excluded by!**/*.pb.go
pb/get_devices.pb.go
is excluded by!**/*.pb.go
pb/get_identity_certificate.pb.go
is excluded by!**/*.pb.go
pb/get_json_web_keys.pb.go
is excluded by!**/*.pb.go
pb/get_resource.pb.go
is excluded by!**/*.pb.go
pb/initialize.pb.go
is excluded by!**/*.pb.go
pb/offboard_device.pb.go
is excluded by!**/*.pb.go
pb/onboard_device.pb.go
is excluded by!**/*.pb.go
pb/own_device.pb.go
is excluded by!**/*.pb.go
pb/reset.pb.go
is excluded by!**/*.pb.go
pb/service.pb.gw.go
is excluded by!**/*.pb.gw.go
pb/service_grpc.pb.go
is excluded by!**/*.pb.go
pb/update_resource.pb.go
is excluded by!**/*.pb.go
Files selected for processing (11)
- dependency/googleapis (1 hunks)
- go.mod (7 hunks)
- pb/get_configuration.go (2 hunks)
- pb/get_configuration.proto (1 hunks)
- pb/service.swagger.json (17 hunks)
- service/config/remoteProvisioning/config.go (2 hunks)
- service/grpc/device.go (3 hunks)
- service/grpc/getDevices.go (3 hunks)
- service/grpc/getResource.go (3 hunks)
- service/service_test.go (2 hunks)
- test/test.go (1 hunks)
Files skipped from review due to trivial changes (2)
- go.mod
- test/test.go
Files skipped from review as they are similar to previous changes (7)
- dependency/googleapis
- pb/get_configuration.go
- pb/get_configuration.proto
- service/config/remoteProvisioning/config.go
- service/grpc/device.go
- service/grpc/getDevices.go
- service/grpc/getResource.go
Additional comments not posted (13)
service/service_test.go (2)
23-23
: Import statement addition is appropriate.The
time
package is necessary for thetime.Sleep
function.
36-38
: Adding a delay to improve test reliability is a good practice.The
time.Sleep(time.Second)
call ensures the service has sufficient time to start up before the test proceeds.pb/service.swagger.json (11)
356-356
: Schema reference change improves maintainability.The schema reference for the request body in the
/api/v1/devices/{deviceId}/onboard
endpoint has been updated toClientApplicationOnboardDeviceBody
, reducing redundancy.
401-401
: Schema reference change improves maintainability.The schema reference for the request body in the
/api/v1/devices/{deviceId}/own
endpoint has been updated toClientApplicationOwnDeviceBody
, reducing redundancy.
453-453
: Schema reference change improves maintainability.The schema reference for the request body in the
/api/v1/devices/{deviceId}/own/{state}
endpoint has been updated toClientApplicationFinishOwnDeviceBody
, reducing redundancy.
804-804
: Schema reference change improves maintainability.The schema reference for the request body in the
/api/v1/initialize/{state}
endpoint has been updated toClientApplicationFinishInitializeBody
, reducing redundancy.
858-867
: New definition enhances maintainability and clarity.The new
ClientApplicationFinishInitializeBody
definition consolidates properties previously scattered across different definitions.
868-877
: New definition enhances maintainability and clarity.The new
ClientApplicationFinishOwnDeviceBody
definition consolidates properties previously scattered across different definitions.
878-902
: New definition enhances maintainability and clarity.The new
ClientApplicationOnboardDeviceBody
definition consolidates properties previously scattered across different definitions.
903-912
: New definition enhances maintainability and clarity.The new
ClientApplicationOwnDeviceBody
definition consolidates properties previously scattered across different definitions.
1310-1342
: New definition enhances maintainability and clarity.The new
pbOAuthClient
definition consolidates properties previously scattered across different definitions.
1101-1107
: Property addition expands API capability.The new
localEndpoints
property in thepbConnection
definition expands the API’s ability to convey more detailed information about device states and interactions.
1463-1467
: Property addition expands API capability.The new
resourceTypes
property in multiple definitions expands the API’s ability to convey more detailed information about device states and interactions.Also applies to: 1496-1500, 1529-1533, 1602-1606
Quality Gate passedIssues Measures |
Submodule:
github.com/googleapis/googleapis d4acb64370d333024a167551e7da854506109ba2
Direct:
github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0
github.com/lestrrat-go/jwx/v2 v2.1.1
github.com/plgd-dev/device/v2 v2.5.3-0.20240805143631-9644c22de141 github.com/plgd-dev/go-coap/v3 v3.3.5-0.20240805141850-12858340a4f3 github.com/plgd-dev/hub/v2 v2.22.1-0.20240806063421-ca707fac297c google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
Indirect:
github.com/go-co-op/gocron/v2 v2.11.0
github.com/lestrrat-go/httprc v1.0.6
github.com/pion/transport/v3 v3.0.7
github.com/tidwall/gjson v1.17.3
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.53.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 golang.org/x/crypto v0.25.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 golang.org/x/mod v0.19.0
golang.org/x/net v0.27.0
golang.org/x/oauth2 v0.22.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.23.0
golang.org/x/term v0.22.0
golang.org/x/tools v0.23.0
google.golang.org/genproto/googleapis/api v0.0.0-20240805194559-2c9e96a0b5d4 google.golang.org/genproto/googleapis/rpc v0.0.0-20240805194559-2c9e96a0b5d4
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores