roland.hochmuth
10/08/2021, 3:29 PMkrtkvrm
10/10/2021, 7:15 PMdefinition user {}
definition group {
relation member: user
}
definition organization {
relation resource: resource
relation admin: user
}
definition resource {
relation admin: user | organization#admin | group#member
relation viewer: user
permission manage = admin + viewer
}
krtkvrm
10/10/2021, 7:21 PMdefinition user {}
definition group {
relation member: user
}
definition organization {
relation r1_admin: group#member
relation r2_admin: group#member
}
definition resource/r1 {
relation admin: organization#r1_admin | group
relation viewer: user
permission manage = admin + viewer
}
definition resource/r2 {
relation admin: organization#r2_admin | group
relation viewer: user
permission manage = admin + viewer
}
user
10/10/2021, 7:21 PMuser
10/10/2021, 7:23 PMkrtkvrm
10/11/2021, 12:29 PMwritten_at:{token:"GgMKATI="}
written_at:{token:"GgMKATM="}
written_at:{token:"GgMKATQ="}
written_at:{token:"GgMKATU="}
written_at:{token:"GgMKATY="}
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_NO_PERMISSION
deleted_at:{token:"GgMKATc="}
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_NO_PERMISSION
with sleep
written_at:{token:"GgMKATI="}
written_at:{token:"GgMKATM="}
written_at:{token:"GgMKATQ="}
written_at:{token:"GgMKATU="}
written_at:{token:"GgMKATY="}
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_HAS_PERMISSION
PERMISSIONSHIP_HAS_PERMISSION
deleted_at:{token:"GgMKATc="}
PERMISSIONSHIP_NO_PERMISSION
PERMISSIONSHIP_NO_PERMISSION
PERMISSIONSHIP_NO_PERMISSION
Joey
10/11/2021, 2:22 PMJoey
10/11/2021, 2:23 PMJoey
10/11/2021, 2:23 PMJoey
10/11/2021, 2:24 PMuser
10/11/2021, 2:40 PMkrtkvrm
10/12/2021, 6:42 PMkrtkvrm
10/12/2021, 6:49 PM4:07PM INF Query args=[] module=pgx pid=232 rowCount=1 sql="SELECT NOW()"
4:07PM INF Query args=["2021-10-12T10:37:24.672923Z"] module=pgx pid=232 rowCount=1 sql="SELECT MIN(id), MAX(id) FROM relation_tuple_transaction WHERE timestamp >= $1"
4:07PM INF Query args=[] module=pgx pid=232 rowCount=1 sql="SELECT MAX(id) FROM relation_tuple_transaction"
4:07PM INF finished server unary call grpc.code=OK grpc.method=CheckPermission grpc.method_type=unary grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2021-10-12T16:07:29+05:30 grpc.time_ms=9.295 kind=server system=grpc
and when we stopped the db, the queries failed.
Is there any mode in which we just cache the whole relationship graph in spicedb memory so we dont query pg for reads? something like sync the db whenever there is a write or periodically say every 1 mins
Our startup command
$ spicedb serve --grpc-preshared-key "shield" --grpc-no-tls --datastore-engine postgres --datastore-conn-uri "postgres://shield_dev:@0.0.0.0:5432/shield_dev?sslmode=disable"
2. Do we need to run migrations for fresh db only.. right?
$ spicedb migrate HEAD --datastore-engine postgres --datastore-conn-uri "postgres://shield_dev:@0.0.0.0:5432/shield_dev?sslmode=disable"
3. Is there any approach to make it HA? One approach can be to use consul to balance load between multiple spicedb (as its grpc), but if we go with in-memory along with PG (if its possible from question 1), is there a way to sync the updates on all the spicedb instances/pods once there is a write or they could just periodically sync itJoey
10/12/2021, 7:43 PMkrtkvrm
10/12/2021, 8:32 PMcostap
10/13/2021, 3:55 PMuser
10/13/2021, 3:56 PMcostap
10/13/2021, 4:00 PMuser
10/13/2021, 4:00 PMcostap
10/14/2021, 10:00 AMJoey
10/14/2021, 2:31 PMRead
API to find all the relations on which a user has a relationship for an objectJoey
10/14/2021, 2:31 PMExpand
Joey
10/14/2021, 2:32 PMcostap
10/14/2021, 2:32 PMJoey
10/14/2021, 2:32 PMExpand
on your most permissive permission (typically view
), and then it'll show all the users who have permission for that object and that permission (and any permissions that are included in that permission) as a treeJoey
10/14/2021, 2:34 PMdefinition user {}
definition document {
relation admin: user
relation writer: user
relation viewer: user
permission write = admin + writer
permission view = viewer + write
}
calling Expand
on document:somedocument
and view
, will return a tree containing all users who are in relations viewer
, writer
and admin
, since all three form view
Joey
10/14/2021, 2:34 PMJoey
10/14/2021, 2:35 PMJoey
10/14/2021, 2:35 PMExpand
does have the full set of infocostap
10/14/2021, 2:38 PM