api.fabaccess-api/user.capnp

76 lines
2.7 KiB
Cap'n Proto
Raw Normal View History

2021-02-01 23:23:12 +01:00
@0xc7941adf5db6bbf0;
using Rust = import "programming_language/rust.capnp";
$Rust.parentModule("schema");
using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
using General = import "general.capnp";
using Space = import "space.capnp".Space;
2021-08-27 00:28:33 +02:00
using Role = import "role.capnp".Role;
2021-02-01 23:23:12 +01:00
struct User
{
2021-08-27 21:42:36 +02:00
id @0 :General.UUID;
username @1 :Text;
space @2 :Space;
2021-02-01 23:23:12 +01:00
struct UserInfoExtended
{
id @0 :General.UUID;
name @1 :Text;
2021-02-01 23:23:12 +01:00
}
2021-08-27 21:42:36 +02:00
info @3 :Info;
2021-02-01 23:23:12 +01:00
interface Info $CSharp.name("InfoInterface") {
2022-03-09 16:59:28 +01:00
listRoles @0 () -> ( roles :List(Role) );
2021-02-01 23:23:12 +01:00
}
2021-08-27 21:42:36 +02:00
manage @4 :Manage;
2021-02-01 23:23:12 +01:00
interface Manage $CSharp.name("ManageInterface") {
2021-08-29 11:51:37 +02:00
pwd @0 ( old_pwd :Text, new_pwd :Text ) -> ();
2021-08-27 21:42:36 +02:00
}
admin @5 :Admin;
interface Admin $CSharp.name("AdminInterface") {
getUserInfoExtended @0 () -> ( userInfoExtended :UserInfoExtended );
2022-03-09 16:59:28 +01:00
addRole @1 ( role :Role ) -> ();
removeRole @2 ( role :Role ) -> ();
2021-08-29 11:51:37 +02:00
2022-03-09 16:59:28 +01:00
pwd @3 ( new_pwd :Text ) -> ();
2021-08-26 23:52:36 +02:00
}
2021-08-27 21:42:36 +02:00
cardDESFireEV2 @6 :CardDESFireEV2;
2021-08-27 21:28:31 +02:00
interface CardDESFireEV2 $CSharp.name("CardDESFireInterface") {
# For more details about FabFire specification please see:
# https://docs.fab-access.org/books/fabfire-und-nfc-tags/page/fabfire-funktionsprinzip-grundlagen
2021-08-28 20:25:49 +02:00
2021-08-29 11:51:37 +02:00
getTokenList @0 () -> ( token_list :List(Data) );
# Get a list of all user Token currently bound to an user. This will generally be the number
2021-08-28 18:15:26 +02:00
# of cards they use.
2021-08-29 11:51:37 +02:00
bind @1 ( token :Data, auth_key :Data ) -> ();
2021-08-28 18:15:26 +02:00
# Bind a given URL to a given auth key. The server will store both URL and key, so using
# this frequently will force the server to store large amounts of data.
# Trying to bind a new key to an existing URL will fail.
2021-08-29 11:51:37 +02:00
unbind @2 ( token :Data ) -> ();
# Unbind the key associated with the given token. This will fail all future attempts to use
2021-08-28 18:15:26 +02:00
# the card with the associated key.
2021-08-29 11:51:37 +02:00
genCardToken @3 () -> ( token :Data );
# Generate a new Token that can be used to access an user in a pseudonymized fashion.
# This call is extremely cheap to make as the server will not store this Token.
getMetaInfo @4 () -> ( bytes :Data );
# Retrieve the blob for File 0001 from the server. The returned bytes are in the correct
# format to be written to the card as-is.
getSpaceInfo @5 () -> ( bytes :Data );
# Retrieve the blob for File 0002 from the server. The returned bytes are in the correct
# format to be written to the card as-is, but a client MAY add or change some information
# contained.
2021-02-01 23:23:12 +01:00
}
}