Skip to content

Commit

Permalink
new api
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Aug 9, 2023
1 parent f0eb3d6 commit 5f507a2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion proto/src/main/protobuf/authzed/api/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ message SubjectReference {
// ObjectReference is used to refer to a specific object in the system.
message ObjectReference {
string object_type = 1 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];
string object_id = 2 [ (validate.rules).string = {
Expand Down
10 changes: 5 additions & 5 deletions proto/src/main/protobuf/authzed/api/v1/permission_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ message Consistency {
// unspecified will not filter relationships.
message RelationshipFilter {
string resource_type = 1 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];

Expand Down Expand Up @@ -156,7 +156,7 @@ message SubjectFilter {
}

string subject_type = 1 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];

Expand Down Expand Up @@ -370,7 +370,7 @@ message LookupResourcesRequest {
// resource_object_type is the type of resource object for which the IDs will
// be returned.
string resource_object_type = 2 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];

Expand Down Expand Up @@ -451,7 +451,7 @@ message LookupSubjectsRequest {
// subject_object_type is the type of subject object for which the IDs will
// be returned.
string subject_object_type = 4 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];

Expand Down Expand Up @@ -545,4 +545,4 @@ message ResolvedSubject {

// partial_caveat_info holds information of a partially-evaluated caveated response
PartialCaveatInfo partial_caveat_info = 3 [ (validate.rules).message.required = false ];
}
}
2 changes: 1 addition & 1 deletion proto/src/main/protobuf/authzed/api/v1/watch_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ message WatchRequest {
(validate.rules).repeated .min_items = 0,
(validate.rules).repeated .items.string = {
pattern : "^([a-z][a-z0-9_]{1,62}[a-z0-9]/"
")?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
")*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
}
];
Expand Down
2 changes: 1 addition & 1 deletion proto/src/main/protobuf/authzed/api/v1alpha1/schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message ReadSchemaRequest {
// These names must be fully qualified with their namespace (e.g.
// myblog/post).
repeated string object_definitions_names = 1 [ (validate.rules).repeated .items.string = {
pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern: "^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes: 128,
} ];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ message WatchResourcesRequest {
// resource_object_type is the type of resource object for which we will
// watch for changes.
string resource_object_type = 1 [ (validate.rules).string = {
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$",
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$",
max_bytes : 128,
} ];

Expand Down

0 comments on commit 5f507a2

Please sign in to comment.