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
Using the OpenAPI plugin, if we use AWS roles to access our S3 buckets Imposter fails to access the spec files:
java.lang.RuntimeException: Failed to load specification from source [s3://my-sample-bucket/config/OpenAPI-sample.json] or cache
at io.gatehill.imposter.plugin.openapi.service.SpecificationLoaderService.loadSpecFromSourceOrCache(SpecificationLoaderService.kt:141) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.plugin.openapi.service.SpecificationLoaderService.parseSpecification(SpecificationLoaderService.kt:79) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.plugin.openapi.OpenApiPluginImpl.parseSpecs(OpenApiPluginImpl.kt:166) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.plugin.openapi.OpenApiPluginImpl.configureRoutes(OpenApiPluginImpl.kt:136) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.Imposter.configureRoutes(Imposter.kt:220) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.Imposter.access$configureRoutes(Imposter.kt:87) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.Imposter$start$1.invokeSuspend(Imposter.kt:134) ~[imposter-3.24.1.jar:?]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[imposter-3.24.1.jar:?]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[imposter-3.24.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) ~[imposter-3.24.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[imposter-3.24.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) ~[imposter-3.24.1.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) ~[imposter-3.24.1.jar:?]
Caused by: java.lang.RuntimeException: Error fetching file from S3: s3://my-sample-bucket/config/OpenAPI-sample.json
at io.gatehill.imposter.config.S3FileDownloader.readFileFromS3(S3FileDownloader.kt:95) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.plugin.openapi.service.SpecificationLoaderService.loadSpecFromSource(SpecificationLoaderService.kt:154) ~[imposter-3.24.1.jar:?]
at io.gatehill.imposter.plugin.openapi.service.SpecificationLoaderService.loadSpecFromSourceOrCache(SpecificationLoaderService.kt:134) ~[imposter-3.24.1.jar:?]
... 12 more
Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 2J7H99SCAB45P495; S3 Extended Request ID: lE9RzBFfCbnqjgo1c26YYHsgNIplgjgG7gCTVbBFJ41inNqEHS99NvjAsjvpxaVkpSh2ioVLpA4=; Proxy: null)
The issue is solved by adding aws-java-sdk-sts as a dependency so the WebIdentityTokenCredentialsProvider used in the DefaultAWSCredentialsProviderChain can load the profile defined in the ~/.aws/credentials file:
[default]
region = us-west-2
output = json
role_arn = arn:aws:iam::123456789012:role/myRole
source_profile = personal
[personal]
aws_access_key_id = <access-key>
aws_secret_access_key = <secret-key>
The text was updated successfully, but these errors were encountered:
Using the OpenAPI plugin, if we use AWS roles to access our S3 buckets Imposter fails to access the spec files:
The issue is solved by adding
aws-java-sdk-sts
as a dependency so theWebIdentityTokenCredentialsProvider
used in theDefaultAWSCredentialsProviderChain
can load the profile defined in the~/.aws/credentials
file:The text was updated successfully, but these errors were encountered: