Table of Contents

Class DefaultAdministratorBootstrap

Namespace
MailFathom.Application.Access.DefaultAdministrator
Assembly
MailFathom.Application.dll

Records a deployment's default administrator on its first start, and gives it the password the deployment was started with.

public sealed class DefaultAdministratorBootstrap
Inheritance
DefaultAdministratorBootstrap
Inherited Members

Remarks

The first start records a user admin, in no organization, holding the seeded Administrator role at the deployment scope, with both of its mail endpoint switches off so no MCP or client caller is ever admin. It happens once per deployment: removing admin afterwards is final, because a deployment whose operator removed the default account and then found it back with a known password would be worse off than one that never had it.

The password setting is applied at most once per deployment. The first start that finds it while admin holds no password credential provisions one, presented on the administrative endpoint alone, and records that the setting was applied; every later start ignores it, whatever happened to that credential since. So changing the setting does not change the password, and no route that removes or disables admin's credential can turn the next restart into a sign-in with the shipped value.

The shipped value admin is exempt from the password policy's minimum and nothing else is: a value printed in every deployment asset is public whatever its length, while any other value is one an operator chose and is held to the policy like every password. While the stored password still verifies against the shipped value, every start reports it.

Constructors

DefaultAdministratorBootstrap(AccessAuthorization, IDefaultAdministratorStore, IUserCredentialStore, IPasswordHasher, TimeProvider)

Initializes a new instance of the DefaultAdministratorBootstrap class.

Fields

ShippedPassword

The password every copy of the deployment assets that sets one ships with.

Username

The username the default administrator signs in with, in no organization.

Methods

StartAsync(string?, string, CancellationToken)

Records the default administrator where this deployment never did, and applies the password setting where it never was.