File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ ENV UID2_CORE_E2E_OPTOUT_API_KEY ""
2323ENV UID2_CORE_E2E_OPTOUT_INTERNAL_API_KEY "test-optout-internal-key"
2424ENV UID2_CORE_E2E_CORE_URL ""
2525ENV UID2_CORE_E2E_OPTOUT_URL ""
26+ ENV UID2_CORE_E2E_LOCALSTACK_URL ""
2627
2728ENV UID2_OPERATOR_E2E_CLIENT_SITE_ID ""
2829ENV UID2_OPERATOR_E2E_CLIENT_API_KEY ""
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 2222 */
2323public 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" )))
You can’t perform that action at this time.
0 commit comments