Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe CredentialRepository
+ Graphe d'héritage de CredentialRepository:

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)
 

Description détaillée

Handles the storage of WebAuthn credentials in the database

Depuis
4.0.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( DatabaseInterface  $db = null)

Public constructor.

Paramètres
DatabaseInterface | null$dbThe database driver object to use for persistence.
Depuis
4.2.0

Références $db, et Joomla\Database\setDatabase().

Documentation des fonctions membres

◆ decryptCredential()

decryptCredential ( string  $credential)
private

Decrypt the credential source if it was already encrypted in the database

Paramètres
string$credentialThe encrypted credential source, base64 encoded
Renvoie
string The decrypted, JSON-encoded credential source
Depuis
4.0.0

Références $key.

◆ encryptCredential()

encryptCredential ( string  $credential)
private

Encrypt the credential source before saving it to the database

Paramètres
string$credentialThe unencrypted, JSON-encoded credential source
Renvoie
string The encrypted credential source, base64 encoded
Depuis
4.0.0

Références $key.

◆ formatDate()

formatDate (   $date,
?string  $format = null,
bool  $tzAware = true 
)
private

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.

Paramètres
string | \DateTime$dateThe date to format
string | null$formatThe format string, default is Joomla's DATE_FORMAT_LC6 (usually "Y-m-d H:i:s")
bool$tzAwareShould the format be timezone aware? See notes above.
Renvoie
string
Depuis
4.2.0

Références $date, $format, $user, $userId, Text\_(), class, Factory\getApplication(), Factory\getContainer(), et null.

◆ getHandleFromUserId()

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.

Paramètres
int$idThe user ID to convert
Renvoie
string The user handle (HMAC-SHA-256 of the user ID)
Depuis
4.0.0

Références $data, $id, et $key.

◆ getUserHandleFor()

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.

Paramètres
string$credentialIdThe credential ID to get the user handle for
Renvoie
string
Depuis
4.0.0

La documentation de cette classe a été générée à partir du fichier suivant :