Skip to main content

AuthDecorators

@quik/authorization


@quik/authorization / AuthDecorators

Variable: AuthDecorators

const AuthDecorators: object

Defined in: authorization/src/decorator.helpers.ts:162

Type Declaration

CanAccess

CanAccess: (...keys) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware decorator that ensures the authenticated user owns at least one of the provided permissions.

Parameters

keys

...string[]

Permission keys required to access the endpoint.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequireAllFactors

RequireAllFactors: (...factors) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware decorator that requires all provided authentication factors.

Parameters

factors

...string[]

Required factor keys.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequireAnyFactor

RequireAnyFactor: (...factors) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware decorator that requires at least one completed authentication factor.

Parameters

factors

...string[]

Allowed factor keys.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequireAssuranceLevel

RequireAssuranceLevel: (minimumLevel) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware decorator that enforces a minimum authentication assurance level.

Parameters

minimumLevel

number

Minimum assurance level required for access.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequiresAal

RequiresAal: (minimumLevel) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware alias that enforces a minimum AAL value.

Parameters

minimumLevel

number

Minimum assurance level required for access.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequiresFactor

RequiresFactor: (...factors) => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware alias that requires one matching factor.

Parameters

factors

...string[]

Allowed factor keys.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

RequiresMfa

RequiresMfa: () => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware alias requiring multi-factor strength via assurance level 2.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Unauthenticated

Unauthenticated: () => <This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>

Middleware decorator that blocks authenticated users from accessing the endpoint.

Returns

<This, Args, Return>(target, context) => MethodDecoratorType<This, Args, Return>