warrant-dev / warrant

Warrant is a highly scalable, centralized authorization service based on Google Zanzibar. Use it to define, enforce, query, and audit application authorization and access control.
https://warrant.dev
Apache License 2.0
1.15k stars 43 forks source link

Query API Returns Syntax Error When Object Type Contains Keyword #330

Closed kkajla12 closed 5 months ago

kkajla12 commented 5 months ago

Describe the bug If a user-defined object type contains a substring of a query language keyword (at the beginning or end of the name), the query API will incorrectly parse the substring as a query language keyword, which can lead to the parser returning a syntax error.

To Reproduce Create an object-type called formation (which contains the keyword for at the beginning), the query API will return a syntax error for a valid query like:

select owner of type user for formation:123

Expected behavior The query API should parse and evaluate queries like the one above as expected.

Additional context N/A