Manage Content Security Policies.
More...
|
static | start (string $nonceGeneratorClass=null, bool $reportOnly=false, ?callable $onGenerate=null) |
| Starts the Content Security Policies manager.
|
|
static | getNonce (string $name) |
| Returns a new or an existing nonce.
|
|
static | getHash (string $name, string $code, string $algo='sha256') |
| Generates a hash and add it to a directive.
|
|
static | hasNonce (string $name) |
|
static | isStarted () |
| Checks if the manager is started.
|
|
static | addCsp (?bool $reportOnly=null) |
| Creates and returns a new ContentSecurity object.
|
|
static | defaultCsp (?bool $reportOnly=null) |
| Returns a default ContentSecurity object.
|
|
static | clearCsp () |
| Removes all CSP objects.
|
|
static | defaultUbiquity (?bool $reportOnly=null) |
| Creates a new ContentSecurity object for Ubiquity Webtools.
|
|
static | defaultUbiquityDebug (?bool $reportOnly=null, string $livereloadServer='127.0.0.1:35729') |
| Creates a new ContentSecurity object for Ubiquity Webtools in debug mode.
|
|
static | addHeadersToResponse (?bool $reportOnly=null) |
| Adds all Content security policies to headers.
|
|
static | getNonceGenerator () |
| Returns the NonceGenerator instance.
|
|
static | getCsp () |
|
static | isReportOnly () |
| Returns true if reportOnly header is activated.
|
|
static | getHashAlgo () |
|
static | setHashAlgo (string $hashAlgo) |
|
static | setOnGenerate (callable $onGenerate) |
|
Manage Content Security Policies.
Ubiquity\security\csp$ContentSecurityManager This class is part of Ubiquity
- Author
- jc
- Version
- 1.0.0
Definition at line 15 of file ContentSecurityManager.php.
◆ addCsp()
static addCsp |
( |
?bool |
$reportOnly = null | ) |
|
|
static |
◆ addHeadersToResponse()
static addHeadersToResponse |
( |
?bool |
$reportOnly = null | ) |
|
|
static |
◆ clearCsp()
◆ defaultCsp()
static defaultCsp |
( |
?bool |
$reportOnly = null | ) |
|
|
static |
◆ defaultUbiquity()
static defaultUbiquity |
( |
?bool |
$reportOnly = null | ) |
|
|
static |
◆ defaultUbiquityDebug()
static defaultUbiquityDebug |
( |
?bool |
$reportOnly = null , |
|
|
string |
$livereloadServer = '127.0.0.1:35729' |
|
) |
| |
|
static |
Creates a new ContentSecurity object for Ubiquity Webtools in debug mode.
- Parameters
-
bool | null | $reportOnly | |
string | $livereloadServer | |
- Returns
- ContentSecurity
Definition at line 138 of file ContentSecurityManager.php.
◆ getCsp()
◆ getHash()
static getHash |
( |
string |
$name, |
|
|
string |
$code, |
|
|
string |
$algo = 'sha256' |
|
) |
| |
|
static |
Generates a hash and add it to a directive.
- Parameters
-
string | $name | |
string | $code | |
string | $algo | default sha256, possible value sha384,sha512 |
- Returns
- string
Definition at line 62 of file ContentSecurityManager.php.
◆ getHashAlgo()
◆ getNonce()
static getNonce |
( |
string |
$name | ) |
|
|
static |
Returns a new or an existing nonce.
- Parameters
-
string | $name | The nonce to create |
- Returns
- string
Definition at line 49 of file ContentSecurityManager.php.
◆ getNonceGenerator()
static getNonceGenerator |
( |
| ) |
|
|
static |
◆ hasNonce()
static hasNonce |
( |
string |
$name | ) |
|
|
static |
◆ isReportOnly()
◆ isStarted()
◆ setHashAlgo()
static setHashAlgo |
( |
string |
$hashAlgo | ) |
|
|
static |
◆ setOnGenerate()
static setOnGenerate |
( |
callable |
$onGenerate | ) |
|
|
static |
◆ start()
static start |
( |
string |
$nonceGeneratorClass = null , |
|
|
bool |
$reportOnly = false , |
|
|
?callable |
$onGenerate = null |
|
) |
| |
|
static |
Starts the Content Security Policies manager.
- Parameters
-
string | null | $nonceGeneratorClass | The class used for generating nonces. |
bool | $reportOnly | |
callable | null | $onGenerate | |
Definition at line 35 of file ContentSecurityManager.php.
◆ $csp
◆ $hashAlgo
string $hashAlgo = 'sha256' |
|
staticprivate |
◆ $nonceGenerator
◆ $onGenerate
◆ $reportOnly
The documentation for this class was generated from the following file:
- C:/Users/myadd/Documents/GitHub/ubiquity-doc-api/vendor/phpmv/ubiquity-security/src/Ubiquity/security/csp/ContentSecurityManager.php