From c6841ed4804f61281083aec27d79ee2d7254cc76 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 6 Feb 2024 13:03:07 -0500 Subject: [PATCH] Make sure to mark the resource_type as optional in the validation regex --- authzed/api/v1/permission_service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authzed/api/v1/permission_service.proto b/authzed/api/v1/permission_service.proto index f6851d3..e28b73e 100644 --- a/authzed/api/v1/permission_service.proto +++ b/authzed/api/v1/permission_service.proto @@ -132,7 +132,7 @@ message RelationshipFilter { // resource_type is the *optional* resource type of the relationship. // NOTE: It is not prefixed with "optional_" for legacy compatibility. 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, } ];