SilverStripe\MFA\Service\MethodRegistry
A service class that holds the configuration for enabled MFA methods and facilitates providing these methods
Synopsis
class MethodRegistry
{
- // members
- private static array $methods = ;
- private static string $default_backup_method = Method::class;
- protected $methodInstances;
- // methods
- public array getMethods()
- public bool hasMethods()
- public bool isBackupMethod()
- public MethodInterface|null getBackupMethod()
- public MethodInterface|null getMethodByURLSegment()
- private void ensureNoDuplicateMethods()
- private void ensureNoDuplicateURLSegments()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
Members
private
- $default_backup_method
—
string
A string referring to the classname of the method (implementing SilverStripe\MFA\Method\MethodInterface) that is to be used as the back-up method for MFA. This alters the registration of this method to be required - a forced registration once the user has registered at least one other method. Additionally it cannot be set as the default method for a user to log in with. - $methods
—
array
List of configured MFA methods. These should be class names that implement MethodInterface
protected
- $methodInstances
—
array
Request cache of instantiated method instances
Methods
private
- ensureNoDuplicateMethods() — Ensure that attempts to register a method multiple times do not occur
- ensureNoDuplicateURLSegments() — Ensure that all registered methods have a unique URLSegment
public
- getBackupMethod() — Get the configured backup method
- getMethodByURLSegment() — Fetches a Method by its URL Segment
- getMethods() — Get implementations of all configured methods
- hasMethods() — Helper method to indicate whether any MFA methods are registered
- isBackupMethod() — Indicates whether the given method is registered as the back-up method for MFA