PHP 클래스 Spatie\UrlSigner\BaseUrlSigner

상속: implements Spatie\UrlSigner\UrlSigner
파일 보기 프로젝트 열기: spatie/url-signer

보호된 프로퍼티들

프로퍼티 타입 설명
$expiresParameter string The URL's query parameter name for the expiration.
$signatureKey string The key that is used to generate secure signatures.
$signatureParameter string The URL's query parameter name for the signature.

공개 메소드들

메소드 설명
__construct ( string $signatureKey, string $expiresParameter = 'expires', string $signatureParameter = 'signature' )
sign ( string $url, DateTime | integer $expiration ) : string Get a secure URL to a controller action.
validate ( string $url ) : boolean Validate a signed url.

보호된 메소드들

메소드 설명
getExpirationTimestamp ( DateTime | integer $expiration ) : string Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days.
getIntendedUrl ( League\Url\UrlImmutable $url ) : League\Url\UrlImmutable Retrieve the intended URL by stripping off the UrlSigner specific parameters.
hasValidSignature ( League\Url\UrlImmutable $url ) : boolean Determine if the url has a forged signature.
isFuture ( integer $timestamp ) : boolean Check if an a timestamp is in the past.
isMissingAQueryParameter ( League\Url\Components\QueryInterface $query ) : boolean Check if a query is missing a necessary parameter.
signUrl ( League\Url\UrlImmutable $url, string $expiration, string $signature ) : League\Url\UrlImmutable Add expiration and signature query parameters to an url.

메소드 상세

__construct() 공개 메소드

public __construct ( string $signatureKey, string $expiresParameter = 'expires', string $signatureParameter = 'signature' )
$signatureKey string
$expiresParameter string
$signatureParameter string

getExpirationTimestamp() 보호된 메소드

Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days.
protected getExpirationTimestamp ( DateTime | integer $expiration ) : string
$expiration DateTime | integer The expiration date of this link. - DateTime: The value will be used as expiration date - int: The expiration time will be set to X days from now
리턴 string

getIntendedUrl() 보호된 메소드

Retrieve the intended URL by stripping off the UrlSigner specific parameters.
protected getIntendedUrl ( League\Url\UrlImmutable $url ) : League\Url\UrlImmutable
$url League\Url\UrlImmutable
리턴 League\Url\UrlImmutable

hasValidSignature() 보호된 메소드

Determine if the url has a forged signature.
protected hasValidSignature ( League\Url\UrlImmutable $url ) : boolean
$url League\Url\UrlImmutable
리턴 boolean

isFuture() 보호된 메소드

Check if an a timestamp is in the past.
protected isFuture ( integer $timestamp ) : boolean
$timestamp integer
리턴 boolean

isMissingAQueryParameter() 보호된 메소드

Check if a query is missing a necessary parameter.
protected isMissingAQueryParameter ( League\Url\Components\QueryInterface $query ) : boolean
$query League\Url\Components\QueryInterface
리턴 boolean

sign() 공개 메소드

Get a secure URL to a controller action.
public sign ( string $url, DateTime | integer $expiration ) : string
$url string
$expiration DateTime | integer
리턴 string

signUrl() 보호된 메소드

Add expiration and signature query parameters to an url.
protected signUrl ( League\Url\UrlImmutable $url, string $expiration, string $signature ) : League\Url\UrlImmutable
$url League\Url\UrlImmutable
$expiration string
$signature string
리턴 League\Url\UrlImmutable

validate() 공개 메소드

Validate a signed url.
public validate ( string $url ) : boolean
$url string
리턴 boolean

프로퍼티 상세

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

The URL's query parameter name for the expiration.
protected string $expiresParameter
리턴 string

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

The key that is used to generate secure signatures.
protected string $signatureKey
리턴 string

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

The URL's query parameter name for the signature.
protected string $signatureParameter
리턴 string