Skip to main content

QAbstractMFAChallengeStore

@quik/mfa


@quik/mfa / QAbstractMFAChallengeStore

Abstract Class: QAbstractMFAChallengeStore<TRepository>

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:12

Base challenge store for repository-backed implementations.

Implementors provide persistence primitives while this class keeps challenge lifecycle behavior (consume, cleanup, and compatibility with IQMFAChallengeStore) in one place.

Extends

  • QObject

Extended by

Type Parameters

TRepository

TRepository = unknown

Implements

Constructors

Constructor

new QAbstractMFAChallengeStore<TRepository>(repository): QAbstractMFAChallengeStore<TRepository>

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:21

Creates a repository-backed challenge store.

Parameters

repository

TRepository

Persistence dependency.

Returns

QAbstractMFAChallengeStore<TRepository>

Overrides

QObject.constructor

Properties

repository

protected readonly repository: TRepository

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:14

Persistence dependency used by concrete stores.

Accessors

logger

Get Signature

get protected logger(): IQLogger

Defined in: core/src/QObject.ts:15

The logger getter for the object.

Returns

IQLogger

Inherited from

QObject.logger


name

Get Signature

get name(): string

Defined in: core/src/QObject.ts:8

Returns

string

Inherited from

QObject.name

Methods

cleanup()

cleanup(now?): number

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:56

Removes expired or consumed challenges and returns the removal count.

Parameters

now?

number = ...

Returns

number

Implementation of

IQMFAChallengeStore.cleanup


clear()

clear(): void

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:52

Removes all challenges.

Returns

void

Implementation of

IQMFAChallengeStore.clear


clearChallenges()

abstract protected clearChallenges(): void

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:67

Removes all challenges.

Returns

void


consume()

consume(id): void

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:38

Marks a challenge as consumed.

Parameters

id

string

Returns

void

Implementation of

IQMFAChallengeStore.consume


endSpan()

protected endSpan(span): void

Defined in: core/src/QObject.ts:35

End a span returned by startSpan.

Parameters

span

TelemetrySpan

The span to end.

Returns

void

Inherited from

QObject.endSpan


fetchChallenge()

abstract protected fetchChallenge(id): QMFAChallenge

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:63

Fetches one challenge by id.

Parameters

id

string

Returns

QMFAChallenge


get()

get(id): QMFAChallenge

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:30

Returns a challenge by id.

Parameters

id

string

Returns

QMFAChallenge

Implementation of

IQMFAChallengeStore.get


persistChallenge()

abstract protected persistChallenge(challenge): QMFAChallenge

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:61

Persists a new or updated challenge.

Parameters

challenge

QMFAChallenge | Partial<QMFAChallenge>

Returns

QMFAChallenge


recordSpanError()

protected recordSpanError(span, err): void

Defined in: core/src/QObject.ts:45

Record an exception on an active span.

Parameters

span

TelemetrySpan

The span to record the error on.

err

unknown

The error to record.

Returns

void

Inherited from

QObject.recordSpanError


remove()

remove(id): void

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:48

Removes one challenge.

Parameters

id

string

Returns

void

Implementation of

IQMFAChallengeStore.remove


removeChallenge()

abstract protected removeChallenge(id): void

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:65

Removes one challenge by id.

Parameters

id

string

Returns

void


removeExpiredOrConsumed()

abstract protected removeExpiredOrConsumed(now): number

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:69

Removes expired or consumed challenges and returns the removal count.

Parameters

now

number

Returns

number


save()

save(challenge): QMFAChallenge

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:26

Stores a newly issued challenge.

Parameters

challenge

QMFAChallenge | Partial<QMFAChallenge>

Returns

QMFAChallenge

Implementation of

IQMFAChallengeStore.save


setSpanAttribute()

protected setSpanAttribute(span, key, value): void

Defined in: core/src/QObject.ts:64

Set a single attribute on an active span.

Parameters

span

TelemetrySpan

The span to update.

key

string

Attribute key.

value

string | number | boolean

Attribute value.

Returns

void

Inherited from

QObject.setSpanAttribute


startSpan()

protected startSpan(spanName, options?): TelemetrySpan

Defined in: core/src/QObject.ts:26

Start a telemetry span for the given operation name. Returns undefined when no telemetry provider is active.

Parameters

spanName

string

Name of the span.

options?

TelemetrySpanOptions

Optional span attributes and kind.

Returns

TelemetrySpan

Inherited from

QObject.startSpan


update()

update(challenge): QMFAChallenge

Defined in: mfa/src/store/challenges/QAbstractMFAChallengeStore.ts:34

Persists challenge state changes.

Parameters

challenge

QMFAChallenge | Partial<QMFAChallenge>

Returns

QMFAChallenge

Implementation of

IQMFAChallengeStore.update