openfga/community

Add creation and last update dates to authorization models

geoffroybraun opened this issue · 1 comments

So far, only stores have both creation and last update dates. Unfortunatly, regarding authorization models, it is impossible to get a specific version without knowing its ID, as the list authorization models endpoint does not indicate how models are ordered before being retrieved.

A successful but quite easy-to-implement solution would retrieve an authorization model creation date aside with its last update one, which could be the same date as the creation date if no update has been performed yet. That way, we could list authorization models and know which one is the latest.

Please let know if more explanations have to be provided, cheers!

Authorization Models in OpenFGA are immutable - so you cannot update them, just create new authorization models with new IDs.

Re: date created, the authorization model id is a ulid which contains the date.

For example, in JS you can use the ulid library to get the time:

import ulid = require('ulid');
const time = ulid.decodeTime(id)