api.fabaccess-api/main.capnp
2022-11-04 16:07:33 +01:00

51 lines
1.7 KiB
Cap'n Proto

@0xbf017710be5a54ff;
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
using import "auth.capnp".Authentication;
using import "resources.capnp".Resources;
using import "users.capnp".Users;
using import "user.capnp".User;
using import "permissions.capnp".Permissions;
struct Version
{
major @0 :Int32 = 0;
minor @1 :Int32 = 4;
}
interface Bootstrap
{
getAPIVersion @0 () -> Version;
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)]")
mechanisms @2 () -> ( mechs :List(Text) );
# Get a list of Mechanisms this server allows in this context.
createSession @3 ( mechanism :Text ) -> ( authentication :Authentication );
# Create a new session with the server that you wish to authenticate using `mechanism`. If the
# mechanism is a client-first mechanism you can then immediately call Authentication::step with
# initial data in a pipelined fashion. If the mechanism is server-first you must call
# Authentication::step with a NULL `data` parameter.
}
struct Session {
# An API session with the server. The below capabilities are set to NULL if the authenticated
# user doesn't have permission to access the system in question, or if the server does not
# implement it.
whoami @0 :User;
resources @1 :Resources;
# Access to the resources configured.
users @2 :Users;
# User administration.
permissions @3 :Permissions;
}