2021-02-01 23:23:12 +01:00
|
|
|
@0xbf017710be5a54ff;
|
|
|
|
|
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
2020-10-19 01:52:15 +02:00
|
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
|
2022-11-01 11:54:01 +01:00
|
|
|
using import "auth.capnp".Authentication;
|
|
|
|
using import "resources.capnp".Resources;
|
|
|
|
using import "users.capnp".Users;
|
2021-02-01 23:23:12 +01:00
|
|
|
|
2022-10-31 15:19:56 +01:00
|
|
|
struct Version
|
|
|
|
{
|
|
|
|
major @0 :Int32 = 0;
|
|
|
|
minor @1 :Int32 = 4;
|
|
|
|
}
|
|
|
|
|
2021-09-23 22:33:56 +02:00
|
|
|
interface Bootstrap
|
2021-02-01 23:23:12 +01:00
|
|
|
{
|
2022-10-31 15:19:56 +01:00
|
|
|
getAPIVersion @0 () -> Version;
|
|
|
|
|
|
|
|
getServerRelease @1 () -> ( name :Text, release :Text );
|
2022-11-01 11:54:01 +01:00
|
|
|
# Returns the server implementation name and version/build number Designed only for human-facing
|
|
|
|
# debugging output so should be informative over machine-readable.
|
2022-11-01 11:03:26 +01:00
|
|
|
# Example: ("bffhd", "0.3.1-f397e1e [rustc 1.57.0 (f1edd0429 2021-11-29)]")
|
2022-10-31 15:19:56 +01:00
|
|
|
|
|
|
|
mechanisms @2 () -> ( mechs :List(Text) );
|
2021-09-23 22:33:56 +02:00
|
|
|
# Get a list of Mechanisms this server allows in this context.
|
2021-02-01 23:23:12 +01:00
|
|
|
|
2022-11-01 11:03:26 +01:00
|
|
|
createSession @3 ( mechanism :Text, initialData :Data )
|
|
|
|
-> ( authentication :Authentication );
|
2022-11-01 11:54:01 +01:00
|
|
|
# Create a new session with the server that you wish to authenticate using `mechanism`. If the
|
|
|
|
# mechanism is a client-first mechanism you MAY set `initialData` to contain the data you want
|
|
|
|
# to send. If the mechanism is server-first or you do not wish to send initial data, make
|
|
|
|
# initialData a NULL-pointer.
|
2021-09-23 22:33:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Session {
|
2022-11-01 11:54:01 +01:00
|
|
|
# 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.
|
2021-10-01 20:06:06 +02:00
|
|
|
|
2021-10-02 12:18:28 +02:00
|
|
|
resources @0 :Resources;
|
2022-11-01 11:03:26 +01:00
|
|
|
# Access to the resources configured.
|
2021-10-01 20:06:06 +02:00
|
|
|
|
2021-10-02 12:18:28 +02:00
|
|
|
users @1 :Users;
|
2022-11-01 11:54:01 +01:00
|
|
|
# User administration. This includes both modifying other users and self-modification, so this
|
|
|
|
# is allowed for most sessions
|
2021-08-29 12:18:24 +02:00
|
|
|
}
|