zibri
    Preparing search index...

    Interface AuthStrategyInterface<RoleType, UserType, AuthDataType, CredentialType, RequestPasswordResetDataType, ConfirmPasswordResetDataType, RefreshLoginDataType>

    Interface for an auth strategy.

    interface AuthStrategyInterface<
        RoleType extends string,
        UserType extends BaseUser<RoleType>,
        AuthDataType,
        CredentialType,
        RequestPasswordResetDataType,
        ConfirmPasswordResetDataType,
        RefreshLoginDataType,
    > {
        belongsTo: <TargetEntity extends Newable<BaseEntity>>(
            request: HttpRequest,
            targetEntity: TargetEntity,
            targetUserIdKey: keyof InstanceType<TargetEntity>,
            targetIdParamKey: string,
        ) => Promise<boolean>;
        confirmPasswordReset: (
            data: ConfirmPasswordResetDataType,
        ) => void | Promise<void>;
        hasRole: (
            request: HttpRequest,
            allowedRoles: RoleType[],
        ) => Promise<boolean>;
        init: () => void;
        isLoggedIn: (request: HttpRequest) => Promise<boolean>;
        login: (credentials: CredentialType) => Promise<AuthDataType>;
        name: string;
        refreshLogin: (data: RefreshLoginDataType) => Promise<AuthDataType>;
        requestPasswordReset: (
            data: RequestPasswordResetDataType,
        ) => void | Promise<void>;
        resolveUser: (request: HttpRequest) => Promise<undefined | UserType>;
        securityScheme: SecuritySchemeObject;
    }

    Type Parameters

    • RoleType extends string
    • UserType extends BaseUser<RoleType>
    • AuthDataType
    • CredentialType
    • RequestPasswordResetDataType
    • ConfirmPasswordResetDataType
    • RefreshLoginDataType

    Implemented by

    Index

    Properties

    belongsTo: <TargetEntity extends Newable<BaseEntity>>(
        request: HttpRequest,
        targetEntity: TargetEntity,
        targetUserIdKey: keyof InstanceType<TargetEntity>,
        targetIdParamKey: string,
    ) => Promise<boolean>

    Checks whether a currently logged belongs to the requested resource.

    confirmPasswordReset: (
        data: ConfirmPasswordResetDataType,
    ) => void | Promise<void>

    Confirms a new password for a user using the provided confirm password reset data.

    hasRole: (request: HttpRequest, allowedRoles: RoleType[]) => Promise<boolean>

    Checks whether a currently logged in user has one of the provided roles.

    init: () => void

    Initializes the strategy.

    isLoggedIn: (request: HttpRequest) => Promise<boolean>

    Checks whether a user is currently logged in.

    login: (credentials: CredentialType) => Promise<AuthDataType>

    Logs in a user.

    name: string

    The name of the auth strategy.

    refreshLogin: (data: RefreshLoginDataType) => Promise<AuthDataType>

    Refreshes the login of a user.

    requestPasswordReset: (
        data: RequestPasswordResetDataType,
    ) => void | Promise<void>

    Request a new password for a user using the request password reset data.

    resolveUser: (request: HttpRequest) => Promise<undefined | UserType>

    Resolves the current user.

    securityScheme: SecuritySchemeObject

    The security scheme object to be used by open api.