HumHub Documentation (unofficial)

SignerV4
in package
implements Signer

Version4 of signer.

Tags
author

Jérémy Derussé jeremy@derusse.com

Table of Contents

Interfaces

Signer
Interface for signing a request.

Constants

ALGORITHM_REQUEST  = 'AWS4-HMAC-SHA256'
BLACKLIST_HEADERS  = ['cache-control' => true, 'content-type' => true, 'content-length' => true, 'expect' => true, 'max-forwards' => true, 'pragma' => true, 'range' => true, 'te' => true, 'if-match' => true, 'if-none-match' => true, 'if-modified-since' => true, 'if-unmodified-since' => true, 'if-range' => true, 'accept' => true, 'authorization' => true, 'proxy-authorization' => true, 'from' => true, 'referer' => true, 'user-agent' => true, 'x-amzn-trace-id' => true, 'aws-sdk-invocation-id' => true, 'aws-sdk-retry' => true]

Properties

$region  : string
$scopeName  : string

Methods

__construct()  : mixed
presign()  : void
sign()  : void
buildBodyDigest()  : string
buildCanonicalPath()  : string
convertBodyToStream()  : void
assignAmzQueryValues()  : void
buildCanonicalHeaders()  : array<string, string>
buildCanonicalQuery()  : string
buildCanonicalRequest()  : string
buildCredentialString()  : array<string|int, string>
buildSignature()  : string
buildSigningKey()  : string
buildStringToSign()  : string
buildTime()  : void
convertBodyToQuery()  : void
convertHeaderToQuery()  : void
handleSignature()  : void
removePresign()  : void
sanitizeHostForHeader()  : void

Constants

ALGORITHM_REQUEST

private mixed ALGORITHM_REQUEST = 'AWS4-HMAC-SHA256'

BLACKLIST_HEADERS

private mixed BLACKLIST_HEADERS = ['cache-control' => true, 'content-type' => true, 'content-length' => true, 'expect' => true, 'max-forwards' => true, 'pragma' => true, 'range' => true, 'te' => true, 'if-match' => true, 'if-none-match' => true, 'if-modified-since' => true, 'if-unmodified-since' => true, 'if-range' => true, 'accept' => true, 'authorization' => true, 'proxy-authorization' => true, 'from' => true, 'referer' => true, 'user-agent' => true, 'x-amzn-trace-id' => true, 'aws-sdk-invocation-id' => true, 'aws-sdk-retry' => true]

Properties

Methods

__construct()

public __construct(string $scopeName, string $region) : mixed
Parameters
$scopeName : string
$region : string

buildBodyDigest()

protected buildBodyDigest(Request $request, bool $isPresign) : string
Parameters
$request : Request
$isPresign : bool
Return values
string

buildCanonicalPath()

protected buildCanonicalPath(Request $request) : string
Parameters
$request : Request
Return values
string

buildCanonicalHeaders()

private buildCanonicalHeaders(Request $request, bool $isPresign) : array<string, string>
Parameters
$request : Request
$isPresign : bool
Return values
array<string, string>

buildCanonicalQuery()

private buildCanonicalQuery(Request $request) : string
Parameters
$request : Request
Return values
string

buildCanonicalRequest()

private buildCanonicalRequest(Request $request, array<string, string> $canonicalHeaders, string $bodyDigest) : string
Parameters
$request : Request
$canonicalHeaders : array<string, string>
$bodyDigest : string
Return values
string

buildCredentialString()

private buildCredentialString(Request $request, Credentials $credentials, DateTimeImmutable $now, bool $isPresign) : array<string|int, string>
Parameters
$request : Request
$credentials : Credentials
$now : DateTimeImmutable
$isPresign : bool
Return values
array<string|int, string>

buildSignature()

private buildSignature(string $stringToSign, string $signingKey) : string
Parameters
$stringToSign : string
$signingKey : string
Return values
string

buildSigningKey()

private buildSigningKey(Credentials $credentials, array<string|int, string> $credentialScope) : string
Parameters
$credentials : Credentials
$credentialScope : array<string|int, string>
Return values
string

buildStringToSign()

private buildStringToSign(DateTimeImmutable $now, string $credentialString, string $canonicalRequest) : string
Parameters
$now : DateTimeImmutable
$credentialString : string
$canonicalRequest : string
Return values
string

buildTime()

private buildTime(Request $request, DateTimeImmutable $now, DateTimeImmutable $expires, bool $isPresign) : void
Parameters
$request : Request
$now : DateTimeImmutable
$expires : DateTimeImmutable
$isPresign : bool

handleSignature()

private handleSignature(Request $request, Credentials $credentials, DateTimeImmutable $now, DateTimeImmutable $expires, bool $isPresign) : void
Parameters
$request : Request
$credentials : Credentials
$now : DateTimeImmutable
$expires : DateTimeImmutable
$isPresign : bool

sanitizeHostForHeader()

private sanitizeHostForHeader(Request $request) : void
Parameters
$request : Request
Loading…
On this page

Search results