API / Minn\Auth / Salts

Salts final class

Minn\Auth\Salts · public/minn/src/Minn/Auth/Salts.php · 83 lines

The site's own secret material, read from the constants wp-config.php defines, so the engine keys off exactly what the install used.

Constants and properties

privateSCHEMES = array ( 'logged_in' => array ( 0 => 'LOGGED_IN_KEY', 1 => 'LOGGED_IN_SALT', ), 'nonce' => array ( 0 => 'NONCE_KEY', 1 => 'NONCE_SALT', ), 'auth' => array ( 0 => 'AUTH_KEY', 1 => 'AUTH_SALT', ), 'secure_auth' => array ( 0 => 'SECURE_AUTH_KEY', 1 => 'SECURE_AUTH_SALT', ), )

Public

staticconfigured(): bool#

True when every key and salt is defined and none is the installer's placeholder.

staticknows(string $scheme): bool#

Whether a scheme has a key and salt of its own (auth, secure_auth, logged_in, nonce).

staticfor(string $scheme): string#

The key and salt of a scheme joined, as the reference feeds them to its HMACs. A scheme of a plugin's own (or none) is salted from the site's secret key: the key, then the scheme's HMAC under it.

statichash(string $data, string $scheme): string#

HMAC-md5 under the scheme's salt: the primitive every cookie and nonce is built from.

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatesecret(string $constant, string $option): string#

A key or salt: the wp-config.php constant, unless it is empty, the installer's placeholder, or a value another key or salt there shares (the reference leaves all three out). Then the option of that name, made the first time it is needed (64 characters, the extra special ones among them), as the reference keeps it.

privateshared(): array#
@return list<string> the values more than one of the site's keys and salts (SECRET_KEY among them) hold