mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-12 06:41:51 +01:00
Terminal stuff
This commit is contained in:
parent
a2552c6759
commit
d4e6d048e3
@ -4,7 +4,6 @@ using CSharp = import "programming_language/csharp.capnp";
|
||||
$CSharp.namespace("FabAccessAPI.Schema");
|
||||
|
||||
using import "utils.capnp".L10NString;
|
||||
using import "main.capnp".Session;
|
||||
|
||||
struct AuthSupported {
|
||||
mechs @0 :List(Mechanism);
|
||||
@ -118,6 +117,9 @@ struct Response(Successful) {
|
||||
}
|
||||
|
||||
interface Authentication(Successful) {
|
||||
mechanisms @3 () -> ( mechanisms :List(Mechanism) );
|
||||
# Return the list of available mechanisms
|
||||
|
||||
step @0 ( data :Data ) -> Response(Successful);
|
||||
# Respond to a challenge with more data. A client MUST NOT call this after having received an
|
||||
# "successful" response.
|
||||
|
@ -13,12 +13,16 @@ using import "utils.capnp".Map;
|
||||
using import "utils.capnp".SturdyRef;
|
||||
using import "projects.capnp".Project;
|
||||
using import "traits.capnp".Hint;
|
||||
using import "auth.capnp".Authentication;
|
||||
|
||||
interface Claimable {
|
||||
claim @0 ( project :Project ) -> Fallible(Claim, ClaimError);
|
||||
# Returns NULL if the resource is *currently* not claimable.
|
||||
# Disown the returned claim capability to unclaim it.
|
||||
|
||||
claimSubstituteUser @1 ( project :Project ) -> Fallible(Authentication(Claim), ClaimError);
|
||||
# If the client calling this call is not allowed to make a SU claim the returned authentication is a nullptr
|
||||
|
||||
struct ClaimError {
|
||||
locked @0 :Text;
|
||||
}
|
||||
|
@ -3,6 +3,22 @@
|
||||
using CSharp = import "programming_language/csharp.capnp";
|
||||
$CSharp.namespace("FabAccessAPI.Schema");
|
||||
|
||||
using import "auth.capnp".Authentication;
|
||||
using import "utils.capnp".Fallible;
|
||||
using import "claim.capnp".Claim;
|
||||
|
||||
interface Project {
|
||||
|
||||
}
|
||||
|
||||
interface TerminalProjects {
|
||||
getUserProjects @0 () -> ( authentication :Authentication(List(Project)) );
|
||||
|
||||
addClaimToProject @1 ( claim :Claim, project :Project ) -> Fallible(AddOk, AddError);
|
||||
struct AddOk {
|
||||
|
||||
}
|
||||
struct AddError {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ using import "resource.capnp".RestoredResource;
|
||||
using import "claim.capnp".Claim;
|
||||
using import "utils.capnp".SturdyRef;
|
||||
using import "utils.capnp".Fallible;
|
||||
using import "projects.capnp".Project;
|
||||
using import "auth.capnp".Authentication;
|
||||
|
||||
interface Resources {
|
||||
restore @0 () -> ( resources :List(RestoredResource) );
|
||||
@ -25,7 +27,10 @@ interface Resources {
|
||||
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.
|
||||
|
||||
acceptToken @5 ( token :SturdyRef ) -> Fallible(Claim, AcceptTokenError);
|
||||
acceptToken @5 ( token :SturdyRef, project :Project ) -> Fallible(Claim, AcceptTokenError);
|
||||
|
||||
acceptTokenSubstituteUser @7 ( token :SturdyRef, project :Project )
|
||||
-> Fallible(Authentication(Claim), AcceptTokenError);
|
||||
|
||||
setAlias @6 ( original_resource_id :Text ) -> ( alias_id :Text );
|
||||
# Replace any set alias for the given resource id with a newly generated
|
||||
|
38
terminalMain.capnp
Normal file
38
terminalMain.capnp
Normal file
@ -0,0 +1,38 @@
|
||||
@0xc71ee8fdf17f8372;
|
||||
|
||||
using CSharp = import "programming_language/csharp.capnp";
|
||||
$CSharp.namespace("FabAccessAPI.Schema");
|
||||
|
||||
using import "auth.capnp".Authentication;
|
||||
using import "resources.capnp".Resources;
|
||||
using import "projects.capnp".TerminalProjects;
|
||||
|
||||
interface TerminalBootstrap
|
||||
{
|
||||
getAPIVersion @0 () -> Version;
|
||||
# Returns the API version implemented by the server. As a client, you can compare this version with the local currentVersion.
|
||||
|
||||
getServerRelease @1 () -> ( name :Text, release :Text );
|
||||
# Returns the server implementation name and version/build number Designed only for human-facing
|
||||
# debugging output so should be informative over machine-readable.
|
||||
# Example: ("bffhd", "0.3.1-f397e1e [rustc 1.57.0 (f1edd0429 2021-11-29)]")
|
||||
|
||||
getServerInfo @2 () -> ( spacename :Text, instanceurl :Text );
|
||||
# Returns information about the server, which can be used to resolve MDNS to DNS and display the server name to the user.
|
||||
|
||||
mechanisms @3 () -> AuthSupported;
|
||||
# Get a list of Mechanisms this server allows in this context.
|
||||
|
||||
createSession @4 ( mechanism :Text, upgrade :Text ) -> ( authentication :Authentication(TerminalSession) );
|
||||
}
|
||||
|
||||
struct TerminalSession
|
||||
{
|
||||
resources @0 :Resources;
|
||||
projects @1 :TerminalProjects;
|
||||
users @2 :TerminalUsers;
|
||||
}
|
||||
|
||||
interface TerminalUsers {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user