PHP 클래스 Airship\Engine\Security\CSRF

파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$expireOld boolean
$hmacIP Default to FALSE to be friendly to Tor/Mobile users
$recycleAfter integer
$sessionIndex string

공개 메소드들

메소드 설명
__construct ( array $options = [] ) CSRF constructor.
check ( ) : boolean Validate a request based on $_SESSION and $_POST data
getTokenString ( string $lockTo = '' ) : string Retrieve a token array for unit testing endpoints
insertToken ( string $lockTo = '', boolean $echo = true ) : string Insert a CSRF token to a form
reconfigure ( array $options = [] ) Use this to change the configuration settings.

보호된 메소드들

메소드 설명
generateToken ( string $lockTo = '' ) : array Generate, store, and return the index and token
recycleTokens ( ) Enforce an upper limit on the number of tokens stored in session state by removing the oldest tokens first.

메소드 상세

__construct() 공개 메소드

CSRF constructor.
public __construct ( array $options = [] )
$options array

check() 공개 메소드

Validate a request based on $_SESSION and $_POST data
public check ( ) : boolean
리턴 boolean

generateToken() 보호된 메소드

Generate, store, and return the index and token
protected generateToken ( string $lockTo = '' ) : array
$lockTo string What URI endpoint this is valid for
리턴 array [string, string]

getTokenString() 공개 메소드

Retrieve a token array for unit testing endpoints
public getTokenString ( string $lockTo = '' ) : string
$lockTo string - Only get tokens locked to a particular form
리턴 string

insertToken() 공개 메소드

Insert a CSRF token to a form
public insertToken ( string $lockTo = '', boolean $echo = true ) : string
$lockTo string This CSRF token is only valid for this HTTP request endpoint
$echo boolean if true, echo instead of returning
리턴 string

reconfigure() 공개 메소드

Only use this if you know what you are doing.
public reconfigure ( array $options = [] )
$options array

recycleTokens() 보호된 메소드

Enforce an upper limit on the number of tokens stored in session state by removing the oldest tokens first.
protected recycleTokens ( )

프로퍼티 상세

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

protected bool $expireOld
리턴 boolean

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

Default to FALSE to be friendly to Tor/Mobile users
protected $hmacIP

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

protected int $recycleAfter
리턴 integer

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

protected string $sessionIndex
리턴 string