2021-02-01 23:23:12 +01:00
|
|
|
@0xe89d197dcef9c49b;
|
|
|
|
|
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
|
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
|
2022-11-01 11:54:01 +01:00
|
|
|
using import "resource.capnp".Resource;
|
2024-04-15 16:28:23 +02:00
|
|
|
using import "resource.capnp".RestoredResource;
|
2023-11-23 12:36:28 +01:00
|
|
|
using import "claim.capnp".Claim;
|
2021-02-01 23:23:12 +01:00
|
|
|
|
2022-10-31 15:19:56 +01:00
|
|
|
interface Resources {
|
2024-04-15 16:28:23 +02:00
|
|
|
restore @0 () -> ( resources :List(RestoredResource) );
|
2023-11-23 12:36:28 +01:00
|
|
|
# Returns the list of valid claims the session owner of this `Resources` currently has.
|
2022-10-31 15:19:56 +01:00
|
|
|
|
|
|
|
list @1 () -> ( resources :List(Resource) );
|
2024-03-30 19:20:42 +01:00
|
|
|
# Returns all resources that the user can currently disclose.
|
2022-10-31 15:19:56 +01:00
|
|
|
|
2024-03-30 19:20:42 +01:00
|
|
|
getByName @2 ( name :Text ) -> ( resource :Resource );
|
|
|
|
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
|
2022-10-31 15:19:56 +01:00
|
|
|
|
2024-03-30 19:20:42 +01:00
|
|
|
getByUrn @3 ( urn :Text ) -> ( resource :Resource );
|
|
|
|
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
|
|
|
|
|
|
|
|
getByUrl @4 ( url :Text ) -> ( resource :Resource );
|
|
|
|
# Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource.
|
2024-04-15 16:28:23 +02:00
|
|
|
|
|
|
|
acceptToken @5 ( token :SturdyRef ) -> Fallible(Claim, Error(Void));
|
2021-08-29 12:18:24 +02:00
|
|
|
}
|