Skip to main content

Abstract Class: DefaultAccounts<U, A, P, S>

Defined in: auth/src/jobs/DefaultAccounts.ts:31

The DefaultAccounts is a single-execution background job that runs at service startup which creates default user accounts for the system (e.g. the admin account). The default accounts to create are defined in the server's config.ts under the key default_accounts.

Extends​

  • BackgroundService

Extended by​

Type Parameters​

U​

U extends User

A​

A extends Alias

P​

P extends Profile

S​

S extends Secret

Constructors​

Constructor​

new DefaultAccounts<U, A, P, S>(): DefaultAccounts<U, A, P, S>

Returns​

DefaultAccounts<U, A, P, S>

Inherited from​

BackgroundService.constructor

Properties​

aliasClass​

abstract protected aliasClass: any

Defined in: auth/src/jobs/DefaultAccounts.ts:37


aliasRepo?​

protected optional aliasRepo?: RepoUtils<A>

Defined in: auth/src/jobs/DefaultAccounts.ts:45


defaultAccounts​

protected defaultAccounts: DefaultAccountConfig[] = []

Defined in: auth/src/jobs/DefaultAccounts.ts:53


defaultScopes​

protected defaultScopes: string[] = []

Defined in: auth/src/jobs/DefaultAccounts.ts:56


logger?​

protected optional logger?: any

Defined in: auth/src/jobs/DefaultAccounts.ts:59


passwordConfig​

protected passwordConfig: PasswordConfig

Defined in: auth/src/jobs/DefaultAccounts.ts:62


passwordFile?​

protected optional passwordFile?: string = "passwords"

Defined in: auth/src/jobs/DefaultAccounts.ts:65


profileClass​

abstract protected profileClass: any

Defined in: auth/src/jobs/DefaultAccounts.ts:38


profileRepo?​

protected optional profileRepo?: RepoUtils<P>

Defined in: auth/src/jobs/DefaultAccounts.ts:67


secretClass​

abstract protected secretClass: any

Defined in: auth/src/jobs/DefaultAccounts.ts:39


secretRepo?​

protected optional secretRepo?: RepoUtils<S>

Defined in: auth/src/jobs/DefaultAccounts.ts:69


trustedRoles​

protected trustedRoles: string[]

Defined in: auth/src/jobs/DefaultAccounts.ts:72


userClass​

abstract protected userClass: any

Defined in: auth/src/jobs/DefaultAccounts.ts:40


userRepo?​

protected optional userRepo?: RepoUtils<U>

Defined in: auth/src/jobs/DefaultAccounts.ts:74

Accessors​

schedule​

Get Signature​

get schedule(): string | undefined

Defined in: auth/src/jobs/DefaultAccounts.ts:120

Returns the desired execution interval that this service should be scheduled with. If undefined is returned the service is executed only once.

Returns​

string | undefined

Overrides​

BackgroundService.schedule

Methods​

init()​

init(): Promise<void>

Defined in: auth/src/jobs/DefaultAccounts.ts:77

Returns​

Promise<void>


run()​

run(): void | Promise<void>

Defined in: auth/src/jobs/DefaultAccounts.ts:124

The processing function to execute at each scheduled interval.

Returns​

void | Promise<void>

Overrides​

BackgroundService.run


start()​

start(): Promise<void>

Defined in: auth/src/jobs/DefaultAccounts.ts:128

Initializes the background service with any defaults.

Returns​

Promise<void>

Overrides​

BackgroundService.start


stop()​

stop(): void | Promise<void>

Defined in: auth/src/jobs/DefaultAccounts.ts:181

Shuts down the background allowing the service to complete any outstanding tasks.

Returns​

void | Promise<void>

Overrides​

BackgroundService.stop