From d0c58651a75f7c7ae8f21f47214ff2c3d389783c Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 21 Jun 2026 17:52:38 +0200 Subject: [PATCH 1/3] Refactor I/O exceptions --- composer.json | 2 +- src/main/php/com/amazon/aws/credentials/FromSSO.class.php | 6 +++--- .../amazon/aws/unittest/CredentialProviderTest.class.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index dee4949..5d87c88 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "description" : "AWS Core for the XP Framework", "keywords": ["module", "xp"], "require" : { - "xp-framework/core": "^12.0 | ^11.0 | ^10.14", + "xp-framework/core": "^12.11 | ^11.11", "xp-framework/http": "^11.0 | ^10.0 | ^9.0", "xp-forge/json": "^6.0 | ^5.0", "xp-forge/marshalling": "^2.0 | ^1.0", diff --git a/src/main/php/com/amazon/aws/credentials/FromSSO.class.php b/src/main/php/com/amazon/aws/credentials/FromSSO.class.php index 763115c..60ed617 100644 --- a/src/main/php/com/amazon/aws/credentials/FromSSO.class.php +++ b/src/main/php/com/amazon/aws/credentials/FromSSO.class.php @@ -1,7 +1,7 @@ $this->userAgent, 'Content-Type' => self::JSON, ]); - } catch (IOException $t) { - throw new IllegalStateException("OIDC refreshing via {$this->refresh->getUrl()->getURL()} failed", $t); + } catch (OperationFailed $e) { + throw new IllegalStateException("OIDC refreshing via {$this->refresh->getUrl()->getURL()} failed", $e); } if (200 !== $res->statusCode()) { diff --git a/src/test/php/com/amazon/aws/unittest/CredentialProviderTest.class.php b/src/test/php/com/amazon/aws/unittest/CredentialProviderTest.class.php index 99f5c12..ad23e57 100755 --- a/src/test/php/com/amazon/aws/unittest/CredentialProviderTest.class.php +++ b/src/test/php/com/amazon/aws/unittest/CredentialProviderTest.class.php @@ -2,9 +2,9 @@ use com\amazon\aws\credentials\{FromGiven, FromEnvironment, FromConfig, FromEcs, FromSSO}; use com\amazon\aws\{Credentials, CredentialProvider}; -use io\{TempFile, IOException}; +use io\TempFile; use lang\IllegalStateException; -use peer\AuthenticationException; +use peer\{AuthenticationException, ConnectException}; use test\{Assert, Expect, Test, Values}; use text\json\{Json, FileInput}; use util\NoSuchElementException; @@ -370,7 +370,7 @@ public function ecs_api_error_raises_exception() { public function ecs_api_failing_raises_exception() { with (new Exported(['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' => '/get-credentials']), function() { $conn= new TestConnection(['/get-credentials' => function($req) { - throw new IOException('Connection failed'); + throw new ConnectException('Connection failed'); }]); (new FromEcs($conn))->credentials(); }); From ded2ec4e59be8cbe8f583e93bb68caea69e325d0 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 21 Jun 2026 17:55:41 +0200 Subject: [PATCH 2/3] QA: Adjust apidocs --- src/main/php/com/amazon/aws/ServiceEndpoint.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/php/com/amazon/aws/ServiceEndpoint.class.php b/src/main/php/com/amazon/aws/ServiceEndpoint.class.php index 90f1eb7..38a2557 100755 --- a/src/main/php/com/amazon/aws/ServiceEndpoint.class.php +++ b/src/main/php/com/amazon/aws/ServiceEndpoint.class.php @@ -200,7 +200,7 @@ public function sign($target, int $expires= 3600, $time= null): string { /** * Opens a request and returns a `Transfer` instance for writing data to * - * @throws io.IOException + * @throws io.OperationFailed */ public function open(string $method, $target, array $headers, $hash= null, $time= null): Transfer { $signature= new SignatureV4($this->credentials()); @@ -263,7 +263,7 @@ public function open(string $method, $target, array $headers, $hash= null, $time /** * Sends a request and returns the response * - * @throws io.IOException + * @throws io.OperationFailed */ public function request(string $method, $target, array $headers= [], $payload= null, $time= null): Response { if (null === $payload) { From 1ac85bc5adcb008b2298bfe17e00a9fbc798045f Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 21 Jun 2026 18:11:07 +0200 Subject: [PATCH 3/3] Cache-busting: Force xp-framework/networking 11.1+ --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 5d87c88..b5db002 100755 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "require" : { "xp-framework/core": "^12.11 | ^11.11", "xp-framework/http": "^11.0 | ^10.0 | ^9.0", + "xp-framework/networking": "^11.1", "xp-forge/json": "^6.0 | ^5.0", "xp-forge/marshalling": "^2.0 | ^1.0", "php": ">=7.4.0"