language icon indicating copy to clipboard operation
language copied to clipboard

Validation consistency for condition names & references

Open d-jeffery opened this issue 1 year ago • 3 comments

Go through:

  • https://github.com/openfga/api/blob/c96ec773cae9caf2a9536856bf1fa206a42ef7ef/openfga/v1/openfga.proto#L92
  • https://github.com/openfga/api/blob/c96ec773cae9caf2a9536856bf1fa206a42ef7ef/openfga/v1/authzmodel.proto#L137
  • https://github.com/openfga/language/blob/main/pkg/go/validation/validation-rules.go#L13

And make sure the validation is consistent for all three? Let's make it {1,50}

d-jeffery avatar Aug 15 '24 16:08 d-jeffery

@rhamzeh

With all 3 have different regexes here; the language version is the source of truth, right?

Are you concerned about a breaking change by restricting the condition name reference from 256 to 50 characters?

d-jeffery avatar Aug 15 '24 16:08 d-jeffery

Use {1,50}

rhamzeh avatar Aug 15 '24 18:08 rhamzeh

Use {1,50}

What about the difference in the patterns?

[^\\s] vs [^:#@\\s] vs [^\\*\\s]

d-jeffery avatar Aug 15 '24 19:08 d-jeffery