From 004b8a69f96473afaee0dc0616d73fe30d314bdf Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Thu, 31 May 2018 11:45:19 +0200 Subject: [PATCH 01/19] Define payload as array, increment version. --- src/Client/Client.php | 2 +- src/Client/Request.php | 4 ++-- src/Server/Exceptions/RequestException.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 7dea56e..758de92 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -10,7 +10,7 @@ class Client { - const VERSION = '0.2.0'; + const VERSION = '0.3.0'; const DEFAULT_HASH_ALGORITHM = 'RS256'; const HEADER_API_KEY = 'API-Key'; diff --git a/src/Client/Request.php b/src/Client/Request.php index e963d22..a8b5ad6 100644 --- a/src/Client/Request.php +++ b/src/Client/Request.php @@ -9,7 +9,7 @@ abstract class Request protected $parameters; /** - * @var string|null + * @var array|null */ protected $payload; @@ -25,7 +25,7 @@ public function getParameters(): ?array return $this->parameters; } - public function getPayload(): ?string + public function getPayload(): ?array { return $this->payload; } diff --git a/src/Server/Exceptions/RequestException.php b/src/Server/Exceptions/RequestException.php index f6bd8aa..c6d4b94 100644 --- a/src/Server/Exceptions/RequestException.php +++ b/src/Server/Exceptions/RequestException.php @@ -31,7 +31,7 @@ public static function missingBearerToken(string $message = "No Bearer token fou return new static($message, static::MISSING_BEARER_TOKEN); } - public static function unresolvedPublicKey(string $message = "Could not resolve public key"): self + public static function unresolvedPublicKey(string $message = "Invalid API key"): self { return new static($message, static::UNRESOLVED_PUBLIC_KEY); } From de2bbc538e6a575f86f7dba5c6ba97f1ba4b1dca Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Tue, 17 Jul 2018 08:42:26 +0200 Subject: [PATCH 02/19] Allow Symfony 4. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b8b92cb..ed92c36 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "php": "^7.1", "firebase/php-jwt": "^5.0", "guzzlehttp/guzzle": "^6.3", - "symfony/http-foundation": "^3.4" + "symfony/http-foundation": "^3.4|^4.0" }, "config": { "preferred-install": "dist", From 05528b5bc430eb88fda23fa9b79afec25a72f3ce Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Tue, 17 Jul 2018 08:47:38 +0200 Subject: [PATCH 03/19] Create CHANGELOG.md --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fca98b6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.3.1] - 2018-07-17 +### Changed +- Allow Symfony 4 dependency. + +## [0.3.0] - 2018-05-31 +### Fixed +- Set return type of the payload to `array`. + +## [0.2.0] - 2018-05-30 +### Changed +- Always return a `Response` object. + +## [0.1.0] - 2018-05-29 +### Added +- Initial implementation of the Tikkie API. From 564227b733b2b070c9fab68d21f8e6b3ced3f595 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Tue, 17 Jul 2018 08:47:54 +0200 Subject: [PATCH 04/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fca98b6..65d22d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,4 +20,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.1.0] - 2018-05-29 ### Added -- Initial implementation of the Tikkie API. +- Initial implementation of JWT API. From bc30a4df9c45796e4fd2fea87131437e1a4c9a46 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Tue, 17 Jul 2018 08:48:59 +0200 Subject: [PATCH 05/19] Increment version. --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 758de92..ada114b 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -10,7 +10,7 @@ class Client { - const VERSION = '0.3.0'; + const VERSION = '0.3.1'; const DEFAULT_HASH_ALGORITHM = 'RS256'; const HEADER_API_KEY = 'API-Key'; From 0f7f0f3f4420569dd973571ce9a91bd8b4de9cff Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 10:36:31 +0200 Subject: [PATCH 06/19] Increase testability by adding some getters. --- src/Client/Client.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index ada114b..9ed7160 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -57,9 +57,14 @@ public function __construct(string $apiUrl, string $apiKey, array $claims = []) ])); } - protected function setHttpClient(HttpClient $httpClient): void + public function getApiUrl(): string { - $this->httpClient = $httpClient; + return $this->apiUrl; + } + + public function getApiKey(): string + { + return $this->apiKey; } public function getClaims(): array @@ -72,6 +77,11 @@ public function setClaims(array $claims): void $this->claims = $claims; } + public function setHttpClient(HttpClient $httpClient): void + { + $this->httpClient = $httpClient; + } + public function loadPrivateKey(string $path, string $hashAlgorithm = self::DEFAULT_HASH_ALGORITHM): void { $this->setPrivateKey(file_get_contents($path), $hashAlgorithm); From b988de928cd21ac9073320ca50eb1ba4d8c1811d Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 10:37:03 +0200 Subject: [PATCH 07/19] Update Client.php --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 9ed7160..136d6b0 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -10,7 +10,7 @@ class Client { - const VERSION = '0.3.1'; + const VERSION = '0.3.2'; const DEFAULT_HASH_ALGORITHM = 'RS256'; const HEADER_API_KEY = 'API-Key'; From 9fb677e88440d7fe23b75eec256de8ea95803f7d Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 10:38:10 +0200 Subject: [PATCH 08/19] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d22d0..bb5df37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.3.2] - 2019-04-05 +### Added +- Getters for the `Client` constructor parameters to ease testing. + ## [0.3.1] - 2018-07-17 ### Changed - Allow Symfony 4 dependency. From 0c2a8d51c69fcaa43f30c14aff4fdd114fc7a209 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:04:03 +0200 Subject: [PATCH 09/19] Add getters for private key and hash algorithm. --- src/Client/Client.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 9ed7160..9abd144 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -30,7 +30,7 @@ class Client private $claims; /** - * @var string + * @var string|null */ private $hashAlgorithm; @@ -40,7 +40,7 @@ class Client private $httpClient; /** - * @var string + * @var string|null */ private $privateKey; @@ -67,6 +67,16 @@ public function getApiKey(): string return $this->apiKey; } + public function getPrivateKey(): ?string + { + return $this->privateKey; + } + + public function getHashAlgorithm(): ?string + { + return $this->hashAlgorithm; + } + public function getClaims(): array { return []; From 4b3c10c9f26f7906019dc4cb1cd5bd1f5ff65bc7 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:04:32 +0200 Subject: [PATCH 10/19] Update Client.php --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index cdfc132..2474e20 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -10,7 +10,7 @@ class Client { - const VERSION = '0.3.2'; + const VERSION = '0.3.3'; const DEFAULT_HASH_ALGORITHM = 'RS256'; const HEADER_API_KEY = 'API-Key'; From fcfa3951bb91119f4f19e45ababa37635329c7b7 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:05:00 +0200 Subject: [PATCH 11/19] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb5df37..753dd99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.3.3] - 2019-04-05 +### Added +- Getters the private key and hash algorithm. + ## [0.3.2] - 2019-04-05 ### Added - Getters for the `Client` constructor parameters to ease testing. From 0d8daf725b4088b9e6b0e7b930f2ac412d63d089 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:11:41 +0200 Subject: [PATCH 12/19] Fix getClaims. --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index cdfc132..102315d 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -79,7 +79,7 @@ public function getHashAlgorithm(): ?string public function getClaims(): array { - return []; + return $this->claims; } public function setClaims(array $claims): void From c369b46c99fc338bfc13b6db6179244afcc98a90 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:12:20 +0200 Subject: [PATCH 13/19] Update Client.php --- src/Client/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/Client.php b/src/Client/Client.php index 5c16e90..4b39343 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -10,7 +10,7 @@ class Client { - const VERSION = '0.3.3'; + const VERSION = '0.3.4'; const DEFAULT_HASH_ALGORITHM = 'RS256'; const HEADER_API_KEY = 'API-Key'; From 576335c2391eebe9e142b5de3ccd125eef80eddd Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 5 Apr 2019 11:13:26 +0200 Subject: [PATCH 14/19] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 753dd99..46c6dcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] + +## [0.3.4] - 2019-04-05 +### Fixed +- `getClaims` is now actually returning the claims instead of always an empty array. + ## [0.3.3] - 2019-04-05 ### Added - Getters the private key and hash algorithm. From dd3751803f615c1be3b2634d0dd4a252b225bc87 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Thu, 4 Jun 2020 18:58:18 +0200 Subject: [PATCH 15/19] Allow Symfony 5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ed92c36..a403dbb 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "php": "^7.1", "firebase/php-jwt": "^5.0", "guzzlehttp/guzzle": "^6.3", - "symfony/http-foundation": "^3.4|^4.0" + "symfony/http-foundation": "^3.4|^4.0|^5.0" }, "config": { "preferred-install": "dist", From f43010315b745d0426421ad89cdf9ae15a090597 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Thu, 4 Jun 2020 18:59:09 +0200 Subject: [PATCH 16/19] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c6dcd..29279bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.3.5] - 2020-06-04 +### Changed +- Allow Symfony 4 dependency. ## [0.3.4] - 2019-04-05 ### Fixed From f2a248d90c5823a312319270f61be6fdb0af2bf0 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Thu, 4 Jun 2020 18:59:17 +0200 Subject: [PATCH 17/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29279bd..d0b7132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.3.5] - 2020-06-04 ### Changed -- Allow Symfony 4 dependency. +- Allow Symfony 5 dependency. ## [0.3.4] - 2019-04-05 ### Fixed From 9a473b1f3f26eff21a9656149c8ae2cf7aae6168 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Mon, 28 Dec 2020 10:59:07 +0100 Subject: [PATCH 18/19] PHP 8 and Guzzle 7 --- CHANGELOG.md | 4 ++++ composer.json | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b7132..06c0007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.4.0] - 2020-12-28 +### Changed +- Support for PHP 8 and require Guzzle 7. + ## [0.3.5] - 2020-06-04 ### Changed - Allow Symfony 5 dependency. diff --git a/composer.json b/composer.json index a403dbb..f4c134f 100644 --- a/composer.json +++ b/composer.json @@ -28,9 +28,9 @@ } }, "require": { - "php": "^7.1", - "firebase/php-jwt": "^5.0", - "guzzlehttp/guzzle": "^6.3", + "php": "^7.2|^8.0", + "firebase/php-jwt": "^5.2", + "guzzlehttp/guzzle": "^7.0", "symfony/http-foundation": "^3.4|^4.0|^5.0" }, "config": { From b0ace0ae4ae375c3e87a0e86349cef9d7e3693a5 Mon Sep 17 00:00:00 2001 From: Jarno van Leeuwen Date: Fri, 9 Sep 2022 11:10:19 +0200 Subject: [PATCH 19/19] Allow Symfony 6 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06c0007..b0b85ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.4.1] - 2022-09-09 +### Changed +- Allow Symfony 6 dependency. + ## [0.4.0] - 2020-12-28 ### Changed - Support for PHP 8 and require Guzzle 7. diff --git a/composer.json b/composer.json index f4c134f..bd1444c 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "php": "^7.2|^8.0", "firebase/php-jwt": "^5.2", "guzzlehttp/guzzle": "^7.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0" + "symfony/http-foundation": "^3.4|^4.0|^5.0|^6.0" }, "config": { "preferred-install": "dist",