Changeset View
Changeset View
Standalone View
Standalone View
src/future/aws/PhutilAWSv4Signature.php
Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | final class PhutilAWSv4Signature extends Phobject { | ||||
private function getSignedHeaderList(HTTPSFuture $future) { | private function getSignedHeaderList(HTTPSFuture $future) { | ||||
$headers = $this->getCanonicalHeaderMap($future); | $headers = $this->getCanonicalHeaderMap($future); | ||||
return implode(';', array_keys($headers)); | return implode(';', array_keys($headers)); | ||||
} | } | ||||
private function getCanonicalParameterList(HTTPSFuture $future) { | private function getCanonicalParameterList(HTTPSFuture $future) { | ||||
$uri = new PhutilURI($future->getURI()); | $uri = new PhutilURI($future->getURI()); | ||||
$params = $uri->getQueryParams(); | $params = $uri->getQueryParamsAsMap(); | ||||
ksort($params); | ksort($params); | ||||
$canonical_parameters = array(); | $canonical_parameters = phutil_build_http_querystring($params); | ||||
epriestley: I tested this by calling `bin/provision events` in `core/`, which is just a simple way to make… | |||||
foreach ($params as $key => $value) { | |||||
$canonical_parameters[] = rawurlencode($key).'='.rawurlencode($value); | |||||
} | |||||
$canonical_parameters = implode('&', $canonical_parameters); | |||||
return $canonical_parameters; | return $canonical_parameters; | ||||
} | } | ||||
private function getCredential() { | private function getCredential() { | ||||
$access_key = $this->accessKey; | $access_key = $this->accessKey; | ||||
if (!strlen($access_key)) { | if (!strlen($access_key)) { | ||||
throw new PhutilInvalidStateException('setAccessKey'); | throw new PhutilInvalidStateException('setAccessKey'); | ||||
Show All 9 Lines |
I tested this by calling bin/provision events in core/, which is just a simple way to make a modern AWS call.