eclipse-edc / Technology-Aws

Apache License 2.0
7 stars 18 forks source link

Cannot obtain IAM client without endpoint override #490

Closed ronjaquensel closed 1 day ago

ronjaquensel commented 3 days ago

Bug Report

Describe the Bug

The AwsClientProviderImpl provides a method for obtaining an IAM async client. Within this method, the endpointOverride property is used as the key for storing existing IAM clients. When working with the standard AWS endpoints, the endpointOverride property will be null. Therefore null will be used as the key for the created client, causing a NullPointerException.

Expected Behavior

An IAM client can be obtained for working with AWS standard endpoints.

Observed Behavior

A NullPointerException is thrown when trying to obtain an IAM client for AWS standard endpoints.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a test case using an AwsClientProviderImpl instance
  2. Create an S3ClientRequest with endpointOverride=null
  3. Call AwsClientProviderImpl.iamAsyncClient() with the previously created S3ClientRequest
  4. See NullPointerException thrown

Possible Implementation

Define a default key that will be used if endpointOverride is null.

paullatzelsperger commented 3 days ago

does this have anything to do with https://github.com/eclipse-edc/Technology-Aws/issues/486? if so, we should coordinate efforts with the author of that issue

ronjaquensel commented 3 days ago

At first glance, I don't think the 2 are related, even though both revolve around the endpointOverride feature. 486 aims at enabling to propagate the endpointOverride property also to the SDK classes used in vault-aws, as in that module the property currently isn't regarded at all. This issue aims at adjusting the AwsClientProviderImpl to not fail if no endpoindOverride is set, but generally the property is already supported for all clients obtained via the AwsClientProviderImpl. So I'd say both issues are independent and can be tackled in parallel without dependencies on each other.

chlorochrule commented 3 days ago

Yes, that's right.

FYI: The setting key of endpointOverride for vault-aws will be defined as edc.vault.aws.endpoint.override. So, endpointOverride settings are not shared between Secrets Manager and S3.