Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IERSPPRT-1549: Add external ID to assume ier client role #122

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
API_ERO_MANAGEMENT_URL: http://wiremock:8080/ero-management-api
API_IER_BASE_URL: http://wiremock:8080/ier-ero
API_IER_STS_ASSUME_ROLE: arn:aws:iam::1234567890987:role/grant-me-access-to-ier
API_IER_STS_ASSUME_ROLE_EXTERNAL_ID: abc123
depends_on:
database:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import java.net.URI
class IerRestTemplateConfiguration(
@Value("\${api.ier.base.url}") private val ierApiBaseUrl: String,
@Value("\${api.ier.sts.assume.role}") private val ierStsAssumeRole: String,
@Value("\${api.ier.sts.assume.role.external-id}") private val ierStsAssumeRoleExternalId: String,
private val correlationIdRestTemplateClientHttpRequestInterceptor: CorrelationIdRestTemplateClientHttpRequestInterceptor,
) {

Expand All @@ -50,6 +51,7 @@ class IerRestTemplateConfiguration(
AssumeRoleRequest.builder()
.roleArn(ierStsAssumeRole)
.roleSessionName(STS_SESSION_NAME)
.externalId(ierStsAssumeRoleExternalId)
.build()
)
.stsClient(stsClient)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ api:
ier:
base.url: ${API_IER_BASE_URL}
sts.assume.role: ${API_IER_STS_ASSUME_ROLE}
sts.assume.role.external-id: ${API_IER_STS_ASSUME_ROLE_EXTERNAL_ID}

jobs:
enabled: true
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/application-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ api:
ier:
base.url: http://replaced-by-wireMockServer-bean
sts.assume.role: arn:aws:iam::1234567890987:role/grant-me-access-to-ier
sts.assume.role.external-id: abc123

caching.time-to-live: PT2S

Expand Down
Loading