biscuit-auth / biscuit-go

Apache License 2.0
75 stars 22 forks source link

Parameters #122

Closed divarvel closed 1 year ago

divarvel commented 1 year ago

Parsed datalog snippets can now contain placeholders (for instance: check if right({resource}, {operation}). This allows embedding dynamic values in datalog, without the risk of injections.

All the FromString* methods now have a FromString*WithParams counterpart that take an extra map[string]Term value.

/!\ For now, it is the caller's responsibility to make sure the all the placeholders in expressions have a corresponding value defined (same as making sure sets don't contain variables). Placeholders set in predicates don't have this issue. This is an underlying issue of the parser; it was not introduced by this change.