Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct (DatabaseInterface $db=null) | |
getUserHandleFor (string $credentialId) | |
getHandleFromUserId (int $id) | |
Fonctions membres publiques hérités de PublicKeyCredentialSourceRepository | |
findOneByCredentialId (string $publicKeyCredentialId) | |
findAllForUserEntity (PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity) | |
saveCredentialSource (PublicKeyCredentialSource $publicKeyCredentialSource) | |
Fonctions membres publiques hérités de DatabaseAwareInterface | |
setDatabase (DatabaseInterface $db) | |
Fonctions membres privées | |
encryptCredential (string $credential) | |
decryptCredential (string $credential) | |
formatDate ($date, ?string $format=null, bool $tzAware=true) | |
Handles the storage of WebAuthn credentials in the database
__construct | ( | DatabaseInterface | $db = null | ) |
Public constructor.
DatabaseInterface | null | $db | The database driver object to use for persistence. |
Références $db, et Joomla\Database\setDatabase().
|
private |
Decrypt the credential source if it was already encrypted in the database
string | $credential | The encrypted credential source, base64 encoded |
Références $key.
|
private |
Encrypt the credential source before saving it to the database
string | $credential | The unencrypted, JSON-encoded credential source |
Références $key.
Format a date for display.
The $tzAware parameter defines whether the formatted date will be timezone-aware. If set to false the formatted date will be rendered in the UTC timezone. If set to true the code will automatically try to use the logged in user's timezone or, if none is set, the site's default timezone (Server Timezone). If set to a positive integer the same thing will happen but for the specified user ID instead of the currently logged in user.
string | \DateTime | $date | The date to format |
string | null | $format | The format string, default is Joomla's DATE_FORMAT_LC6 (usually "Y-m-d H:i:s") |
bool | $tzAware | Should the format be timezone aware? See notes above. |
Références $date, $format, $user, $userId, Text\_(), class, Factory\getApplication(), Factory\getContainer(), et null.
getHandleFromUserId | ( | int | $id | ) |
Return a user handle given an integer Joomla user ID. We use the HMAC-SHA-256 of the user ID with the site's secret as the key. Using it instead of SHA-512 is on purpose! WebAuthn only allows user handles up to 64 bytes long.
int | $id | The user ID to convert |
getUserHandleFor | ( | string | $credentialId | ) |
Return the user handle for the stored credential given its ID.
The user handle must not be personally identifiable. Per https://w3c.github.io/webauthn/#user-handle it is acceptable to have a salted hash with a salt private to our server, e.g. Joomla's secret. The only immutable information in Joomla is the user ID so that's what we will be using.
string | $credentialId | The credential ID to get the user handle for |