Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
CsrfManager Class Reference

Ubiquity\security\csrf$CsrfManager This class is part of Ubiquity. More...

Static Public Member Functions

static start (TokenStorageInterface $storage=null, GeneratorInterface $selector=null, GeneratorInterface $validator=null)
 
static getToken ($name)
 Generates or retrieve and return a token.
 
static removeToken (string $name)
 Remove an existing token.
 
static isValid (string $id, string $value)
 Returns whether the given CSRF token is valid, given his id.
 
static isValidByName (string $name, string $value)
 Returns whether the given CSRF token is valid, given his name.
 
static getSelector (string $name)
 Return a selector corresponding to a name, using the active selector.
 
static generateValue (?string $value=null)
 Generates a token value using the active validator.
 
static getValidatorClass ()
 
static getSelectorClass ()
 
static getStorageClass ()
 
static isStarted ()
 

Static Private Attributes

static $selector
 
static $validator
 
static $storage
 

Detailed Description

Ubiquity\security\csrf$CsrfManager This class is part of Ubiquity.

Author
jc
Version
1.0.0

Definition at line 18 of file CsrfManager.php.

Member Function Documentation

◆ generateValue()

static generateValue ( ?string  $value = null)
static

Generates a token value using the active validator.

Parameters
string$value
Returns
string

Definition at line 113 of file CsrfManager.php.

◆ getSelector()

static getSelector ( string  $name)
static

Return a selector corresponding to a name, using the active selector.

Parameters
string$name
Returns
string

Definition at line 103 of file CsrfManager.php.

◆ getSelectorClass()

static getSelectorClass ( )
static

Definition at line 121 of file CsrfManager.php.

◆ getStorageClass()

static getStorageClass ( )
static

Definition at line 125 of file CsrfManager.php.

◆ getToken()

static getToken (   $name)
static

Generates or retrieve and return a token.

Parameters
string$name
Returns
\Ubiquity\security\csrf\UToken

Definition at line 50 of file CsrfManager.php.

◆ getValidatorClass()

static getValidatorClass ( )
static

Definition at line 117 of file CsrfManager.php.

◆ isStarted()

static isStarted ( )
static

Definition at line 129 of file CsrfManager.php.

◆ isValid()

static isValid ( string  $id,
string  $value 
)
static

Returns whether the given CSRF token is valid, given his id.

Parameters
string$id
string$value
Returns
bool

Definition at line 78 of file CsrfManager.php.

◆ isValidByName()

static isValidByName ( string  $name,
string  $value 
)
static

Returns whether the given CSRF token is valid, given his name.

Parameters
string$name
string$value
Returns
bool

Definition at line 93 of file CsrfManager.php.

◆ removeToken()

static removeToken ( string  $name)
static

Remove an existing token.

Parameters
string$name
Returns
?string

Definition at line 67 of file CsrfManager.php.

◆ start()

static start ( TokenStorageInterface  $storage = null,
GeneratorInterface  $selector = null,
GeneratorInterface  $validator = null 
)
static

Definition at line 38 of file CsrfManager.php.

Field Documentation

◆ $selector

$selector
staticprivate

Definition at line 24 of file CsrfManager.php.

◆ $storage

$storage
staticprivate

Definition at line 36 of file CsrfManager.php.

◆ $validator

$validator
staticprivate

Definition at line 30 of file CsrfManager.php.


The documentation for this class was generated from the following file: