You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functional: we want to be able to export (synchronize) permissions to systems which cannot be modified to communicate with SpiceDB. Caveat details are a critical aspect of this.
Usability: we need to be able to display caveat details to users during review, approval, and auditing.
Availability: For resilience we want to back up and/or cache the result of CheckPermission calls so things will function even if SpiceDB is unavailable. The details of the relationship caveats are required for this.
Solution Brainstorm
Expand the SpiceDB permission lookup calls (ex: CheckPermission, LookupResources, and LookupSubjects) to optionally include information about the relationships with caveats encountered (Relationship including the CaveatName and Context) while evaluating the permission(s).
Example
Schema
caveat unexpired_grant(now timestamp, expires_at timestamp) {
now < expires_at
}
definition person {}
definition team {
relation member: person
relation guest: person with unexpired_grant
permission team_members = member + guest
}
definition application {
relation owner: team
relation user: team with unexpired_grant
permission access = owner->team_members + user->team_members
}
To be concrete we will make a full proposal; however, we acknowledge that we are not the experts here and are being specific rather than prescriptive.
We propose adding a flag to the three primary permission calls (CheckPermission, LookupResources, and LookupSubjects) that will cause them to return all the caveat information for the edges traversed (userset rewritten) during the permission computation. Hence,
A successful CheckPermission call with
application:pulse#access@person:drew with {"now":"2024-05-13T20:13:52.226861Z"}
In this example we might then take the minimum expires_at and use that in the cache or external system. In other cases, such as the country location, we might ensure they’re all the same (as you can’t be in two places at the same time) and use that.
A rejected CheckPermission call with
application:pulse#access@person:joe with {"now":"2024-05-13T20:13:52.226861Z"}
Problem Statement
CheckPermission
calls so things will function even if SpiceDB is unavailable. The details of the relationship caveats are required for this.Solution Brainstorm
Expand the SpiceDB permission lookup calls (ex:
CheckPermission
,LookupResources
, andLookupSubjects
) to optionally include information about the relationships with caveats encountered (Relationship
including theCaveatName
andContext
) while evaluating the permission(s).Example
Schema
Relationships
Checks
To be concrete we will make a full proposal; however, we acknowledge that we are not the experts here and are being specific rather than prescriptive.
We propose adding a flag to the three primary permission calls (
CheckPermission
,LookupResources
, andLookupSubjects
) that will cause them to return all the caveat information for the edges traversed (userset rewritten) during the permission computation. Hence,A successful
CheckPermission
call withmight return
In this example we might then take the minimum
expires_at
and use that in the cache or external system. In other cases, such as the country location, we might ensure they’re all the same (as you can’t be in two places at the same time) and use that.A rejected
CheckPermission
call withmight return something like
A
LookupSubjects
withWould return something like
I think in this case, returning things without a permission is a bigger change to the API and so is reasonable to omit.
The text was updated successfully, but these errors were encountered: