PHP 클래스 ParagonIE\AntiCSRF\AntiCSRF

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . ****************************************************************************** The MIT License (MIT) Copyright (c) 2015 Paragon Initiative Enterprises Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. If you would like to use this library under different terms, please contact Resonant Core to inquire about a license exemption.
파일 보기 프로젝트 열기: paragonie/anti-csrf 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$post Injected; defaults to references to superglobals
$server
$session

보호된 프로퍼티들

프로퍼티 타입 설명
$expire_old boolean
$formIndex string
$formToken string
$hashAlgo string
$hmac_ip boolean
$recycle_after integer
$sessionIndex string

공개 메소드들

메소드 설명
__construct ( array &$post = null, array &$session = null, array &$server = null ) NULL is not a valid array type
getFormIndex ( ) : string
getFormToken ( ) : string
getSessionIndex ( ) : string
getTokenArray ( string $lockTo = '' ) : array 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 = [] ) : self Use this to change the configuration settings.
validateRequest ( ) : boolean Validate a request based on $this->session and $this->post data

보호된 메소드들

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

메소드 상세

__construct() 공개 메소드

NULL is not a valid array type
public __construct ( array &$post = null, array &$session = null, array &$server = null )
$post array
$session array
$server array

generateToken() 보호된 메소드

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

getFormIndex() 공개 메소드

public getFormIndex ( ) : string
리턴 string

getFormToken() 공개 메소드

public getFormToken ( ) : string
리턴 string

getSessionIndex() 공개 메소드

public getSessionIndex ( ) : string
리턴 string

getTokenArray() 공개 메소드

Retrieve a token array for unit testing endpoints
public getTokenArray ( string $lockTo = '' ) : array
$lockTo string
리턴 array

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

noHTML() 보호된 정적인 메소드

Wrapper for htmlentities()
protected static noHTML ( string $untrusted ) : string
$untrusted string
리턴 string

reconfigure() 공개 메소드

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

recycleTokens() 보호된 메소드

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

validateRequest() 공개 메소드

Validate a request based on $this->session and $this->post data
public validateRequest ( ) : boolean
리턴 boolean

프로퍼티 상세

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

protected bool $expire_old
리턴 boolean

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

protected string $formIndex
리턴 string

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

protected string $formToken
리턴 string

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

protected string $hashAlgo
리턴 string

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

protected bool $hmac_ip
리턴 boolean

$post 공개적으로 프로퍼티

Injected; defaults to references to superglobals
public $post

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

protected int $recycle_after
리턴 integer

$server 공개적으로 프로퍼티

public $server

$session 공개적으로 프로퍼티

public $session

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

protected string $sessionIndex
리턴 string