Skip to main content

QAbstractOAuthConsentStore

@quik/oauth-server


@quik/oauth-server / QAbstractOAuthConsentStore

Abstract Class: QAbstractOAuthConsentStore<TRepository>

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:14

Base consent store for repository-backed implementations.

Implementors provide persistence primitives while this class keeps consent lifecycle behavior (revoke, cleanup, and compatibility with IQOAuthConsentStore) in one place.

Extends

  • QObject

Extended by

Type Parameters

TRepository

TRepository = unknown

Implements

Constructors

Constructor

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

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:23

Creates a repository-backed consent store.

Parameters

repository

TRepository

Persistence dependency.

Returns

QAbstractOAuthConsentStore<TRepository>

Overrides

QObject.constructor

Properties

repository

protected readonly repository: TRepository

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:16

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: oauth-server/src/store/QAbstractOAuthConsentStore.ts:58

Removes revoked entries and returns removed count.

Parameters

now?

number = ...

Returns

number

Implementation of

IQOAuthConsentStore.cleanup


clear()

clear(): void

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:54

Clears all consents.

Returns

void

Implementation of

IQOAuthConsentStore.clear


clearConsents()

abstract protected clearConsents(): void

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:71

Removes all consents.

Returns

void


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


fetchConsent()

abstract protected fetchConsent(id): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:65

Fetches one consent by id.

Parameters

id

string

Returns

QOAuthConsent


find()

find(clientId, userId): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:36

Returns one consent by client/user pair.

Parameters

clientId

string

userId

string

Returns

QOAuthConsent

Implementation of

IQOAuthConsentStore.find


findConsent()

abstract protected findConsent(clientId, userId): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:67

Finds one consent by client/user pair.

Parameters

clientId

string

userId

string

Returns

QOAuthConsent


get()

get(id): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:32

Returns one consent by id.

Parameters

id

string

Returns

QOAuthConsent

Implementation of

IQOAuthConsentStore.get


persistConsent()

abstract protected persistConsent(consent): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:63

Persists a new or updated consent.

Parameters

QOAuthConsent

Returns

QOAuthConsent


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: oauth-server/src/store/QAbstractOAuthConsentStore.ts:50

Removes one consent entry.

Parameters

id

string

Returns

void

Implementation of

IQOAuthConsentStore.remove


removeConsent()

abstract protected removeConsent(id): void

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:69

Removes one consent by id.

Parameters

id

string

Returns

void


removeRevoked()

abstract protected removeRevoked(now): number

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:73

Removes revoked consent entries and returns the removal count.

Parameters

now

number

Returns

number


revoke()

revoke(id): void

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:40

Marks one consent as revoked.

Parameters

id

string

Returns

void

Implementation of

IQOAuthConsentStore.revoke


save()

save(consent): QOAuthConsent

Defined in: oauth-server/src/store/QAbstractOAuthConsentStore.ts:28

Persists one consent entry.

Parameters

QOAuthConsent

Returns

QOAuthConsent

Implementation of

IQOAuthConsentStore.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