| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679 |
- /* spry-0.2.vapi generated by valac 0.56.19, do not modify. */
- [CCode (gir_namespace = "spry", gir_version = "0.2")]
- 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_common_message { get; }
- protected virtual string password_too_long_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_common_message { get; }
- protected virtual string password_too_long_message { get; }
- protected virtual string password_too_short_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class CreateProviderAction : Spry.Actions.ProviderManagementAction {
- public CreateProviderAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string created_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class DeleteProviderAction : Spry.Actions.ProviderManagementAction {
- public DeleteProviderAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string deleted_message { get; }
- protected virtual string id_required_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 class PasswordPolicy : GLib.Object {
- public enum Rejection {
- TOO_SHORT,
- TOO_LONG,
- TOO_COMMON
- }
- public const int ADMIN_MIN_LENGTH;
- public const string[] DENY_LIST;
- public const int MAX_LENGTH;
- public const int MIN_LENGTH;
- public PasswordPolicy ();
- public static Spry.Actions.ProfileValidation.PasswordPolicy.Rejection? assess (string password);
- public static bool is_denied (string password);
- }
- 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 string internal_error_message (GLib.Error e, string message);
- public static string password_rejection_message (Spry.Actions.ProfileValidation.PasswordPolicy.Rejection rejection, string too_short_message, string too_long_message, string too_common_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 abstract class ProviderManagementAction : Statum.StatumAction {
- protected Spry.Sso.ProviderService providers;
- protected ProviderManagementAction ();
- protected string form_auth_method ();
- protected string form_client_id ();
- protected string form_client_secret ();
- protected string form_display_name ();
- protected bool form_enabled ();
- protected string form_issuer ();
- protected string form_scope ();
- protected string form_slug ();
- protected Statum.DirectiveBuilder invalid (GLib.Error e);
- protected async Statum.DirectiveBuilder? require_permission_guard ();
- protected int64 target_provider_id ();
- protected virtual string required_permission { get; }
- protected virtual string unauthorised_uri { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class PushSubscribeAction : Statum.StatumAction {
- public PushSubscribeAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string invalid_subscription_message { get; }
- protected virtual string login_uri { get; }
- protected virtual string subscribe_failed_message { get; }
- protected virtual string subscribed_message { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class PushUnsubscribeAction : Statum.StatumAction {
- public PushUnsubscribeAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string endpoint_required_message { get; }
- protected virtual string login_uri { get; }
- protected virtual string unsubscribe_failed_message { get; }
- protected virtual string unsubscribed_message { get; }
- }
- [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_common_message { get; }
- protected virtual string password_too_long_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 SetProviderEnabledAction : Spry.Actions.ProviderManagementAction {
- public SetProviderEnabledAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string id_required_message { get; }
- protected virtual string toggled_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 abstract class SsoAction : Statum.StatumAction {
- protected Spry.Sso.SsoService sso;
- protected SsoAction ();
- protected Statum.DirectiveBuilder login_failed (GLib.Error e, string slug);
- protected string redirect_uri_for (string slug);
- protected string request_origin ();
- protected virtual string login_failed_message { get; }
- protected Astralis.HttpContext? request_http { get; private set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SsoLoginAction : Spry.Actions.SsoAction {
- public SsoLoginAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UpdateProviderAction : Spry.Actions.ProviderManagementAction {
- public UpdateProviderAction ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected virtual string id_required_message { get; }
- protected virtual string updated_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 M0002_SessionsValidAfter : InvercargillSql.Migrations.Migration {
- public M0002_SessionsValidAfter ();
- 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 static GLib.DateTime EPOCH { get; }
- public GLib.DateTime created { get; set; }
- public GLib.DateTime date_of_birth { get; set; }
- public GLib.DateTime effective_sessions_valid_after { get; }
- 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 GLib.DateTime? sessions_valid_after { 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 GLib.DateTime effective_sessions_valid_after { get; }
- 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 GLib.DateTime? sessions_valid_after { get; set; }
- public string surname { get; set; }
- public string username { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserService : GLib.Object {
- public struct HashParameters {
- public string algorithm;
- public int version;
- public int64 memory;
- public int64 passes;
- public int64 parallelism;
- }
- 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 static bool frame_is_valid_at (Spry.Authentication.UserProjection user, GLib.DateTime as_at);
- 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 static bool hash_needs_rehash (string hash_text);
- public async Invercargill.ImmutableLot<Spry.Authentication.UserProjection> list_users (int64 offset = 0, int64 limit = 100) throws GLib.Error;
- public static Spry.Authentication.UserService.HashParameters? parse_hash_parameters (string hash_text);
- 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 rehash_password (int64 user_id, string password) throws GLib.Error;
- public async void remove_user_permission (int64 user_id, string permission) throws GLib.Error;
- public static GLib.DateTime session_epoch_now ();
- 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
- }
- }
- namespace Push {
- namespace Migrations {
- [CCode (cheader_filename = "spry-0.2.h")]
- public class M0003_PushSubscriptions : InvercargillSql.Migrations.Migration {
- public M0003_PushSubscriptions ();
- 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 PushSender : GLib.Object {
- public Astralis.WebConfig? config;
- public const int ATTEMPTS;
- public const string DEFAULT_SUBJECT;
- public const int DEFAULT_TTL_SECONDS;
- public const uint RETRY_DELAY_MS;
- public PushSender ();
- public bool is_configured ();
- public void reload ();
- public async Spry.Push.DeliveryOutcome send_to_subscription (Spry.Push.PushService pushes, Spry.Push.PushSubscriptionEntity row, string payload, int ttl_seconds) throws GLib.Error;
- public async Spry.Push.DeliveryOutcome[] send_to_user (Spry.Push.PushService pushes, int64 user_id, string payload, int ttl_seconds = DEFAULT_TTL_SECONDS) throws GLib.Error;
- public string vapid_public_key ();
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class PushService : GLib.Object {
- public PushService ();
- public async void forget (int64 subscription_id) throws GLib.Error;
- public async Spry.Push.PushSubscriptionEntity? get_by_endpoint (string endpoint) throws GLib.Error;
- public async Spry.Push.PushSubscriptionEntity subscribe (int64 user_id, string endpoint, string p256dh_b64, string auth_b64) throws GLib.Error;
- public async Invercargill.ImmutableLot<Spry.Push.PushSubscriptionEntity> subscriptions_for (int64 user_id) throws GLib.Error;
- public async bool unsubscribe (int64 user_id, string endpoint) throws GLib.Error;
- public async int unsubscribe_for_user (int64 user_id) throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class PushSubscriptionEntity : GLib.Object {
- public PushSubscriptionEntity ();
- public static void entity_mapping (InvercargillSql.Orm.EntityMapperBuilder<Spry.Push.PushSubscriptionEntity> cfg);
- public Locksmith.WebPush.Subscription to_subscription () throws Locksmith.Error;
- public string auth { get; set; }
- public GLib.DateTime created { get; set; }
- public string endpoint { get; set; }
- public int64 id { get; set; }
- public string p256dh { get; set; }
- public int64 user_id { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public enum DeliveryOutcome {
- DELIVERED,
- UNAUTHORIZED,
- GONE,
- RETRYABLE,
- SKIPPED
- }
- }
- namespace Resources {
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryCss : Statum.ConstantStatumResource {
- public SpryCss ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryPushJs : Statum.ConstantStatumResource {
- public SpryPushJs ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeAiry : Statum.ConstantStatumResource {
- public SpryThemeAiry ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeDwarf : Statum.ConstantStatumResource {
- public SpryThemeDwarf ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeFormal : Statum.ConstantStatumResource {
- public SpryThemeFormal ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeGlassy : Statum.ConstantStatumResource {
- public SpryThemeGlassy ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeH2o : Statum.ConstantStatumResource {
- public SpryThemeH2o ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeLivingSky : Statum.ConstantStatumResource {
- public SpryThemeLivingSky ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SpryThemeModern : Statum.ConstantStatumResource {
- public SpryThemeModern ();
- public override string get_best_encoding (Invercargill.Set<string> supported);
- public override unowned uint8[] get_encoding (string encoding);
- public override string content_type { get; }
- public override string file_hash { get; }
- public override string name { get; }
- }
- }
- namespace Sso {
- namespace Migrations {
- [CCode (cheader_filename = "spry-0.2.h")]
- public class M0004_OAuthProviders : InvercargillSql.Migrations.Migration {
- public M0004_OAuthProviders ();
- 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 M0005_OAuthIdentities : InvercargillSql.Migrations.Migration {
- public M0005_OAuthIdentities ();
- 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 LoginAttempt : GLib.Object {
- public LoginAttempt ();
- public string authorize_uri { get; set; }
- public Spry.Sso.SsoService.SsoPrivate private_data { get; set; }
- public string provider_slug { get; set; }
- public Spry.Sso.SsoService.SsoPublic public_data { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class LoginMode : GLib.Object {
- public enum Mode {
- PLAIN,
- HYBRID,
- SSO_ONLY
- }
- public LoginMode ();
- public static Spry.Sso.LoginMode resolve (Astralis.WebConfig? config);
- public bool is_hybrid { get; }
- public bool is_plain { get; }
- public bool is_sso_only { get; }
- public Spry.Sso.LoginMode.Mode mode { get; private set; }
- public string provider { get; private set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class OAuthIdentityEntity : GLib.Object {
- public OAuthIdentityEntity ();
- public static void entity_mapping (InvercargillSql.Orm.EntityMapperBuilder<Spry.Sso.OAuthIdentityEntity> cfg);
- public GLib.DateTime created { get; set; }
- public int64 id { get; set; }
- public string provider_slug { get; set; }
- public string subject { get; set; }
- public int64 user_id { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class OAuthProviderEntity : GLib.Object {
- public const string DEFAULT_AUTH_METHOD;
- public const string DEFAULT_SCOPE;
- public OAuthProviderEntity ();
- public Locksmith.OAuth2.ClientAuthentication.Method authentication_method () throws Locksmith.Error;
- public static void entity_mapping (InvercargillSql.Orm.EntityMapperBuilder<Spry.Sso.OAuthProviderEntity> cfg);
- public string auth_method { get; set; }
- public string client_id { get; set; }
- public string client_secret { get; set; }
- public GLib.DateTime created { get; set; }
- public string display_name { get; set; }
- public string effective_scope { get; }
- public bool enabled { get; set; }
- public int64 id { get; set; }
- public string issuer { get; set; }
- public GLib.DateTime modified { get; set; }
- public string scope { get; set; }
- public string slug { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class ProviderService : GLib.Object {
- public const string SLUG_ALPHABET;
- public ProviderService ();
- public async Spry.Sso.OAuthProviderEntity create_provider (string slug, string display_name, string issuer, string client_id, string client_secret, string scope = "", string auth_method = "", bool enabled = true) throws GLib.Error;
- public async int delete_identities_for_user (int64 user_id) throws GLib.Error;
- public async void delete_provider (int64 provider_id, bool delete_identities = false) throws GLib.Error;
- public async Spry.Sso.OAuthProviderEntity? get_by_id (int64 provider_id) throws GLib.Error;
- public async Spry.Sso.OAuthProviderEntity? get_by_slug (string slug) throws GLib.Error;
- public async Invercargill.ImmutableLot<Spry.Sso.OAuthProviderEntity> list_enabled_providers () throws GLib.Error;
- public async Invercargill.ImmutableLot<Spry.Sso.OAuthProviderEntity> list_providers () throws GLib.Error;
- public async Spry.Sso.OAuthProviderEntity set_enabled (int64 provider_id, bool enabled) throws GLib.Error;
- public async Spry.Sso.OAuthProviderEntity update_provider (int64 provider_id, string slug, string display_name, string issuer, string client_id, string client_secret, string scope = "", string auth_method = "", bool enabled = true) throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SsoHttpClient : GLib.Object {
- public const uint CACHE_TTL_SECONDS;
- public const string OAUTH_WELL_KNOWN;
- public const string OIDC_WELL_KNOWN;
- public const uint TIMEOUT_SECONDS;
- public SsoHttpClient ();
- public async Locksmith.OAuth2.IssuerMetadata discover (string slug, string issuer) throws GLib.Error;
- public async string get_json (string userinfo_endpoint, string access_token) throws GLib.Error;
- public async string post_form (string token_endpoint, Locksmith.OAuth2.TokenRequest.Parts parts) throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SsoService : GLib.Object {
- public class SsoPrivate : GLib.Object {
- public SsoPrivate ();
- public string provider { get; set; }
- public string state { get; set; }
- public string verifier { get; set; }
- }
- public class SsoPublic : GLib.Object {
- public SsoPublic ();
- public string provider { get; set; }
- }
- public const string SSO_SLOT_TYPE;
- public SsoService ();
- public async Spry.Sso.LoginAttempt begin_login (string slug, string redirect_uri) throws GLib.Error;
- public async Spry.Authentication.UserProjection complete_login (Spry.Sso.SsoService.SsoPrivate held, string code, string state, string redirect_uri) throws GLib.Error;
- public async Locksmith.OAuth2.IssuerMetadata discover (Spry.Sso.OAuthProviderEntity provider) throws GLib.Error;
- public async Spry.Sso.UserInfo fetch_userinfo (Spry.Sso.OAuthProviderEntity provider, Locksmith.OAuth2.IssuerMetadata metadata, string access_token) throws GLib.Error;
- public async Spry.Sso.OAuthProviderEntity require_provider (string slug) throws GLib.Error;
- public async Spry.Authentication.UserProjection resolve_identity (string provider_slug, Spry.Sso.UserInfo userinfo) throws GLib.Error;
- public async string unique_username (string candidate) throws GLib.Error;
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class UserInfo : GLib.Object {
- public UserInfo ();
- public string email { get; set; }
- public string family_name { get; set; }
- public string given_name { get; set; }
- public string sub { get; set; }
- public string username { get; set; }
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public errordomain ProviderError {
- NOT_FOUND,
- DUPLICATE_SLUG,
- INVALID
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public errordomain SsoError {
- UNKNOWN_PROVIDER,
- PROVIDER_DISABLED,
- DISCOVERY_FAILED,
- TOKEN_EXCHANGE_FAILED,
- USERINFO_FAILED,
- ACCOUNT_UNAVAILABLE,
- CRYPTO
- }
- }
- [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 Spry.Sso.LoginMode login_mode (Astralis.WebConfig? config);
- public static bool permission_matches (string[] patterns, string permission);
- public static void register_actions (Statum.StatumConfigurator cfg);
- public static Statum.DirectiveBuilder relogin (Statum.DirectiveBuilder directives, Spry.Authentication.UserProjection user, Statum.ActionRegistry action_registry) throws GLib.Error;
- 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 ();
- }
- [CCode (cheader_filename = "spry-0.2.h")]
- public class SsoCallbackEntrypoint : Statum.StatumEntrypoint {
- public const string SSO_SLOT_TYPE;
- public SsoCallbackEntrypoint ();
- public override async Statum.DirectiveBuilder handle () throws GLib.Error;
- protected string request_origin ();
- public virtual string failure_uri { get; }
- public virtual string landing_uri { get; }
- public virtual string login_failed_message { get; }
- }
- }
|