Merge branch 'NewStructur' of gitlab.com:fabinfra/fabaccess/fabaccess-api into NewStructur

* 'NewStructur' of gitlab.com:fabinfra/fabaccess/fabaccess-api:
  Changed: Move Info to Struct
  Updated: DESFire File Content Methods
This commit is contained in:
Gregor Reitzenstein 2021-08-28 19:32:29 +02:00
commit 3e5ba09f10
2 changed files with 43 additions and 47 deletions

View File

@ -19,19 +19,9 @@ struct Machine {
disabled @4;
reserved @5;
}
struct MachineInfo {
id @0 :General.UUID;
space @1 :Space;
name @2 :Text;
info @3 :Text;
state @4 :MachineState;
user @5 :User;
transferuser @6 :User;
manager @7:User;
struct MachineInfoExtended {
user @0 :User;
transferuser @1 :User;
}
struct Reservation {
@ -40,16 +30,23 @@ struct Machine {
end @2: UInt64;
}
info @0 :Info;
id @0 :General.UUID;
space @1 :Space;
name @2 :Text;
description @3 :Text;
state @4 :MachineState;
manager @5:User;
info @6 :Info;
interface Info $CSharp.name("InfoInterface") {
getMachineInfo @0 () -> ( machineInfo :MachineInfo);
getMachineInfoExtended @0 () -> ( machineInfoExtended :MachineInfoExtended);
getPropertyList @1 () -> ( propertyList :List(General.KeyValuePair) );
getReservationList @2 () -> ( reservationList :List(Reservation) );
}
use @1 :Use;
use @7 :Use;
interface Use $CSharp.name("UseInterface") {
use @0 ();
@ -57,7 +54,7 @@ struct Machine {
reserveto @2 (start :UInt64, end :UInt64);
}
inuse @2 :InUse;
inuse @8 :InUse;
interface InUse $CSharp.name("InUseInterface") {
giveBack @0 ();
@ -66,19 +63,19 @@ struct Machine {
sendRawData @2 (data :Data);
}
transfer @3 :Transfer;
transfer @9 :Transfer;
interface Transfer $CSharp.name("TransferInterface") {
accept @0 ();
reject @1 ();
}
check @4 :Check;
check @10 :Check;
interface Check $CSharp.name("CheckInterface") {
check @0 ();
reject @1 ();
}
manage @5 :Manage;
manage @11 :Manage;
interface Manage $CSharp.name("ManageInterface") {
setProperty @0 (property :General.KeyValuePair);
removeProperty @1 (property :General.KeyValuePair);
@ -92,7 +89,7 @@ struct Machine {
disabled @6 ();
}
admin @6 :Admin;
admin @12 :Admin;
interface Admin $CSharp.name("AdminInterface") {
forceSetState @0 ( state :MachineState );
forceSetUser @1 ( user :User );

View File

@ -12,12 +12,9 @@ using Role = import "role.capnp".Role;
struct User
{
struct UserInfo
{
id @0 :General.UUID;
username @1 :Text;
space @2 :Space;
}
struct UserInfoExtended
{
@ -32,42 +29,44 @@ struct User
}
}
info @0 :Info;
info @3 :Info;
interface Info $CSharp.name("InfoInterface") {
getUserInfo @0 () -> ( userInfo :UserInfo );
}
manage @1 :Manage;
interface Manage $CSharp.name("ManageInterface") {
getUserInfoExtended @0 () -> ( userInfoExtended :UserInfoExtended );
pwd @1 ( pwd :Text ) -> ();
addRole @2 ( role :Role ) -> ();
removeRole @3 ( role :Role ) -> ();
}
cardDESFire @2 :CardDESFire;
interface CardDESFire $CSharp.name("CardDESFireInterface") {
manage @4 :Manage;
interface Manage $CSharp.name("ManageInterface") {
pwd @0 ( pwd :Text ) -> ();
}
admin @5 :Admin;
interface Admin $CSharp.name("AdminInterface") {
addRole @0 ( role :Role ) -> ();
removeRole @1 ( role :Role ) -> ();
}
cardDESFireEV2 @6 :CardDESFireEV2;
interface CardDESFireEV2 $CSharp.name("CardDESFireInterface") {
# 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.
getPIDList @0 () -> ( pids :List(Text) );
# Get a list of all user URL currently bound to an user. This will generally be the number
getTokenList @0 () -> ( tokens :List(Data) );
# Get a list of all user Token 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.
genCardToken @1 () -> ( 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.
bind @2 ( url :Text, auth_key :Data ) -> ();
bind @2 ( token :Data, 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
unbind @3 ( token :Text ) -> ();
# Unbind the key associated with the given token. This will fail all future attempts to use
# the card with the associated key.
}
}