https://cerbos.dev logo
#help
Title
# help
c

Carl Bäckström

06/19/2023, 3:05 PM
Are there any naming conventions for resource names with two parts in it? Would it be snake case
car_tire
?
c

Charith (Cerbos)

06/19/2023, 3:41 PM
Cerbos doesn't impose one other than restricting the set of characters you can use in the name (you can configure the editor to warn you about that). The naming convention is up to you. That being said, I think it's more common to use underscores to separate words.
s

Stephen Raymond Jr

06/19/2023, 5:43 PM
for reference, the protobuf schema defines this validation for the resource name
Copy code
message ResourcePolicy {
  string resource = 1 [(validate.rules).string = {
    pattern: "^[[:alpha:]][[:word:]\\@\\.\\-/]*(\\:[[:alpha:]][[:word:]\\@\\.\\-/]*)*$",
    min_len: 1
  }];
2 Views