Abstract Class: BaseImpersonationRoute<U>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:45
A set of routes allowing a trusted user the ability to temporarily impersonate any other user in the system without needing to explicitly log in to that user's account or know their login credentials.
This mints a (non-elevated) token for the target user with the same roles and scopes that the target user would acquire after a normal login.
Extended by
Type Parameters
U
U extends User
Constructors
Constructor
new BaseImpersonationRoute<
U>():BaseImpersonationRoute<U>
Returns
BaseImpersonationRoute<U>
Properties
auditLogUtils?
protectedoptionalauditLogUtils?:AuditLogUtils
Defined in: auth/src/routes/BaseImpersonationRoute.ts:55
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: auth/src/routes/BaseImpersonationRoute.ts:58
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: auth/src/routes/BaseImpersonationRoute.ts:71
trustedProxies
protectedtrustedProxies:string[] =[]
Defined in: auth/src/routes/BaseImpersonationRoute.ts:74
userClass
abstractprotecteduserClass:any
Defined in: auth/src/routes/BaseImpersonationRoute.ts:46
userRepo?
protectedoptionaluserRepo?:RepoUtils<U>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:82
Methods
impersonate()
impersonate(
body,req,res,user):Promise<AuthResult>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:129
Parameters
body
req
HttpRequest
res
HttpResponse
user
JWTUser
Returns
Promise<AuthResult>
initialize()
protectedinitialize():Promise<void>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:85
Returns
Promise<void>
stopImpersonating()
stopImpersonating(
req,res,user):Promise<{restored:boolean; }>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:192
Parameters
req
HttpRequest
res
HttpResponse
user
JWTUser
Returns
Promise<{ restored: boolean; }>