diff --git a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/TestingCredentialsRolesProvider.java b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/TestingCredentialsRolesProvider.java index c6448274..e21baf2a 100644 --- a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/TestingCredentialsRolesProvider.java +++ b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/TestingCredentialsRolesProvider.java @@ -69,7 +69,9 @@ public Optional credentials(String emulatedAccessKey, Optional Credentials.build(session.sessionCredential, originalCredentials.requiredRemoteCredential(), remoteSessionRole)) + .orElseGet(() -> Credentials.build(session.sessionCredential, originalCredentials.requiredRemoteCredential()))); }); } diff --git a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/containers/S3Container.java b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/containers/S3Container.java index a53775e5..e5d23a6f 100644 --- a/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/containers/S3Container.java +++ b/trino-aws-proxy/src/test/java/io/trino/aws/proxy/server/testing/containers/S3Container.java @@ -75,12 +75,13 @@ public class S3Container "Statement": [ { "Effect": "Allow", - "Action": [ - "s3:*" - ], - "Resource": [ - "arn:aws:s3:::*" - ] + "Action": "s3:*", + "Resource": "arn:aws:s3:::*", + "Condition": { + "StringEquals": { + "aws:principaltype": "AssumedRole" + } + } } ] }