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

Update Packet Broker IAM API #6688

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ require (
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
go.packetbroker.org/api/iam v1.8.1
go.packetbroker.org/api/iam/v2 v2.8.1
go.packetbroker.org/api/mapping/v2 v2.2.1
go.packetbroker.org/api/iam/v2 v2.9.0
go.packetbroker.org/api/mapping/v2 v2.3.0
go.packetbroker.org/api/routing v1.9.1
go.packetbroker.org/api/v3 v3.17.0
go.thethings.network/lorawan-application-payload v0.0.0-20220125153912-1198ff1e403e
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,10 @@ go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lI
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.packetbroker.org/api/iam v1.8.1 h1:x4p0kxfzOQ0dhxQUCAmFqXsBMB6BWpVTnPvtFzDgzd4=
go.packetbroker.org/api/iam v1.8.1/go.mod h1:MRgGTxJwPM7spA3SB6qe6ARvbqBkUEExLe/MFb6Ol4Y=
go.packetbroker.org/api/iam/v2 v2.8.1 h1:0uxBZM3fGKOcc+GO7BSxEJXB1HdqEWE+b8uTvS3wESQ=
go.packetbroker.org/api/iam/v2 v2.8.1/go.mod h1:Z2uiw0kwDHBwRgdfYfZsg4GQEpI0JfWOMOJdJo81jGU=
go.packetbroker.org/api/mapping/v2 v2.2.1 h1:WqDB6M0rGHkC5Bf9Uu1WeT6vqZ9j0jhrMOYGhjCypEU=
go.packetbroker.org/api/mapping/v2 v2.2.1/go.mod h1:SmnnK2mwsUeS09xeKXrA96VUZrd8hd1lPvrR4jAboiM=
go.packetbroker.org/api/iam/v2 v2.9.0 h1:abBdj56opWeWFXXbLnCCf5Ao1bht+bPcWZZlPYLwhXY=
go.packetbroker.org/api/iam/v2 v2.9.0/go.mod h1:Z2uiw0kwDHBwRgdfYfZsg4GQEpI0JfWOMOJdJo81jGU=
go.packetbroker.org/api/mapping/v2 v2.3.0 h1:aGLF21uGcDssucTX3TMmEvrtWl29+mI/pdTFnPG2+zs=
go.packetbroker.org/api/mapping/v2 v2.3.0/go.mod h1:SmnnK2mwsUeS09xeKXrA96VUZrd8hd1lPvrR4jAboiM=
go.packetbroker.org/api/routing v1.9.1 h1:HhIIYH75njzPoDSFIFgqV6no3/h+x8HGIYcLHm2V86g=
go.packetbroker.org/api/routing v1.9.1/go.mod h1:om1s5jnhezPlpsemK8uJonH9YzRoqvIp0mCBTtfpLc0=
go.packetbroker.org/api/v3 v3.17.0 h1:7yHGYrKt457JwD/nAN8ouXD8B3NrSpbDIwZCKL3l6vc=
Expand Down
2 changes: 1 addition & 1 deletion pkg/packetbrokeragent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type RegistrationInfo struct {
Listed bool
}

// PacketBrokerClusterBuilder builds a Packet Broker Cluster ID from a The Things Stack Cluster ID.
// PacketBrokerClusterIDBuilder builds a Packet Broker Cluster ID from a The Things Stack Cluster ID.
type PacketBrokerClusterIDBuilder func(clusterID string) (string, error)

func literalClusterID(clusterID string) (string, error) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/packetbrokeragent/grpc_pba.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ func (s *pbaServer) ListNetworks(ctx context.Context, req *ttnpb.ListPacketBroke
return res.GetNetworks(), res.GetTotal(), err
}
res, err := iampbv2.NewCatalogClient(s.iamConn).ListNetworks(ctx, &iampbv2.ListNetworksRequest{
NetId: s.netID.MarshalNumber(),
TenantId: s.tenantIDExtractor(ctx),
Offset: (page - 1) * req.Limit,
Limit: req.Limit,
TenantIdContains: req.TenantIdContains,
Expand All @@ -576,6 +578,8 @@ func (s *pbaServer) ListHomeNetworks(ctx context.Context, req *ttnpb.ListPacketB
}
return s.listNetworks(ctx, func() ([]*packetbroker.NetworkOrTenant, uint32, error) {
res, err := iampbv2.NewCatalogClient(s.iamConn).ListHomeNetworks(ctx, &iampbv2.ListNetworksRequest{
NetId: s.netID.MarshalNumber(),
TenantId: s.tenantIDExtractor(ctx),
Offset: (page - 1) * req.Limit,
Limit: req.Limit,
TenantIdContains: req.TenantIdContains,
Expand Down
4 changes: 2 additions & 2 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ require (
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.packetbroker.org/api/iam v1.8.1 // indirect
go.packetbroker.org/api/iam/v2 v2.8.1 // indirect
go.packetbroker.org/api/mapping/v2 v2.2.1 // indirect
go.packetbroker.org/api/iam/v2 v2.9.0 // indirect
go.packetbroker.org/api/mapping/v2 v2.3.0 // indirect
go.packetbroker.org/api/routing v1.9.1 // indirect
go.packetbroker.org/api/v3 v3.17.0 // indirect
go.thethings.network/lorawan-application-payload v0.0.0-20220125153912-1198ff1e403e // indirect
Expand Down
8 changes: 4 additions & 4 deletions tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,10 @@ go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lI
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.packetbroker.org/api/iam v1.8.1 h1:x4p0kxfzOQ0dhxQUCAmFqXsBMB6BWpVTnPvtFzDgzd4=
go.packetbroker.org/api/iam v1.8.1/go.mod h1:MRgGTxJwPM7spA3SB6qe6ARvbqBkUEExLe/MFb6Ol4Y=
go.packetbroker.org/api/iam/v2 v2.8.1 h1:0uxBZM3fGKOcc+GO7BSxEJXB1HdqEWE+b8uTvS3wESQ=
go.packetbroker.org/api/iam/v2 v2.8.1/go.mod h1:Z2uiw0kwDHBwRgdfYfZsg4GQEpI0JfWOMOJdJo81jGU=
go.packetbroker.org/api/mapping/v2 v2.2.1 h1:WqDB6M0rGHkC5Bf9Uu1WeT6vqZ9j0jhrMOYGhjCypEU=
go.packetbroker.org/api/mapping/v2 v2.2.1/go.mod h1:SmnnK2mwsUeS09xeKXrA96VUZrd8hd1lPvrR4jAboiM=
go.packetbroker.org/api/iam/v2 v2.9.0 h1:abBdj56opWeWFXXbLnCCf5Ao1bht+bPcWZZlPYLwhXY=
go.packetbroker.org/api/iam/v2 v2.9.0/go.mod h1:Z2uiw0kwDHBwRgdfYfZsg4GQEpI0JfWOMOJdJo81jGU=
go.packetbroker.org/api/mapping/v2 v2.3.0 h1:aGLF21uGcDssucTX3TMmEvrtWl29+mI/pdTFnPG2+zs=
go.packetbroker.org/api/mapping/v2 v2.3.0/go.mod h1:SmnnK2mwsUeS09xeKXrA96VUZrd8hd1lPvrR4jAboiM=
go.packetbroker.org/api/routing v1.9.1 h1:HhIIYH75njzPoDSFIFgqV6no3/h+x8HGIYcLHm2V86g=
go.packetbroker.org/api/routing v1.9.1/go.mod h1:om1s5jnhezPlpsemK8uJonH9YzRoqvIp0mCBTtfpLc0=
go.packetbroker.org/api/v3 v3.17.0 h1:7yHGYrKt457JwD/nAN8ouXD8B3NrSpbDIwZCKL3l6vc=
Expand Down
Loading