Abstract Class: BaseAccountRoute<U, A, P, S>
Defined in: auth/src/routes/BaseAccountRoute.ts:32
Provides a single set of routes for working with a user's account data in aggregate.
Extended by
Type Parameters
U
U extends User
A
A extends Alias
P
P extends Profile
S
S extends Secret
Constructors
Constructor
new BaseAccountRoute<
U,A,P,S>():BaseAccountRoute<U,A,P,S>
Returns
BaseAccountRoute<U, A, P, S>
Properties
aliasClass
abstractprotectedaliasClass:any
Defined in: auth/src/routes/BaseAccountRoute.ts:33
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<A>
Defined in: auth/src/routes/BaseAccountRoute.ts:65
auditLogUtils?
protectedoptionalauditLogUtils?:AuditLogUtils
Defined in: auth/src/routes/BaseAccountRoute.ts:60
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: auth/src/routes/BaseAccountRoute.ts:42
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: auth/src/routes/BaseAccountRoute.ts:45
logger
protectedlogger:any
Defined in: auth/src/routes/BaseAccountRoute.ts:51
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: auth/src/routes/BaseAccountRoute.ts:54
profileClass
abstractprotectedprofileClass:any
Defined in: auth/src/routes/BaseAccountRoute.ts:34
profileRepo?
protectedoptionalprofileRepo?:RepoUtils<P>
Defined in: auth/src/routes/BaseAccountRoute.ts:66
rateLimiter?
protectedoptionalrateLimiter?:RateLimiter
Defined in: auth/src/routes/BaseAccountRoute.ts:63
secretClass
abstractprotectedsecretClass:any
Defined in: auth/src/routes/BaseAccountRoute.ts:35
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<S>
Defined in: auth/src/routes/BaseAccountRoute.ts:67
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: auth/src/routes/BaseAccountRoute.ts:57
trustedProxies
protectedtrustedProxies:string[] =[]
Defined in: auth/src/routes/BaseAccountRoute.ts:71
trustedRoles
protectedtrustedRoles:string[]
Defined in: auth/src/routes/BaseAccountRoute.ts:48
userClass
abstractprotecteduserClass:any
Defined in: auth/src/routes/BaseAccountRoute.ts:36
userRepo?
protectedoptionaluserRepo?:RepoUtils<U>
Defined in: auth/src/routes/BaseAccountRoute.ts:68
Methods
cleanSecretData()
protectedcleanSecretData(obj):void
Defined in: auth/src/routes/BaseAccountRoute.ts:111
Removes the data property from the secret(s) to protect sensitive information.
Parameters
obj
S | S[]
Returns
void
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>
get()
get(
id,user):Promise<any>
Defined in: auth/src/routes/BaseAccountRoute.ts:167
Parameters
id
string
user
JWTUser
Returns
Promise<any>
initialize()
protectedinitialize():Promise<void>
Defined in: auth/src/routes/BaseAccountRoute.ts:74
Returns
Promise<void>
resolveOwnedUid()
protectedresolveOwnedUid(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
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>