Latest Zed Token
# spicedb
j
then why would you have multiple zedtokens?
d
Eg: we have a folder and a file. When a user logs in, we update all roles of a user in folder / file. Next is we list all permissions of a user in both folder / file in the next API call from front-end. Since file permissions are inherited and in our case we store tokens corresponding to the object along with other metadata, if either file / folder role changes, sometimes get stale data. So we want to determine which zed-token to use for the check-permission endpoint. If not we'll use fully consistent request. Just wanted to know if it's possible to determine the latest token from both / a list of tokens.
j
> Next is we list all permissions of a user in both folder / file in the next API call from front-end this will likely slow down significantly
we've had a request for an API for comparing ZedTokens: https://github.com/authzed/spicedb/issues/1162
b
You can decode zedtokens to database.Revision (via pkg/zedtoken) objects, and then call GreaterThan/LessThan/Equal on them. https://gist.github.com/ben-mays/62cb2fd5d892fed51953a499d1445534
j
Note that this isn't a supported feature and may break at any time
20 Views