PHP 클래스 ZF\Apigility\Admin\Model\AuthenticationModel

파일 보기 프로젝트 열기: zfcampus/zf-apigility-admin

보호된 프로퍼티들

프로퍼티 타입 설명
$globalConfig ZF\Configuration\ConfigResource
$localConfig ZF\Configuration\ConfigResource
$modules ModuleModel

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
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

메소드 상세

__construct() 공개 메소드

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

arrayDiffRecursive() 공개 정적인 메소드

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
리턴 integer

checkAuthenticationAdapterData() 보호된 메소드

Check and return the input data for version 2
protected checkAuthenticationAdapterData ( array $adapter ) : array
$adapter array
리턴 array

create() 공개 메소드

Create authentication configuration
public create ( array $authenticationConfig ) : AuthenticationEntity
$authenticationConfig array
리턴 AuthenticationEntity

createAuthenticationAdapter() 공개 메소드

Since Apigility 1.1
public createAuthenticationAdapter ( array $adapter ) : array
$adapter array
리턴 array

createAuthenticationEntityFromConfig() 보호된 메소드

Create an AuthenticationEntity based on the configuration given
protected createAuthenticationEntityFromConfig ( array $config ) : AuthenticationEntity
$config array
리턴 AuthenticationEntity

createMongoDSN() 보호된 메소드

protected createMongoDSN ( $dsn ) : MongoClient
$dsn
리턴 MongoClient

createPdoDSN() 보호된 메소드

protected createPdoDSN ( $dsn, $username, $password ) : PDO
$dsn
$username
$password
리턴 PDO

fetch() 공개 메소드

Fetch configuration details for authentication
public fetch ( ) : AuthenticationEntity | false
리턴 AuthenticationEntity | false

fetchAllAuthenticationAdapter() 공개 메소드

Used since Apigility 1.1

fetchAuthenticationAdapter() 공개 메소드

Used since Apigility 1.1
public fetchAuthenticationAdapter ( string $name ) : array | false
$name string
리턴 array | false

fetchHttpAuthConfiguration() 보호된 메소드

Fetch HTTP Authentication configuration
protected fetchHttpAuthConfiguration ( array $config ) : array | false
$config array
리턴 array | false

fetchOAuth2Configuration() 보호된 메소드

Fetch all OAuth2 configuration from global and local files
protected fetchOAuth2Configuration ( array $config ) : array | false
$config array
리턴 array | false

fromOAuth2RegexToArray() 공개 메소드

Since Apigility 1.1
public fromOAuth2RegexToArray ( array $config ) : array
$config array
리턴 array

getAuthenticationMap() 공개 메소드

Used since Apigility 1.1
public getAuthenticationMap ( string $module, integer | false $version = false ) : string | false
$module string
$version integer | false
리턴 string | false

loadAuthenticationAdapterFromConfig() 보호된 메소드

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

patchHttpAuthConfig() 보호된 메소드

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

patchOAuth2Config() 보호된 메소드

Patch the OAuth2 configuration
protected patchOAuth2Config ( AuthenticationEntity $entity, array $global, array $local ) : void
$entity AuthenticationEntity
$global array
$local array
리턴 void

remove() 공개 메소드

Remove authentication
public remove ( ) : true
리턴 true

removeAuthenticationAdapter() 공개 메소드

Since Apigility 1.1
public removeAuthenticationAdapter ( string $name ) : boolean
$name string
리턴 boolean

removeAuthenticationMap() 공개 메소드

Used since Apigility 1.1
public removeAuthenticationMap ( string $module, integer $version = null ) : boolean
$module string
$version integer
리턴 boolean

removeOAuth2Route() 보호된 메소드

Since Apigility 1.1
protected removeOAuth2Route ( string $url ) : boolean
$url string
리턴 boolean

removeOldAuthentication() 공개 메소드

Remove authentication
public removeOldAuthentication ( ) : true
리턴 true

removeSensitiveConfig() 보호된 메소드

Currently only "htpasswd" and "htdigest" entries are stripped.
protected removeSensitiveConfig ( array $config ) : array
$config array
리턴 array

saveAuthenticationAdapter() 보호된 메소드

Add a new authentication adapter in local config
protected saveAuthenticationAdapter ( array $adapter ) : true
$adapter array
리턴 true

saveAuthenticationMap() 공개 메소드

Used since Apigility 1.1
public saveAuthenticationMap ( string $auth, string $module, integer $version = null ) : boolean
$auth string
$module string
$version integer
리턴 boolean

transformAuthPerApis() 공개 메소드

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
리턴 boolean | string Boolean false if nothing was performed; string adapter name otherwise.

update() 공개 메소드

Update authentication configuration
public update ( array $authenticationConfig ) : AuthenticationEntity
$authenticationConfig array
리턴 AuthenticationEntity

updateAuthenticationAdapter() 공개 메소드

Since Apigility 1.1
public updateAuthenticationAdapter ( string $name, array $adapter ) : array
$name string
$adapter array
리턴 array

updateOAuth2Route() 보호된 메소드

Since Apigility 1.1
protected updateOAuth2Route ( string $url ) : void
$url string
리턴 void

validateDsn() 보호된 메소드

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
리턴 boolean

프로퍼티 상세

$globalConfig 보호되어 있는 프로퍼티

protected ConfigResource,ZF\Configuration $globalConfig
리턴 ZF\Configuration\ConfigResource

$localConfig 보호되어 있는 프로퍼티

protected ConfigResource,ZF\Configuration $localConfig
리턴 ZF\Configuration\ConfigResource

$modules 보호되어 있는 프로퍼티

protected ModuleModel,ZF\Apigility\Admin\Model $modules
리턴 ModuleModel