aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/S3Signature.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/ObjectStore/S3Signature.php')
-rw-r--r--lib/private/Files/ObjectStore/S3Signature.php36
1 files changed, 9 insertions, 27 deletions
diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php
index cf3d29c4185..b80382ff67d 100644
--- a/lib/private/Files/ObjectStore/S3Signature.php
+++ b/lib/private/Files/ObjectStore/S3Signature.php
@@ -1,26 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2016 Robin Appelman <robin@icewind.nl>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Daniel Kesselberg <mail@danielkesselberg.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Files\ObjectStore;
@@ -60,7 +42,7 @@ class S3Signature implements SignatureInterface {
public function signRequest(
RequestInterface $request,
- CredentialsInterface $credentials
+ CredentialsInterface $credentials,
) {
$request = $this->prepareRequest($request, $credentials);
$stringToSign = $this->createCanonicalizedString($request);
@@ -75,7 +57,7 @@ class S3Signature implements SignatureInterface {
RequestInterface $request,
CredentialsInterface $credentials,
$expires,
- array $options = []
+ array $options = [],
) {
$query = [];
// URL encoding already occurs in the URI template expansion. Undo that
@@ -112,20 +94,20 @@ class S3Signature implements SignatureInterface {
}
}
- $queryString = http_build_query($query, null, '&', PHP_QUERY_RFC3986);
+ $queryString = http_build_query($query, '', '&', PHP_QUERY_RFC3986);
return $request->withUri($request->getUri()->withQuery($queryString));
}
/**
- * @param RequestInterface $request
+ * @param RequestInterface $request
* @param CredentialsInterface $creds
*
* @return RequestInterface
*/
private function prepareRequest(
RequestInterface $request,
- CredentialsInterface $creds
+ CredentialsInterface $creds,
) {
$modify = [
'remove_headers' => ['X-Amz-Date'],
@@ -148,7 +130,7 @@ class S3Signature implements SignatureInterface {
private function createCanonicalizedString(
RequestInterface $request,
- $expires = null
+ $expires = null,
) {
$buffer = $request->getMethod() . "\n";