key-value api in fastn
#1888
amitu
started this conversation in
Ideas & RFCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We will have a
fastn_kv
table with key, value (created_at, updated_at) columns. And we will have APIs to access them, get:/-/kv/?key=<key>
, update:/-/kv/?key=<>&value=<>
(key and value can be either in query param or in body. Maybe delete as well. We can goREST
on it actually,/-/kv/<key>/
GET
to get the value,DELETE
to delete,PUT
/POST
to upsert.It will use the right db, either sqlite or pg, in how so ever it is configured.
How to do auth? We can rely on session id, auth stuff, with logged in user having
is_staff
(we can add is_staff as a column infastn_user
table). In future we can have other auth (I feel like we should have some sort of generic OIDC support, and fastn_oidc, which will specify some generic way to do OIDC match, and some sort of “allow” value which tells you what are you allowed to do with this particular OIDC match).We can also have some account-secret table, which also has generic “allow”, which tells you what all can you do.
Maybe we have a permission framework, and create permissions, and allow some many to many between user and permission (and also oidc/account-secret table).
Beta Was this translation helpful? Give feedback.
All reactions