PHP Class ZF\Apigility\Admin\Model\AuthenticationModel

Afficher le fichier Open project: zfcampus/zf-apigility-admin

Protected Properties

Свойство Type Description
$globalConfig ZF\Configuration\ConfigResource
$localConfig ZF\Configuration\ConfigResource
$modules ModuleModel

Méthodes publiques

Méthode Description
__construct ( ZF\Configuration\ConfigResource $globalConfig, ZF\Configuration\ConfigResource $localConfig, ModuleModel $modules )
arrayDiffRecursive ( mixed $a, mixed $b ) : integer Perform a recursive array diff
create ( array $authenticationConfig ) : AuthenticationEntity Create authentication configuration
createAuthenticationAdapter ( array $adapter ) : array Create authentication adapter for version 2
fetch ( ) : AuthenticationEntity | false Fetch configuration details for authentication
fetchAllAuthenticationAdapter ( ) : array Fetch configuration details for auth adapters
fetchAuthenticationAdapter ( string $name ) : array | false Fetch configuration details for specific auth adapter name
fromOAuth2RegexToArray ( array $config ) : array Return the OAuth2 urls as array from the regex string
getAuthenticationMap ( string $module, integer | false $version = false ) : string | false Get the authentication map specified by $module and $version
remove ( ) : true Remove authentication
removeAuthenticationAdapter ( string $name ) : boolean Remove the authentication adapter specified
removeAuthenticationMap ( string $module, integer $version = null ) : boolean Remove the authentication Map for a specific $module and $version
removeOldAuthentication ( ) : true Remove authentication
saveAuthenticationMap ( string $auth, string $module, integer $version = null ) : boolean Save the authentication Map for a specific $module and $version
transformAuthPerApis ( ) : boolean | string This function transform the old authentication system to the new one based on APIs defined. It reads the old configuration and generates an authentication mapping for each API and version.
update ( array $authenticationConfig ) : AuthenticationEntity Update authentication configuration
updateAuthenticationAdapter ( string $name, array $adapter ) : array Update authentication adapter data

Méthodes protégées

Méthode Description
checkAuthenticationAdapterData ( array $adapter ) : array Check and return the input data for version 2
createAuthenticationEntityFromConfig ( array $config ) : AuthenticationEntity Create an AuthenticationEntity based on the configuration given
createMongoDSN ( $dsn ) : MongoClient
createPdoDSN ( $dsn, $username, $password ) : PDO
fetchHttpAuthConfiguration ( array $config ) : array | false Fetch HTTP Authentication configuration
fetchOAuth2Configuration ( array $config ) : array | false Fetch all OAuth2 configuration from global and local files
loadAuthenticationAdapterFromConfig ( string $name, array $config ) : array Load authentication data from configuration version 2 Since Apigility 1.1
patchHttpAuthConfig ( AuthenticationEntity $entity, array $global, array $local ) Patch the HTTP Authentication configuration
patchOAuth2Config ( AuthenticationEntity $entity, array $global, array $local ) : void Patch the OAuth2 configuration
removeOAuth2Route ( string $url ) : boolean Remove a url from OAuth2 route
removeSensitiveConfig ( array $config ) : array Remove sensitive information from the configuration
saveAuthenticationAdapter ( array $adapter ) : true Add a new authentication adapter in local config
updateOAuth2Route ( string $url ) : void Update the OAuth2 route
validateDsn ( string $dsn, string $username = null, string $password = null, string $dsnType = AuthenticationEntity::DSN_PDO ) : boolean Validate a DSN

Method Details

__construct() public méthode

public __construct ( ZF\Configuration\ConfigResource $globalConfig, ZF\Configuration\ConfigResource $localConfig, ModuleModel $modules )
$globalConfig ZF\Configuration\ConfigResource
$localConfig ZF\Configuration\ConfigResource
$modules ModuleModel

arrayDiffRecursive() public static méthode

Necessary starting in PHP 5.4; see https://bugs.php.net/bug.php?id=60278
public static arrayDiffRecursive ( mixed $a, mixed $b ) : integer
$a mixed
$b mixed
Résultat integer

checkAuthenticationAdapterData() protected méthode

Check and return the input data for version 2
protected checkAuthenticationAdapterData ( array $adapter ) : array
$adapter array
Résultat array

create() public méthode

Create authentication configuration
public create ( array $authenticationConfig ) : AuthenticationEntity
$authenticationConfig array
Résultat AuthenticationEntity

createAuthenticationAdapter() public méthode

Since Apigility 1.1
public createAuthenticationAdapter ( array $adapter ) : array
$adapter array
Résultat array

createAuthenticationEntityFromConfig() protected méthode

Create an AuthenticationEntity based on the configuration given
protected createAuthenticationEntityFromConfig ( array $config ) : AuthenticationEntity
$config array
Résultat AuthenticationEntity

createMongoDSN() protected méthode

protected createMongoDSN ( $dsn ) : MongoClient
$dsn
Résultat MongoClient

createPdoDSN() protected méthode

protected createPdoDSN ( $dsn, $username, $password ) : PDO
$dsn
$username
$password
Résultat PDO

fetch() public méthode

Fetch configuration details for authentication
public fetch ( ) : AuthenticationEntity | false
Résultat AuthenticationEntity | false

fetchAllAuthenticationAdapter() public méthode

Used since Apigility 1.1
public fetchAllAuthenticationAdapter ( ) : array
Résultat array

fetchAuthenticationAdapter() public méthode

Used since Apigility 1.1
public fetchAuthenticationAdapter ( string $name ) : array | false
$name string
Résultat array | false

fetchHttpAuthConfiguration() protected méthode

Fetch HTTP Authentication configuration
protected fetchHttpAuthConfiguration ( array $config ) : array | false
$config array
Résultat array | false

fetchOAuth2Configuration() protected méthode

Fetch all OAuth2 configuration from global and local files
protected fetchOAuth2Configuration ( array $config ) : array | false
$config array
Résultat array | false

fromOAuth2RegexToArray() public méthode

Since Apigility 1.1
public fromOAuth2RegexToArray ( array $config ) : array
$config array
Résultat array

getAuthenticationMap() public méthode

Used since Apigility 1.1
public getAuthenticationMap ( string $module, integer | false $version = false ) : string | false
$module string
$version integer | false
Résultat string | false

loadAuthenticationAdapterFromConfig() protected méthode

Load authentication data from configuration version 2 Since Apigility 1.1
protected loadAuthenticationAdapterFromConfig ( string $name, array $config ) : array
$name string
$config array
Résultat array

patchHttpAuthConfig() protected méthode

Patch the HTTP Authentication configuration
protected patchHttpAuthConfig ( AuthenticationEntity $entity, array $global, array $local )
$entity AuthenticationEntity
$global array
$local array

patchOAuth2Config() protected méthode

Patch the OAuth2 configuration
protected patchOAuth2Config ( AuthenticationEntity $entity, array $global, array $local ) : void
$entity AuthenticationEntity
$global array
$local array
Résultat void

remove() public méthode

Remove authentication
public remove ( ) : true
Résultat true

removeAuthenticationAdapter() public méthode

Since Apigility 1.1
public removeAuthenticationAdapter ( string $name ) : boolean
$name string
Résultat boolean

removeAuthenticationMap() public méthode

Used since Apigility 1.1
public removeAuthenticationMap ( string $module, integer $version = null ) : boolean
$module string
$version integer
Résultat boolean

removeOAuth2Route() protected méthode

Since Apigility 1.1
protected removeOAuth2Route ( string $url ) : boolean
$url string
Résultat boolean

removeOldAuthentication() public méthode

Remove authentication
public removeOldAuthentication ( ) : true
Résultat true

removeSensitiveConfig() protected méthode

Currently only "htpasswd" and "htdigest" entries are stripped.
protected removeSensitiveConfig ( array $config ) : array
$config array
Résultat array

saveAuthenticationAdapter() protected méthode

Add a new authentication adapter in local config
protected saveAuthenticationAdapter ( array $adapter ) : true
$adapter array
Résultat true

saveAuthenticationMap() public méthode

Used since Apigility 1.1
public saveAuthenticationMap ( string $auth, string $module, integer $version = null ) : boolean
$auth string
$module string
$version integer
Résultat boolean

transformAuthPerApis() public méthode

This function transform the old authentication system to the new one based on APIs defined. It reads the old configuration and generates an authentication mapping for each API and version.
public transformAuthPerApis ( ) : boolean | string
Résultat boolean | string Boolean false if nothing was performed; string adapter name otherwise.

update() public méthode

Update authentication configuration
public update ( array $authenticationConfig ) : AuthenticationEntity
$authenticationConfig array
Résultat AuthenticationEntity

updateAuthenticationAdapter() public méthode

Since Apigility 1.1
public updateAuthenticationAdapter ( string $name, array $adapter ) : array
$name string
$adapter array
Résultat array

updateOAuth2Route() protected méthode

Since Apigility 1.1
protected updateOAuth2Route ( string $url ) : void
$url string
Résultat void

validateDsn() protected méthode

Validate a DSN
protected validateDsn ( string $dsn, string $username = null, string $password = null, string $dsnType = AuthenticationEntity::DSN_PDO ) : boolean
$dsn string
$username string
$password string
$dsnType string
Résultat boolean

Property Details

$globalConfig protected_oe property

protected ConfigResource,ZF\Configuration $globalConfig
Résultat ZF\Configuration\ConfigResource

$localConfig protected_oe property

protected ConfigResource,ZF\Configuration $localConfig
Résultat ZF\Configuration\ConfigResource

$modules protected_oe property

protected ModuleModel,ZF\Apigility\Admin\Model $modules
Résultat ModuleModel