Skip to content

xtr_security.command

The console commands the security bundle registers when a console is active.

debug:firewall reads the firewalls an application configured; the password hasher's security:hash-password is registered here too, with the factory the bundle wired and the configured user classes — the command ships with xtr-password-hasher, which has no bundle of its own.

UserPasswordHashCommand

UserPasswordHashCommand(factory: PasswordHasherFactoryInterface, user_classes: tuple[str, ...] = ())

Hashes a password the way the application's configuration would.

The hasher is the one configured for user-class — a module:Class, or the name of a configured hasher — or, when it is left out, for the first of user_classes (asked, when there are several and the run is interactive). user_classes are the keys the factory is configured with, as module:Class strings or hasher names.

The password is asked for, hidden, when left out; - reads it from standard input, which keeps it out of the shell history and the process list. A hasher that takes its salt from outside gets a generated one, printed with the hash, unless --empty-salt is given.

Resolve hashers through factory, defaulting to the first of user_classes.

DebugFirewallCommand

Lists an application's firewalls, or one firewall's pieces in detail.