2021-10-01 20:06:06 +02:00
|
|
|
@0x9a05e95f65f2edda;
|
|
|
|
|
|
|
|
using CSharp = import "programming_language/csharp.capnp";
|
|
|
|
$CSharp.namespace("FabAccessAPI.Schema");
|
|
|
|
|
2022-11-01 11:54:01 +01:00
|
|
|
using import "user.capnp".User;
|
2024-04-16 15:03:10 +02:00
|
|
|
using import "utils.capnp".Fallible;
|
2021-10-01 20:06:06 +02:00
|
|
|
|
2022-10-31 15:19:56 +01:00
|
|
|
interface Users {
|
2022-11-04 15:23:25 +01:00
|
|
|
list @0 () -> ( users :List(User) );
|
2021-10-01 20:06:06 +02:00
|
|
|
|
2024-04-16 15:03:10 +02:00
|
|
|
addUser @1 ( username :Text ) -> Fallible(AddUserOk, AddUserError);
|
|
|
|
struct AddUserOk {
|
|
|
|
user @0 :User;
|
|
|
|
initialPassword @1 :Text;
|
|
|
|
}
|
|
|
|
struct AddUserError {
|
|
|
|
union {
|
|
|
|
ok @0 :Void;
|
|
|
|
# This error is not actually set, i.e. the operation completed successfully.
|
|
|
|
# This field is necessary because a NULL struct pointer may be interpreted as a struct with
|
|
|
|
# default values. In that case this will appear as an `Error` with the `ok` field set.
|
|
|
|
|
|
|
|
exists @1 :Void;
|
|
|
|
# There is already an user with the requested username
|
|
|
|
|
|
|
|
usernameInvalid @2 :Void;
|
|
|
|
# The provided username is not usable, e.g. contains invalid characters, is too long, or too
|
|
|
|
# short.
|
|
|
|
|
|
|
|
passwordInvalid @3 :Void;
|
|
|
|
# The provided password is not usable, e.g. it's zero-length.
|
|
|
|
}
|
|
|
|
}
|
2022-11-04 15:54:15 +01:00
|
|
|
|
2024-04-16 15:03:10 +02:00
|
|
|
removeUser @2 ( user :User ) -> Fallible(RemoveUserOk, RemoveUserError);
|
|
|
|
struct RemoveUserOk {
|
2022-11-04 15:54:15 +01:00
|
|
|
|
2024-04-16 15:03:10 +02:00
|
|
|
}
|
|
|
|
struct RemoveUserError {
|
|
|
|
union {
|
|
|
|
permissionDenied @0 :Void;
|
|
|
|
userAlreadyDeleted @1 :Void;
|
|
|
|
}
|
2022-11-04 15:54:15 +01:00
|
|
|
}
|
|
|
|
}
|