| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- /* spry-0.2.vapi generated by valac 0.56.19, do not modify. */
- namespace Spry {
- namespace Actions {
- [CCode (cheader_filename = "spry-0.2.h")]
- public class AlterUserAction : Spry.Actions.UserManagementAction {
- public AlterUserAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string date_of_birth_required_message { get; }
- protected virtual string duplicate_email_message { get; }
- protected virtual string duplicate_user_message { get; }
- protected virtual string duplicate_username_message { get; }
- protected virtual string invalid_date_of_birth_message { get; }
- protected virtual string invalid_email_message { get; }
- protected virtual string name_required_message { get; }
- protected virtual string password_too_short_message { get; }
- protected virtual string self_alter_message { get; }
- protected virtual string update_failed_message { get; }
- protected virtual string user_required_message { get; }
- protected virtual string user_updated_message { get; }
- protected virtual string username_too_short_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class ChangePasswordAction : Statum.StatumAction {
- public ChangePasswordAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string change_failed_message { get; }
- protected virtual string current_password_invalid_message { get; }
- protected virtual string current_password_required_message { get; }
- protected virtual string login_uri { get; }
- protected virtual string password_changed_message { get; }
- protected virtual string password_mismatch_message { get; }
- protected virtual string password_too_short_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class DeleteUserAction : Spry.Actions.UserManagementAction {
- public DeleteUserAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string delete_failed_message { get; }
- protected virtual string self_delete_message { get; }
- protected virtual string user_deleted_message { get; }
- protected virtual string user_required_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class GrantPermissionAction : Spry.Actions.UserManagementAction {
- public GrantPermissionAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string grant_failed_message { get; }
- protected virtual string permission_granted_message { get; }
- protected virtual string permission_required_message { get; }
- protected virtual string user_required_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class LoginAction : Statum.StatumAction {
- public LoginAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string invalid_credentials_message { get; }
- protected virtual string landing_uri { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class LogoutAction : Statum.StatumAction {
- public LogoutAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string logged_out_uri { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class ProfileValidation : GLib.Object {
- public class Fields : GLib.Object {
- public GLib.DateTime date_of_birth { get; private set; }
- public string email { get; private set; }
- public string forename { get; private set; }
- public string surname { get; private set; }
- public string username { get; private set; }
- }
- public enum Rejection {
- USERNAME_TOO_SHORT,
- INVALID_EMAIL,
- NAME_REQUIRED,
- DATE_OF_BIRTH_REQUIRED,
- INVALID_DATE_OF_BIRTH
- }
- public ProfileValidation ();
- public static string? duplicate_message (GLib.Error e, string username_message, string email_message, string other_message);
- public static Spry.Actions.ProfileValidation.Fields? validate (Statum.StatumRequest request, out Spry.Actions.ProfileValidation.Rejection rejection);
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class RegisterAction : Statum.StatumAction {
- public RegisterAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string account_created_message { get; }
- protected virtual string date_of_birth_required_message { get; }
- protected virtual string duplicate_email_message { get; }
- protected virtual string duplicate_user_message { get; }
- protected virtual string duplicate_username_message { get; }
- protected virtual string invalid_date_of_birth_message { get; }
- protected virtual string invalid_email_message { get; }
- protected virtual string login_uri { get; }
- protected virtual string name_required_message { get; }
- protected virtual string password_mismatch_message { get; }
- protected virtual string password_too_short_message { get; }
- protected virtual string registration_failed_message { get; }
- protected virtual string username_too_short_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class RevokePermissionAction : Spry.Actions.UserManagementAction {
- public RevokePermissionAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string permission_required_message { get; }
- protected virtual string permission_revoked_message { get; }
- protected virtual string revoke_failed_message { get; }
- protected virtual string user_required_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SetUserEnabledAction : Spry.Actions.UserManagementAction {
- public SetUserEnabledAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string update_failed_message { get; }
- protected virtual string user_disabled_message { get; }
- protected virtual string user_enabled_message { get; }
- protected virtual string user_required_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserActionPrivate : GLib.Object {
- public UserActionPrivate ();
- public int64 user_id { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public abstract class UserManagementAction : Statum.StatumAction {
- protected Spry.Authentication.UserService users;
- protected UserManagementAction ();
- protected async Statum.DirectiveBuilder? require_permission_guard ();
- protected string target_permission ();
- protected int64 target_user_id ();
- protected override string private_namespace { get; }
- protected virtual string required_permission { get; }
- protected virtual string unauthorised_uri { get; }
- }
- }
- namespace Authentication {
- namespace Migrations {
- [CCode (cheader_filename = "spry-0.2.h")]
- public class M0001_Initial : InvercargillSql.Migrations.Migration {
- public M0001_Initial ();
- public override void down (InvercargillSql.Migrations.MigrationBuilder b);
- public override void up (InvercargillSql.Migrations.MigrationBuilder b);
- public override string migration_namespace { get; }
- public override string name { get; }
- public override uint64 serial { get; }
- }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserEntity : GLib.Object {
- public UserEntity ();
- public static void entity_mapping (InvercargillSql.Orm.EntityMapperBuilder<Spry.Authentication.UserEntity> cfg);
- public GLib.DateTime created { get; set; }
- public GLib.DateTime date_of_birth { get; set; }
- public string email { get; set; }
- public bool enabled { get; set; }
- public string forename { get; set; }
- public int64 id { get; set; }
- public GLib.DateTime modified { get; set; }
- public string password_hash { get; set; }
- public string surname { get; set; }
- public string username { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserPermissionEntity : GLib.Object {
- public UserPermissionEntity ();
- public static void entity_mapping (InvercargillSql.Orm.EntityMapperBuilder<Spry.Authentication.UserPermissionEntity> cfg);
- public int64 id { get; set; }
- public string permission { get; set; }
- public int64 user_id { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserProjection : GLib.Object {
- public UserProjection ();
- public static void projection_mapping (InvercargillSql.Orm.Projections.ProjectionBuilder<Spry.Authentication.UserProjection> cfg) throws GLib.Error;
- public GLib.DateTime created { get; set; }
- public GLib.DateTime date_of_birth { get; set; }
- public string email { get; set; }
- public bool enabled { get; set; }
- public string forename { get; set; }
- public int64 id { get; set; }
- public GLib.DateTime modified { get; set; }
- public string password_hash { get; set; }
- public Invercargill.ImmutableLot<string> permissions { owned get; }
- public string surname { get; set; }
- public string username { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserService : GLib.Object {
- public UserService ();
- public async Spry.Authentication.UserEntity alter_user (int64 user_id, string username, string email, string forename, string surname, GLib.DateTime date_of_birth, bool enabled) throws GLib.Error;
- public async Spry.Authentication.UserProjection? authenticate_user (string username, string password) throws GLib.Error;
- public async void clear_user_permissions (int64 user_id) throws GLib.Error;
- public async void delete_user (int64 user_id) throws GLib.Error;
- public async Spry.Authentication.UserProjection? get_user (int64 user_id) throws GLib.Error;
- public async Spry.Authentication.UserProjection? get_user_by_username (string username) throws GLib.Error;
- public async Invercargill.ImmutableLot<string> get_user_permissions (int64 user_id) throws GLib.Error;
- public async Invercargill.ImmutableLot<Spry.Authentication.UserProjection> list_users (int64 offset = 0, int64 limit = 100) throws GLib.Error;
- public async Spry.Authentication.UserEntity register_user (string username, string email, string forename, string surname, GLib.DateTime date_of_birth, string password, bool enabled = true) throws GLib.Error;
- public async void remove_user_permission (int64 user_id, string permission) throws GLib.Error;
- public async void set_password (int64 user_id, string password) throws GLib.Error;
- public async void set_user_enabled (int64 user_id, bool enabled) throws GLib.Error;
- public async void set_user_permission (int64 user_id, string permission) throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public errordomain UserServiceError {
- USER_NOT_FOUND
- }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class AuthPrivate : GLib.Object {
- public AuthPrivate ();
- public int64 user_id { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class AuthPublic : GLib.Object {
- public AuthPublic ();
- public string display_name { get; set; }
- public Statum.Model.ActionDto? logout { get; set; }
- public string[] permissions { get; set; }
- public string username { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class CurrentUser : GLib.Object {
- public CurrentUser ();
- public CurrentUser.authenticated (int64 user_id, string username, string display_name, string[] permissions);
- public bool has_permission (string permission);
- public string display_name { get; private set; }
- public bool is_anonymous { get; private set; }
- public string[] permissions { get; private set; }
- public int64 user_id { get; private set; }
- public string username { get; private set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryAuth : GLib.Object {
- public const string ADMIN_PERMISSION;
- public const string SLOT_TYPE;
- public SpryAuth ();
- public static Spry.CurrentUser current (Statum.StatumRequest request);
- public static async void ensure_admin (Spry.Authentication.UserService users, string username, string email, string password) throws GLib.Error;
- public static Statum.DirectiveBuilder login (Statum.DirectiveBuilder directives, Spry.Authentication.UserProjection user, Statum.ActionRegistry action_registry) throws GLib.Error;
- public static bool permission_matches (string[] patterns, string permission);
- public static void register_actions (Statum.StatumConfigurator cfg);
- public static async Statum.DirectiveBuilder? require_login (Statum.DirectiveBuilder directives, Statum.StatumRequest request, Spry.Authentication.UserService users, string redirect = "/login");
- public static async Statum.DirectiveBuilder? require_permission (Statum.DirectiveBuilder directives, Statum.StatumRequest request, Spry.Authentication.UserService users, string permission, string redirect = "/login");
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryModule : GLib.Object, Inversion.Module {
- public SpryModule ();
- }
- }
|