Skip to content

Commit 722271e

Browse files
committed
debug
1 parent 245ed8d commit 722271e

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ENV UID2_CORE_E2E_OPTOUT_API_KEY ""
2323
ENV UID2_CORE_E2E_OPTOUT_INTERNAL_API_KEY "test-optout-internal-key"
2424
ENV UID2_CORE_E2E_CORE_URL ""
2525
ENV UID2_CORE_E2E_OPTOUT_URL ""
26+
ENV UID2_CORE_E2E_LOCALSTACK_URL ""
2627

2728
ENV UID2_OPERATOR_E2E_CLIENT_SITE_ID ""
2829
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY ""

src/test/java/common/Const.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static final class Core {
1616
public static final String OPTOUT_INTERNAL_API_KEY = "UID2_CORE_E2E_OPTOUT_INTERNAL_API_KEY";
1717
public static final String CORE_URL = "UID2_CORE_E2E_CORE_URL";
1818
public static final String OPTOUT_URL = "UID2_CORE_E2E_OPTOUT_URL";
19+
public static final String LOCALSTACK_URL = "UID2_CORE_E2E_LOCALSTACK_URL";
1920
}
2021

2122
// Args used for Operator E2Es

src/test/java/common/KmsHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@
2222
*/
2323
public final class KmsHelper {
2424

25-
private static final String LOCALSTACK_ENDPOINT = "http://localhost:5001";
25+
private static final String DEFAULT_LOCALSTACK_ENDPOINT = "http://localstack:5001";
2626
private static final String KMS_KEY_ID = "ff275b92-0def-4dfc-b0f6-87c96b26c6c7";
2727
private static final Region REGION = Region.US_EAST_1;
2828

2929
private KmsHelper() {
3030
}
3131

32+
private static String getLocalstackEndpoint() {
33+
String endpoint = EnvUtil.getEnv(Const.Config.Core.LOCALSTACK_URL, false);
34+
return (endpoint != null && !endpoint.isBlank()) ? endpoint : DEFAULT_LOCALSTACK_ENDPOINT;
35+
}
36+
3237
/**
3338
* Fetches the public key from LocalStack KMS for the configured key ID.
3439
*
@@ -76,8 +81,9 @@ public static PublicKey getPublicKeyObjectFromLocalstack() throws Exception {
7681
}
7782

7883
private static KmsClient createLocalstackKmsClient() {
84+
String endpoint = getLocalstackEndpoint();
7985
return KmsClient.builder()
80-
.endpointOverride(URI.create(LOCALSTACK_ENDPOINT))
86+
.endpointOverride(URI.create(endpoint))
8187
.region(REGION)
8288
.credentialsProvider(StaticCredentialsProvider.create(
8389
AwsBasicCredentials.create("test", "test")))

0 commit comments

Comments
 (0)