Skip to content

AuthEngine

Defined in: types.ts:102

readonly config: AuthConfig

Defined in: types.ts:103

authenticate(strategyName, data, params): Promise<AuthResult>

Defined in: types.ts:115

string

Record<string, unknown>

ServiceParams

Promise<AuthResult>


createJwt(payload, options?): string

Defined in: types.ts:104

JwtPayload

string | number

string


createTokenPair(sub, accessExtra?): Promise<TokenPair>

Defined in: types.ts:113

Issue an access + refresh token pair for a subject. The refresh token carries { sub, type: "refresh", jti }, is signed with refreshExpiresIn, and its jti is recorded in the RefreshTokenStore before the pair is returned. All strategies must issue refresh tokens through this helper so jti bookkeeping stays uniform.

string

Record<string, unknown>

Promise<TokenPair>


isAgentTokenValid(id): Promise<boolean>

Defined in: types.ts:130

True unless the agent token id was revoked, or was never issued on this engine’s store.

string

Promise<boolean>


issueAgentToken(scope, delegatingUserId, options?): Promise<IssuedAgentToken>

Defined in: types.ts:122

Mint a short-lived, capability-scoped agent token delegated from delegatingUserId. The token is a JWT carrying { sub: <agent id>, type: "agent", scope, delegatingUserId } — only authorizeAgent() accepts it, never authenticate("jwt"). Recorded in the AgentTokenStore so it can be revoked before its natural expiry via revokeAgentToken.

CapabilityScope

string

AgentTokenOptions

Promise<IssuedAgentToken>


registerStrategy(strategy): void

Defined in: types.ts:114

AuthStrategy

void


revokeAgentToken(id): Promise<void>

Defined in: types.ts:128

Revoke one agent token immediately, independent of its JWT expiry.

string

Promise<void>


verifyJwt(token): JwtPayload

Defined in: types.ts:105

string

JwtPayload