DVFirstRunOwner class

The owner a first run created, and the password to sign in with once.

Constructors

DVFirstRunOwner({required String userId, required String email, required String password})
const

Properties

email → String
final
hashCode → int
The hash code for this object.
no setterinherited
password → String
32 characters from a secure random. Shown once, then never again.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
userId → String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

changed(String userId) → Future<void>
Records that the owner has chosen their own password, and removes the file that carried the printed one.
debugReset() → void
Forgets where the file was written. For tests.
ensure({required AuthProvider accounts, required DVStudioGrants grants, required String dataDirectory, required String email, void announce(String line)?, Random? random}) → Future<DVFirstRunOwner?>
Creates the owner when the application has no accounts at all.
mustChangePassword({DVDatabaseAdapter? database}) → Future<bool>
Whether the owner is still signing in with the password that was printed. Studio is closed until this is false.
ownerAddress({DVDatabaseAdapter? database}) → Future<String?>
The address the first owner signs in with, for the setup screen.
recordPasswordChanged(String userId) → Future<void>
Records that the first owner changed their password, if userId is the first owner. Called by the application's own password endpoint.
recordSecondFactor(String userId) → Future<void>
Records that the first owner turned on a second factor, if userId is the first owner. Called by the application's own confirm endpoint.
secondFactorEnrolled(String userId, {DVDatabaseAdapter? database}) → Future<void>
Records that the owner turned on a second factor.
setupPending({DVDatabaseAdapter? database}) → Future<bool>
Whether the first owner still has setting up to do: their own password, and a second factor on it.

Constants

passwordFileName → const String
Where the password is written beside the database, for an operator who lost the console output -- a container's log, a scrollback, a service manager that swallowed it. Removed the moment the password changes.
table → const String
The table that remembers the first run, so a restart does not mint a second owner and Studio knows the password is still the printed one.