At least be consistent

This commit is contained in:
Nadja Reitzenstein 2021-10-02 12:18:28 +02:00
parent 170d4df51c
commit 8b94301382
6 changed files with 17 additions and 16 deletions

View File

@ -100,7 +100,7 @@ struct Response {
}
interface Authentication {
step @0 (data :Data) -> Response;
step @0 ( data :Data ) -> Response;
# Respond to a challenge with more data. A client MUST NOT call this after having received an
# "successful" response.

View File

@ -12,7 +12,7 @@ using Users = import "users.capnp".Users;
interface Bootstrap
{
mechanisms @0 () -> ( mechs: List(Text) );
mechanisms @0 () -> ( mechs :List(Text) );
# Get a list of Mechanisms this server allows in this context.
createSession @1 ( mechanism :Text, initialData :Data ) -> ( authentication :Authentication );
@ -26,10 +26,10 @@ 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.
resources @0 : Resources;
resources @0 :Resources;
# Access to the resources configured.
users @1 : Users;
users @1 :Users;
# User administration. This includes both modifying other users and self-modification, so this
# is allowed for most sessions
}

View File

@ -74,7 +74,7 @@ struct Resource {
struct Map(Key, Value) {
# A serialized key-value map represented as a list of (k,v) tuples.
entries @0 : List(Entry);
entries @0 :List(Entry);
struct Entry {
key @0 :Key;
@ -124,7 +124,7 @@ interface Notify extends(Access) {
# Notify are ephermal. If the connection to the server is lost all `Notify` from that client are
# unregistered.
register @0 ( cb: Callback );
register @0 ( cb :Callback );
# Register a given callback to be called on every state update. If this client already has a
# callback registered for this resource the old callback is replaced.
@ -156,7 +156,7 @@ interface Notify extends(Access) {
interface Interestable {
# "Interest" right now it tells BFFH that the client wants at least one `Claim` to remain.
register @0 ( cb: Callback ) -> ( handle :Handle );
register @0 ( cb :Callback ) -> ( handle :Handle );
# Register a callback that BFFH will use to send notifications back to the client asyncronously.
# This creates an "Interest" on this resource. Setting the callback to a `nullptr` will still
# register an interest but the server will not be able to inform a client about an impeding

View File

@ -27,13 +27,13 @@ struct User {
passwd @3 :Passwd;
interface Passwd {
changepw @0 ( old: Text, new: Text );
changepw @0 ( old :Text, new :Text );
}
manage @4 :Manage;
interface Manage $CSharp.name("ManageInterface") {
addRole @0 ( role :Role );
removeRole @1 ( role :Role );
addRole @0 Role;
removeRole @1 Role;
}
admin @5 :Admin;

View File

@ -16,7 +16,7 @@ interface Users
interface Manage $CSharp.name("ManageInterface") {
list @0 () -> ( users :List(User) );
addUser @1 ( username: Text, password: Text ) -> User;
addUser @1 ( username :Text, password :Text ) -> User;
removeUser @2 User;
}

View File

@ -30,17 +30,18 @@ interface L10NString {
struct UUID {
# UUID type used to identify machines.
# Since the exact value has no meaning the encoding rules are not too relevant, but it is
# paramount that you are consistent when encoding and decoding this type.
#
# Consider using this algorithm for assembling the 128-bit integer:
# (assuming ISO9899:2018 shifting & casting rules)
# uint128_t num = (uuid1 << 64) + uuid0;
# uint128_t num = (upper << 64) + lower;
# And then respectively this code for deconstructing it:
# uint64_t uuid0 = (uint64_t) num;
# uint64_t uuid1 = (uint64_t) (num >> 64);
# uint64_t lower = (uint64_t) num;
# uint64_t upper = (uint64_t) (num >> 64);
lower @0 :UInt64;
# lower 8 bytes of the uuid, containing the LSB.
upper @1 :UInt64;
# upper 8 bytes of the uuid, containing the MSB.
}