mirror of
https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git
synced 2025-03-12 14:51:42 +01:00
At least be consistent
This commit is contained in:
parent
170d4df51c
commit
8b94301382
@ -100,7 +100,7 @@ struct Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface Authentication {
|
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
|
# Respond to a challenge with more data. A client MUST NOT call this after having received an
|
||||||
# "successful" response.
|
# "successful" response.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ using Users = import "users.capnp".Users;
|
|||||||
|
|
||||||
interface Bootstrap
|
interface Bootstrap
|
||||||
{
|
{
|
||||||
mechanisms @0 () -> ( mechs: List(Text) );
|
mechanisms @0 () -> ( mechs :List(Text) );
|
||||||
# Get a list of Mechanisms this server allows in this context.
|
# Get a list of Mechanisms this server allows in this context.
|
||||||
|
|
||||||
createSession @1 ( mechanism :Text, initialData :Data ) -> ( authentication :Authentication );
|
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
|
# 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.
|
# user doesn't have permission to access the system in question.
|
||||||
|
|
||||||
resources @0 : Resources;
|
resources @0 :Resources;
|
||||||
# Access to the resources configured.
|
# Access to the resources configured.
|
||||||
|
|
||||||
users @1 : Users;
|
users @1 :Users;
|
||||||
# User administration. This includes both modifying other users and self-modification, so this
|
# User administration. This includes both modifying other users and self-modification, so this
|
||||||
# is allowed for most sessions
|
# is allowed for most sessions
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ struct Resource {
|
|||||||
struct Map(Key, Value) {
|
struct Map(Key, Value) {
|
||||||
# A serialized key-value map represented as a list of (k,v) tuples.
|
# A serialized key-value map represented as a list of (k,v) tuples.
|
||||||
|
|
||||||
entries @0 : List(Entry);
|
entries @0 :List(Entry);
|
||||||
|
|
||||||
struct Entry {
|
struct Entry {
|
||||||
key @0 :Key;
|
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
|
# Notify are ephermal. If the connection to the server is lost all `Notify` from that client are
|
||||||
# unregistered.
|
# 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
|
# 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.
|
# callback registered for this resource the old callback is replaced.
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ interface Notify extends(Access) {
|
|||||||
interface Interestable {
|
interface Interestable {
|
||||||
# "Interest" right now it tells BFFH that the client wants at least one `Claim` to remain.
|
# "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.
|
# 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
|
# 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
|
# register an interest but the server will not be able to inform a client about an impeding
|
||||||
|
@ -27,13 +27,13 @@ struct User {
|
|||||||
|
|
||||||
passwd @3 :Passwd;
|
passwd @3 :Passwd;
|
||||||
interface Passwd {
|
interface Passwd {
|
||||||
changepw @0 ( old: Text, new: Text );
|
changepw @0 ( old :Text, new :Text );
|
||||||
}
|
}
|
||||||
|
|
||||||
manage @4 :Manage;
|
manage @4 :Manage;
|
||||||
interface Manage $CSharp.name("ManageInterface") {
|
interface Manage $CSharp.name("ManageInterface") {
|
||||||
addRole @0 ( role :Role );
|
addRole @0 Role;
|
||||||
removeRole @1 ( role :Role );
|
removeRole @1 Role;
|
||||||
}
|
}
|
||||||
|
|
||||||
admin @5 :Admin;
|
admin @5 :Admin;
|
||||||
|
@ -16,7 +16,7 @@ interface Users
|
|||||||
interface Manage $CSharp.name("ManageInterface") {
|
interface Manage $CSharp.name("ManageInterface") {
|
||||||
list @0 () -> ( users :List(User) );
|
list @0 () -> ( users :List(User) );
|
||||||
|
|
||||||
addUser @1 ( username: Text, password: Text ) -> User;
|
addUser @1 ( username :Text, password :Text ) -> User;
|
||||||
|
|
||||||
removeUser @2 User;
|
removeUser @2 User;
|
||||||
}
|
}
|
||||||
|
11
utils.capnp
11
utils.capnp
@ -30,17 +30,18 @@ interface L10NString {
|
|||||||
|
|
||||||
struct UUID {
|
struct UUID {
|
||||||
# UUID type used to identify machines.
|
# 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:
|
# Consider using this algorithm for assembling the 128-bit integer:
|
||||||
# (assuming ISO9899:2018 shifting & casting rules)
|
# (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:
|
# And then respectively this code for deconstructing it:
|
||||||
# uint64_t uuid0 = (uint64_t) num;
|
# uint64_t lower = (uint64_t) num;
|
||||||
# uint64_t uuid1 = (uint64_t) (num >> 64);
|
# uint64_t upper = (uint64_t) (num >> 64);
|
||||||
|
|
||||||
lower @0 :UInt64;
|
lower @0 :UInt64;
|
||||||
|
# lower 8 bytes of the uuid, containing the LSB.
|
||||||
|
|
||||||
upper @1 :UInt64;
|
upper @1 :UInt64;
|
||||||
|
# upper 8 bytes of the uuid, containing the MSB.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user