2021-02-01 23:23:12 +01:00
|
|
|
@0xc7941adf5db6bbf0;
|
|
|
|
|
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
|
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
|
2022-10-31 15:19:56 +01:00
|
|
|
using import "role.capnp".Role;
|
2021-02-01 23:23:12 +01:00
|
|
|
|
2022-10-31 15:19:56 +01:00
|
|
|
interface User {
|
2021-10-02 12:02:38 +02:00
|
|
|
# Intergalactic lifeform that wants to use BFFH
|
|
|
|
|
2022-11-04 16:15:56 +01:00
|
|
|
id @0 () -> ( id :Data );
|
|
|
|
# An opaque identifier for an user
|
|
|
|
|
|
|
|
name @1 () -> ( name :Text );
|
|
|
|
# The human-facing name identifying this user
|
|
|
|
|
|
|
|
roles @3 () -> ( roles :List(Role) );
|
|
|
|
# lists explicit roles for this user. A session may have a number of additional, implicit,
|
|
|
|
# roles set by their choice of authentication or other context.
|
2021-02-01 23:23:12 +01:00
|
|
|
|
2022-11-04 16:15:56 +01:00
|
|
|
selfservice @4 () -> ( selfservice :SelfService );
|
|
|
|
interface SelfService {
|
2021-10-02 12:18:28 +02:00
|
|
|
changepw @0 ( old :Text, new :Text );
|
2021-02-01 23:23:12 +01:00
|
|
|
}
|
|
|
|
|
2022-11-04 16:15:56 +01:00
|
|
|
manage @5 () -> ( manage :Manage );
|
2021-02-01 23:23:12 +01:00
|
|
|
interface Manage $CSharp.name("ManageInterface") {
|
2022-10-31 15:19:56 +01:00
|
|
|
addRole @0 ( role :Role );
|
|
|
|
removeRole @1 ( role :Role );
|
2021-08-27 21:42:36 +02:00
|
|
|
}
|
|
|
|
|
2022-11-04 16:15:56 +01:00
|
|
|
admin @6 () -> ( admin :Admin );
|
2021-08-27 21:42:36 +02:00
|
|
|
interface Admin $CSharp.name("AdminInterface") {
|
2021-10-02 12:02:38 +02:00
|
|
|
setpw @0 ( new :Text );
|
2021-08-26 23:52:36 +02:00
|
|
|
}
|
|
|
|
|
2022-11-04 16:15:56 +01:00
|
|
|
cardDESFireEV2 @7 () -> ( carddesfireev2 :CardDESFireEV2 );
|
2021-08-27 21:28:31 +02:00
|
|
|
interface CardDESFireEV2 $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-28 20:25:49 +02:00
|
|
|
# A card has several "applications", containing up to 32 files. A file can be read or
|
|
|
|
# written. Both kinds of access can be restricted to parties knowing a PSK, on a
|
|
|
|
# file-to-file basis.
|
|
|
|
# The current system uses File 0001 through File 0004:
|
|
|
|
#
|
|
|
|
# File 0001 allows public (i.e. unauthenticated) read access and contains the Strings
|
|
|
|
# "FABACCESS", "DESFIRE", and "1.0" as packed list of UTF-8 encoded zero-terminated strings:
|
|
|
|
# (i.e. "FABACCESS\0DESFIRE\01.0\0")
|
|
|
|
# This file serves as sort of magic identifier allowing a server to verify quickly if it is
|
|
|
|
# able to use this card at all.
|
|
|
|
#
|
|
|
|
# File 0002 too allows public read access and contains:
|
|
|
|
# - An URL-encoded name of the issuing lab as URN in the format "urn:fabaccess:lab:<labname>"
|
|
|
|
# Examples:
|
|
|
|
# - "urn:fabaccess:lab:innovisionlab"
|
|
|
|
# - "urn:fabaccess:lab:Bibliothek%20Neustadt%20Makerspace"
|
|
|
|
# - "urn:fabaccess:lab:Offene%20Werkstatt%20M%C3%A4rz"
|
|
|
|
# - A valid IRI pointing towards the bffd instance running for this lab. This uffd SHOULD be
|
|
|
|
# reachable from the internet. Using private use IP addresses or IRIs that resolve to such
|
|
|
|
# may be necessary for labs behind restrictive firewalls or due to local policy.
|
|
|
|
# The IRI MUST use the "fabaccess" scheme, and SHOULD NOT contain an userinfo, path, query,
|
|
|
|
# or fragment part.
|
|
|
|
# Examples:
|
|
|
|
# - "fabaccess://innovisionlab.de/"
|
|
|
|
# - "fabaccess://192.168.178.65"
|
|
|
|
# - "fabaccess://fabaccess-server.localnet"
|
|
|
|
# - A zero-terminated list of UTF-8 encoded IRIs giving contact options to notify the issuer
|
|
|
|
# or owner in case the card has been lost. Issuers SHOULD set one value on card creation and
|
|
|
|
# MAY allow card owners to change or add values of their choosing.
|
|
|
|
# Examples:
|
|
|
|
# - "mailto:lostcard@innovisionlab.de"
|
|
|
|
# - "https://innovisionlab.de/lostcard"
|
|
|
|
# - "https://werkstatt-märz.de/cardlost.php?action=submitcardlost"
|
|
|
|
#
|
|
|
|
# File 0003 allows public access or access using a key, at the issuers option.
|
|
|
|
# It contains a token that can be used by the home server of the card owner to identify the
|
|
|
|
# card owner. The format of the token MUST NOT be relied on by any party except the home
|
|
|
|
# server.
|
|
|
|
#
|
|
|
|
# File 0004 restricts read access to a single key known to the home server of the card
|
|
|
|
# owner.
|
|
|
|
# It is empty but by being access restricted allows the home server to validate the card as
|
|
|
|
# being genuine and thus finalizing the authentication of the user.
|
|
|
|
|
2021-08-29 11:51:37 +02:00
|
|
|
getTokenList @0 () -> ( token_list :List(Data) );
|
2021-08-28 19:32:29 +02:00
|
|
|
# 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 ) -> ();
|
2021-08-28 19:32:29 +02:00
|
|
|
# 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-28 20:39:17 +02:00
|
|
|
|
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.
|
2021-08-28 20:39:17 +02:00
|
|
|
|
|
|
|
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
|
|
|
}
|
2021-08-28 18:15:26 +02:00
|
|
|
}
|