diff --git a/composer.json b/composer.json index dee4949..b5db002 100755 --- a/composer.json +++ b/composer.json @@ -6,8 +6,9 @@ "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-framework/networking": "^11.1", "xp-forge/json": "^6.0 | ^5.0", "xp-forge/marshalling": "^2.0 | ^1.0", "php": ">=7.4.0" 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) { 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(); });