You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on this TractusX-edc issue, which involves using the AWS provisioner available in this repo for AWS S3 transfers, it was found that the following (async) clients check the credentials in this chain, however there is not an option to use the credentials (acessKeyId+secretAccessKeyId or keyname if applicable) provided in the tp datadestination.
So the proposal is to apply this suggestion (like seen here already for the s3Client) to the next already existing clients:
S3AsyncClient
IamAsyncClient
StsAsyncClient
Which Areas Would Be Affected?
Every TP that intends on using own credentials instead of the ones stored during the boot here, if any.
Why Is the Feature Desired?
To give more flexibility and allow the usage of this provision with an expected application (data destination with target credentials).
Further Notes
We are aware that the creation of the bucket during provision should only happen if bucket does not already exist (if exists, an exception is thrown), however proposal to update that logic will likely appear on a different issue to not mix up contexts.
Solution Proposal
Similarly to what is seen for the S3Client, overload async client creation based on provided SecretToken passing a StaticCredentialsProvider when any credentials are present.
This should be very straightforward for all three and may be similar to the next example (for S3AsyncClient)
if (token != null) {
if (token instanceof AwsTemporarySecretToken temporary) {
var credentials = AwsSessionCredentials.create(temporary.accessKeyId(), temporary.secretAccessKey(),
temporary.sessionToken());
return createS3AsyncClient(StaticCredentialsProvider.create(credentials), region, endpointOverride);
}
if (token instanceof AwsSecretToken secretToken) {
var credentials = AwsBasicCredentials.create(secretToken.getAccessKeyId(), secretToken.getSecretAccessKey());
return createS3AsyncClient(StaticCredentialsProvider.create(credentials), region, endpointOverride);
}
throw new EdcException(String.format("SecretToken %s is not supported", token.getClass()));
} else {
return s3AsyncClients.computeIfAbsent(key, s -> createS3AsyncClient(clientRequest.region(), clientRequest.endpointOverride()));
}
As mentioned, this approach is very similar to already existing behavior.
This will require to update S3BucketResourceDefinition to include the needed credentials and, in the corresponding generator (S3ConsumerResourceDefinitionGenerator), include them in the response.
The text was updated successfully, but these errors were encountered:
Feature Request
While working on this TractusX-edc issue, which involves using the AWS provisioner available in this repo for AWS S3 transfers, it was found that the following (async) clients check the credentials in this chain, however there is not an option to use the credentials (
acessKeyId+secretAccessKeyId
orkeyname
if applicable) provided in the tp datadestination.So the proposal is to apply this suggestion (like seen here already for the s3Client) to the next already existing clients:
Which Areas Would Be Affected?
Every TP that intends on using own credentials instead of the ones stored during the boot here, if any.
Why Is the Feature Desired?
To give more flexibility and allow the usage of this provision with an expected application (data destination with target credentials).
Further Notes
We are aware that the creation of the bucket during provision should only happen if bucket does not already exist (if exists, an exception is thrown), however proposal to update that logic will likely appear on a different issue to not mix up contexts.
Solution Proposal
Similarly to what is seen for the
S3Client
, overload async client creation based on providedSecretToken
passing aStaticCredentialsProvider
when any credentials are present.This should be very straightforward for all three and may be similar to the next example (for S3AsyncClient)
As mentioned, this approach is very similar to already existing behavior.
This will require to update
S3BucketResourceDefinition
to include the needed credentials and, in the corresponding generator (S3ConsumerResourceDefinitionGenerator
), include them in the response.The text was updated successfully, but these errors were encountered: