Skip to content

Commit

Permalink
style: run buf format to make formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Jul 16, 2024
1 parent cec959f commit bb96aa2
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 96 deletions.
30 changes: 15 additions & 15 deletions openfga/v1/authzmodel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ message AuthorizationModel {
string id = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[ABCDEFGHJKMNPQRSTVWXYZ0-9]{26}$",
pattern: "^[ABCDEFGHJKMNPQRSTVWXYZ0-9]{26}$"
ignore_empty: false
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"01G5JAVJ41T49E9TT3SKVS7X1J\""}
Expand All @@ -19,7 +19,7 @@ message AuthorizationModel {
string schema_version = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[1-9].[1-9]$",
pattern: "^[1-9].[1-9]$"
ignore_empty: false
},
json_name = "schema_version"
Expand All @@ -35,7 +35,7 @@ message AuthorizationModel {
json_name = "conditions",
(validate.rules).map.max_pairs = 25,
(validate.rules).map.keys.string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: false
}
];
Expand All @@ -44,7 +44,7 @@ message AuthorizationModel {
message TypeDefinition {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -64,7 +64,7 @@ message TypeDefinition {

message Relation {
string name = 1 [(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: false
}];

Expand All @@ -84,7 +84,7 @@ message Metadata {
map<string, RelationMetadata> relations = 1;

string module = 2 [(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
}];

Expand All @@ -93,7 +93,7 @@ message Metadata {

message SourceInfo {
string file = 1 [(validate.rules).string = {
pattern: "^[a-zA-Z0-9_\\-\\/]{1,100}\\.fga$",
pattern: "^[a-zA-Z0-9_\\-\\/]{1,100}\\.fga$"
ignore_empty: true
}];
}
Expand All @@ -102,7 +102,7 @@ message RelationMetadata {
repeated RelationReference directly_related_user_types = 1 [json_name = "directly_related_user_types"];

string module = 2 [(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
}];

Expand All @@ -113,7 +113,7 @@ message RelationMetadata {
message RelationReference {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -123,7 +123,7 @@ message RelationReference {
oneof relation_or_wildcard {
string relation = 2 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"member\""}
Expand All @@ -134,7 +134,7 @@ message RelationReference {

// The name of a condition that is enforced over the allowed relation.
string condition = 4 [(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
}];
}
Expand Down Expand Up @@ -181,7 +181,7 @@ message ComputedUserset {
string relation = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
max_bytes: 50,
max_bytes: 50
ignore_empty: false
}
];
Expand All @@ -204,7 +204,7 @@ message Condition {
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: false
}
];
Expand All @@ -213,7 +213,7 @@ message Condition {
string expression = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
max_bytes: 512,
max_bytes: 512
ignore_empty: false
}
];
Expand All @@ -229,7 +229,7 @@ message Condition {

message ConditionMetadata {
string module = 1 [(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
}];

Expand Down
28 changes: 14 additions & 14 deletions openfga/v1/openapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import "protoc-gen-openapiv2/options/annotations.proto";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "OpenFGA";
description: "A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.";
version: "1.x";
title: "OpenFGA"
description: "A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar."
version: "1.x"
contact: {
name: "OpenFGA";
email: "[email protected]";
url: "https://openfga.dev";
};
name: "OpenFGA"
email: "[email protected]"
url: "https://openfga.dev"
}
license: {
name: "Apache-2.0";
url: "https://github.com/openfga/openfga/blob/main/LICENSE";
};
};
consumes: "application/json";
produces: "application/json";
schemes: HTTPS;
name: "Apache-2.0"
url: "https://github.com/openfga/openfga/blob/main/LICENSE"
}
}
consumes: "application/json"
produces: "application/json"
schemes: HTTPS
responses: {
key: "400"
value: {
Expand Down
42 changes: 21 additions & 21 deletions openfga/v1/openfga.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "validate/validate.proto";
message Object {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -25,7 +25,7 @@ message Object {

string id = 2 [
(validate.rules).string = {
pattern: "[^#:\\s]+$",
pattern: "[^#:\\s]+$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand Down Expand Up @@ -59,7 +59,7 @@ message User {
message UsersetUser {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -68,7 +68,7 @@ message UsersetUser {

string id = 2 [
(validate.rules).string = {
pattern: "[^#:\\s]+$",
pattern: "[^#:\\s]+$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -77,7 +77,7 @@ message UsersetUser {

string relation = 3 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -89,12 +89,12 @@ message RelationshipCondition {
// A reference (by name) of the relationship condition defined in the authorization model.
string name = 1 [
(validate.rules).string = {
pattern: "^[^\\s]{2,256}$",
pattern: "^[^\\s]{2,256}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 256,
max_length: 256
example: "\"condition1\""
}
];
Expand All @@ -110,31 +110,31 @@ message TupleKeyWithoutCondition {
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {max_bytes: 512},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 512,
max_length: 512
example: "\"user:anne\""
}
];

string relation = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 50,
max_length: 50
example: "\"reader\""
}
];

string object = 3 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[^\\s]{2,256}$",
pattern: "^[^\\s]{2,256}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 256,
max_length: 256
example: "\"document:2021-budget\""
}
];
Expand All @@ -150,7 +150,7 @@ message TupleKeyWithoutCondition {
message TypedWildcard {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -162,35 +162,35 @@ message TupleKey {
string user = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
max_bytes: 512,
max_bytes: 512
ignore_empty: false
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 512,
max_length: 512
example: "\"user:anne\""
}
];

string relation = 2 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 50,
max_length: 50
example: "\"reader\""
}
];

string object = 3 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {
pattern: "^[^\\s]{2,256}$",
pattern: "^[^\\s]{2,256}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 256,
max_length: 256
example: "\"document:2021-budget\""
}
];
Expand Down Expand Up @@ -330,7 +330,7 @@ message Store {
message UserTypeFilter {
string type = 1 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,254}$",
pattern: "^[^:#@\\s]{1,254}$"
ignore_empty: false
},
(google.api.field_behavior) = REQUIRED,
Expand All @@ -339,7 +339,7 @@ message UserTypeFilter {

string relation = 2 [
(validate.rules).string = {
pattern: "^[^:#@\\s]{1,50}$",
pattern: "^[^:#@\\s]{1,50}$"
ignore_empty: true
},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"member\""}
Expand Down
Loading

0 comments on commit bb96aa2

Please sign in to comment.