SilverStripe\WebAuthn\CredentialRepository
Implements the required interface from the WebAuthn library - but it does not implement the repository pattern in the usual way. This is expected to be stored on a DataObject for persistence. Use the
Synopsis
class CredentialRepository
implements
PublicKeyCredentialSourceRepository,Serializable
{
- // members
- private $memberID;
- private array $credentials = ;
- private bool $hasChanged = false;
- // methods
- public void __construct()
- public void has()
- public void get()
- public void getUserHandleFor()
- public void getCounterFor()
- public void updateCounterFor()
- protected void assertCredentialID()
- public void findOneByCredentialId()
- public array findAllForUserEntity()
- public void saveCredentialSource()
- public void reset()
- public bool hasChanged()
- protected void setCredentials()
- protected string getCredentialIDRef()
- public array toArray()
- public static CredentialRepository fromArray()
- public void serialize()
- public void unserialize()
Hierarchy
Implements
- Webauthn\PublicKeyCredentialSourceRepository
- Serializable
Members
private
- $credentials — array
- $hasChanged — SilverStripe\WebAuthn\bool
- $memberID — string
Methods
protected
- assertCredentialID() — Assert that the given credential ID matches a stored credential
- getCredentialIDRef() — Create a reference to be used as a key for the credentials in the array
- setCredentials() — Set the credentials in bulk (for internal use) ensuring that credential objects are initialised correctly
public
- __construct()
- findAllForUserEntity()
- findOneByCredentialId()
- fromArray() — Create an instance of a repository from the given credentials
- get()
- getCounterFor()
- getUserHandleFor()
- has()
- hasChanged() — Indicates the repository has changed and should be persisted (as this doesn't follow the actual repository pattern and is expected to be stored on a dataobject for persistence)
- reset() — Empty the store deleting all stored credentials
- saveCredentialSource()
- serialize()
- toArray() — Provide the credentials stored in this repository as an array
- unserialize()
- updateCounterFor()