diff --git a/resources.capnp b/resources.capnp index cb6e9e1..2305cd3 100644 --- a/resources.capnp +++ b/resources.capnp @@ -18,15 +18,19 @@ interface Resources { list @1 () -> ( resources :List(Resource) ); # Returns all resources that the user can currently disclose. - getByName @2 ( name :Text ) -> ( resource :Resource , dummy :UInt8 ); + getByName @2 ( name :Text ) -> Fallible(Resource, GetError); # Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource. - getByUrn @3 ( urn :Text ) -> ( resource :Resource ); + getByUrn @3 ( urn :Text ) -> Fallible(Resource, GetError); # 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 ); + getByUrl @4 ( url :Text ) -> Fallible(Resource, GetError); # Returns a NULL capability if the resource doesn't exist or a user doesn't have read permission for that resource. + struct GetError { + notFound @0 :Void; + } + acceptToken @5 ( token :SturdyRef, project :Project ) -> Fallible(Claim, AcceptTokenError); acceptTokenSubstituteUser @7 ( token :SturdyRef, project :Project )