Skip to main content

Class: BaseAccountRouteSQL

Defined in: auth/src/routes/sql/BaseAccountRouteSQL.ts:8

Provides a single set of routes for working with a user's account data in aggregate.

Extends​

Constructors​

Constructor​

new BaseAccountRouteSQL(): BaseAccountRouteSQL

Returns​

BaseAccountRouteSQL

Inherited from​

BaseAccountRoute.constructor

Properties​

aliasClass​

protected aliasClass: any = AliasSQL

Defined in: auth/src/routes/sql/BaseAccountRouteSQL.ts:9

Overrides​

BaseAccountRoute.aliasClass


aliasRepo?​

protected optional aliasRepo?: RepoUtils<AliasSQL>

Defined in: auth/src/routes/BaseAccountRoute.ts:65

Inherited from​

BaseAccountRoute.aliasRepo


auditLogUtils?​

protected optional auditLogUtils?: AuditLogUtils

Defined in: auth/src/routes/BaseAccountRoute.ts:60

Inherited from​

BaseAccountRoute.auditLogUtils


defaultScopes​

protected defaultScopes: string[] = []

Defined in: auth/src/routes/BaseAccountRoute.ts:42

Inherited from​

BaseAccountRoute.defaultScopes


jwtConfig?​

protected optional jwtConfig?: any

Defined in: auth/src/routes/BaseAccountRoute.ts:45

Inherited from​

BaseAccountRoute.jwtConfig


logger​

protected logger: any

Defined in: auth/src/routes/BaseAccountRoute.ts:51

Inherited from​

BaseAccountRoute.logger


messagingUtils?​

protected optional messagingUtils?: MessagingUtils

Defined in: auth/src/routes/BaseAccountRoute.ts:54

Inherited from​

BaseAccountRoute.messagingUtils


profileClass​

protected profileClass: any = ProfileSQL

Defined in: auth/src/routes/sql/BaseAccountRouteSQL.ts:10

Overrides​

BaseAccountRoute.profileClass


profileRepo?​

protected optional profileRepo?: RepoUtils<ProfileSQL>

Defined in: auth/src/routes/BaseAccountRoute.ts:66

Inherited from​

BaseAccountRoute.profileRepo


rateLimiter?​

protected optional rateLimiter?: RateLimiter

Defined in: auth/src/routes/BaseAccountRoute.ts:63

Inherited from​

BaseAccountRoute.rateLimiter


secretClass​

protected secretClass: any = SecretSQL

Defined in: auth/src/routes/sql/BaseAccountRouteSQL.ts:11

Overrides​

BaseAccountRoute.secretClass


secretRepo?​

protected optional secretRepo?: RepoUtils<SecretSQL>

Defined in: auth/src/routes/BaseAccountRoute.ts:67

Inherited from​

BaseAccountRoute.secretRepo


tokenUtils?​

protected optional tokenUtils?: TokenUtils

Defined in: auth/src/routes/BaseAccountRoute.ts:57

Inherited from​

BaseAccountRoute.tokenUtils


trustedProxies​

protected trustedProxies: string[] = []

Defined in: auth/src/routes/BaseAccountRoute.ts:71

Inherited from​

BaseAccountRoute.trustedProxies


trustedRoles​

protected trustedRoles: string[]

Defined in: auth/src/routes/BaseAccountRoute.ts:48

Inherited from​

BaseAccountRoute.trustedRoles


userClass​

protected userClass: any = UserSQL

Defined in: auth/src/routes/sql/BaseAccountRouteSQL.ts:12

Overrides​

BaseAccountRoute.userClass


userRepo?​

protected optional userRepo?: RepoUtils<UserSQL>

Defined in: auth/src/routes/BaseAccountRoute.ts:68

Inherited from​

BaseAccountRoute.userRepo

Methods​

cleanSecretData()​

protected cleanSecretData(obj): void

Defined in: auth/src/routes/BaseAccountRoute.ts:111

Removes the data property from the secret(s) to protect sensitive information.

Parameters​

obj​

SecretSQL | SecretSQL[]

Returns​

void

Inherited from​

BaseAccountRoute.cleanSecretData


delete()​

delete(id, req, user): Promise<any>

Defined in: auth/src/routes/BaseAccountRoute.ts:123

Parameters​

id​

string

req​

HttpRequest

user​

JWTUser

Returns​

Promise<any>

Inherited from​

BaseAccountRoute.delete


get()​

get(id, user): Promise<any>

Defined in: auth/src/routes/BaseAccountRoute.ts:167

Parameters​

id​

string

user​

JWTUser

Returns​

Promise<any>

Inherited from​

BaseAccountRoute.get


initialize()​

protected initialize(): Promise<void>

Defined in: auth/src/routes/BaseAccountRoute.ts:74

Returns​

Promise<void>

Inherited from​

BaseAccountRoute.initialize


resolveOwnedUid()​

protected resolveOwnedUid(id, user): string

Defined in: auth/src/routes/BaseAccountRoute.ts:263

Resolves id (handling the "me" keyword) and verifies the caller either owns the targeted account (targetUid === user.uid) or holds a trusted role. Throws 403 otherwise.

Parameters​

id​

string

user​

JWTUser

Returns​

string

Inherited from​

BaseAccountRoute.resolveOwnedUid


revokeSessions()​

revokeSessions(id, req, user): Promise<void>

Defined in: auth/src/routes/BaseAccountRoute.ts:221

Immediately revokes every outstanding refresh token for the account (self-service, or any account's if the caller holds a trusted role) — the standard "log out everywhere" action, e.g. after a suspected account compromise.

This does NOT invalidate an already-issued access token, which remains valid until its own natural (short) expiry regardless of this call — true immediate access-token revocation would require a persistent revocation check on every single request, which the underlying JWT verification (@rapidrest/service-core's JWTStrategy, an external package this library doesn't control) doesn't support; it does a stateless signature/expiry check only, with no per-request datastore lookup. What this does reliably stop going forward is BaseAuthRefreshRoute minting any new access token from a refresh token issued before this call — see the iat check there. This includes the caller's own current session: there is no "everywhere but here" variant, matching the equivalent behavior in most other systems that offer this action.

Parameters​

id​

string

req​

HttpRequest

user​

JWTUser

Returns​

Promise<void>

Inherited from​

BaseAccountRoute.revokeSessions