api.fabaccess-api/user.capnp

74 lines
2.3 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
{
struct UserInfo
{
id @0 :General.UUID;
username @1 :Text;
space @2 :Space;
}
struct UserInfoExtended
{
id @0 :General.UUID;
firstname @1 :Text;
lastname @2 :Text;
address @3 :Address;
struct Address
{ # TODO POST*CODE
text @0 :Text;
}
}
info @0 :Info;
interface Info $CSharp.name("InfoInterface") {
getUserInfo @0 () -> ( userInfo :UserInfo );
}
manage @1 :Manage;
interface Manage $CSharp.name("ManageInterface") {
getUserInfoExtended @0 () -> ( userInfoExtended :UserInfoExtended );
2021-08-26 23:52:36 +02:00
pwd @1 ( pwd :Text ) -> ();
2021-08-27 00:28:33 +02:00
addRole @2 ( role :Role ) -> ();
removeRole @3 ( role :Role ) -> ();
2021-08-26 23:52:36 +02:00
}
2021-08-27 00:28:33 +02:00
cardDESFire @2 :CardDESFire;
interface CardDESFire $CSharp.name("CardDESFireInterface") {
2021-08-28 18:15:26 +02:00
# Card authentication using NXP/MiFare DESFire cards.
# These cards have the ability to restrict access for data on the cards using symmetric
# encryption and using a keyed Diffie-Hellman to prevent eavesdropping by any relaying
# party.
2021-08-26 23:52:36 +02:00
getPIDList @0 () -> ( pids :List(Text) );
2021-08-28 18:15:26 +02:00
# Get a list of all user URL currently bound to an user. This will generally be the number
# of cards they use.
genUserURL @1 () -> ( url :Text );
# Generate a new URL 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 the URL.
bind @2 ( url :Text, auth_key :Data ) -> ();
# 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.
revoke @3 ( url :Text ) -> ();
# Revoke the key associated with the given URL. This will fail all future attempts to use
# the card with the associated key.
2021-02-01 23:23:12 +01:00
}
2021-08-28 18:15:26 +02:00
}