Documentation

MockProvider
in package
implements AuthorizationProviderInterface

Class ServiceMockSecurityProvider - provides mockes for all security methods

Interfaces, Classes and Traits

AuthorizationProviderInterface
Interface for security provider with authorization

Table of Contents

$hasPermitResults  : array<string|int, bool>
Result for the hasPermit method
connect()  : string
Method creates conection session
createSession()  : string
Method creates session from existing token or fetched from HTTP headers
getLoginFieldName()  : string
{@inheritdoc}
getSelfId()  : int
Method returns id of the session user
getSelfLogin()  : string
Method returns login of the session user
getSessionIdFieldName()  : string
Method returns field name for session_id
hasPermit()  : bool
Method returns true or false if the session user has permit or not
loginAs()  : string
Method allows user to login under another user
validatePermit()  : void
Method throws exception if the user does not have permit

Properties

$hasPermitResults

Result for the hasPermit method

public array<string|int, bool> $hasPermitResults = []

Methods

connect()

Method creates conection session

public connect(string $login, string $password) : string
Parameters
$login : string

Login

$password : string

Password

Return values
string

Random md5 hash as session id

createSession()

Method creates session from existing token or fetched from HTTP headers

public createSession(string $token) : string
Parameters
$token : string

Session token

Return values
string

Session token

getSelfId()

Method returns id of the session user

public getSelfId() : int
Return values
int

id of the session user

getSelfLogin()

Method returns login of the session user

public getSelfLogin() : string
Return values
string

login of the session user

getSessionIdFieldName()

Method returns field name for session_id

public getSessionIdFieldName() : string
Return values
string

Field name

hasPermit()

Method returns true or false if the session user has permit or not

public hasPermit(string $token, string $permit) : bool
Parameters
$token : string

Token

$permit : string

Permit name

Return values
bool

True if the

loginAs()

Method allows user to login under another user

public loginAs(string $token, string $loginOrId, string $field) : string
Parameters
$token : string

Token

$loginOrId : string

In this field login or user id are passed

$field : string

Contains 'login' or 'id'

Return values
string

New session id

validatePermit()

Method throws exception if the user does not have permit

public validatePermit(string $token, string $permit) : void
Parameters
$token : string

Token

$permit : string

Permit name

Return values
void

Search results