biscuit-auth / biscuit-rust

Rust implementation of the Biscuit authorization token
https://www.biscuitsec.org
209 stars 29 forks source link

`query_exactly_one()` #187

Open divarvel opened 1 year ago

divarvel commented 1 year ago

In many cases, we want the query to return exactly one result. A canonical example would be querying a user id from a token.

The current API makes it easier to discard extra results than to throw an error in the case of extra results.

I think it would be a good addition to have a query function that only returns a result when there exactly one match