Skip to content

Commit

Permalink
Merge pull request #4920 from TheThingsNetwork/feature/backport-gs-is…
Browse files Browse the repository at this point in the history
…-fixes
  • Loading branch information
htdvisser authored Nov 26, 2021
2 parents 0b26184 + 395e4a6 commit 4f3c7cd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3945,7 +3945,7 @@ Connection stats as monitored by the Gateway Server.
| `versions` | <p>`map.max_pairs`: `10`</p><p>`map.keys.string.max_len`: `36`</p><p>`map.keys.string.pattern`: `^[a-z0-9](?:[_-]?[a-z0-9]){2,}$`</p><p>`map.values.string.max_len`: `128`</p> |
| `antenna_locations` | <p>`repeated.max_items`: `8`</p> |
| `ip` | <p>`repeated.max_items`: `10`</p><p>`repeated.items.string.ip`: `true`</p> |
| `metrics` | <p>`map.max_pairs`: `10`</p><p>`map.keys.string.max_len`: `36`</p><p>`map.keys.string.pattern`: `^[a-z0-9](?:[_-]?[a-z0-9]){2,}$`</p> |
| `metrics` | <p>`map.max_pairs`: `32`</p><p>`map.keys.string.max_len`: `36`</p><p>`map.keys.string.pattern`: `^[a-z0-9](?:[_-]?[a-z0-9]){2,}$`</p> |

### <a name="ttn.lorawan.v3.GatewayStatus.MetricsEntry">Message `GatewayStatus.MetricsEntry`</a>

Expand Down
2 changes: 1 addition & 1 deletion api/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ message GatewayStatus {
// - map keys are written in snake_case
map<string,float> metrics = 6 [
(validate.rules).map = {
max_pairs: 10,
max_pairs: 32,
keys: { string: { pattern: "^[a-z0-9](?:[_-]?[a-z0-9]){2,}$", max_len: 36 } },
}
];
Expand Down
4 changes: 2 additions & 2 deletions pkg/identityserver/gateway_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ func (is *IdentityServer) listGateways(ctx context.Context, req *ttnpb.ListGatew
func (is *IdentityServer) updateGateway(ctx context.Context, req *ttnpb.UpdateGatewayRequest) (gtw *ttnpb.Gateway, err error) {
reqGtw := req.GetGateway()
if err = rights.RequireGateway(ctx, *reqGtw.GetIds(), ttnpb.RIGHT_GATEWAY_SETTINGS_BASIC); err != nil {
// Allow setting only the location field with the RIGHT_GATEWAY_LINK right.
// Allow setting the location field or the attributes field with the RIGHT_GATEWAY_LINK right.
isLink := rights.RequireGateway(ctx, *reqGtw.GetIds(), ttnpb.RIGHT_GATEWAY_LINK) == nil
if topLevel := ttnpb.TopLevelFields(req.FieldMask.GetPaths()); !isLink || len(topLevel) != 1 || topLevel[0] != "antennas" {
if !(isLink && ttnpb.HasOnlyAllowedFields(req.FieldMask.GetPaths(), "antennas", "attributes")) {
return nil, err
}
}
Expand Down
64 changes: 32 additions & 32 deletions pkg/ttnpb/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/ttnpb/gateway.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/js/generated/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -17896,7 +17896,7 @@
"validate.rules": [
{
"name": "map.max_pairs",
"value": 10
"value": 32
},
{
"name": "map.keys.string.max_len",
Expand Down

0 comments on commit 4f3c7cd

Please sign in to comment.