Skip to content

Commit 0e5c1f1

Browse files
committed
clean
1 parent b9f4aae commit 0e5c1f1

6 files changed

Lines changed: 5 additions & 20 deletions

File tree

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ ENV E2E_PHONE_SUPPORT ""
2222

2323
ENV UID2_CORE_E2E_OPERATOR_API_KEY ""
2424
ENV UID2_CORE_E2E_OPTOUT_API_KEY ""
25-
ENV UID2_CORE_E2E_OPTOUT_INTERNAL_API_KEY ""
2625
ENV UID2_CORE_E2E_CORE_URL ""
2726
ENV UID2_CORE_E2E_OPTOUT_URL ""
28-
ENV UID2_CORE_E2E_LOCALSTACK_URL ""
2927

3028
ENV UID2_OPERATOR_E2E_CLIENT_SITE_ID ""
3129
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY ""

docker-compose.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ services:
1616
- LOCALSTACK_HOST=localstack:5001
1717
- SERVICES=s3,sqs,kms
1818
- DEFAULT_REGION=us-east-1
19-
- AWS_DEFAULT_REGION=us-east-1
2019
healthcheck:
2120
test: awslocal s3api wait bucket-exists --bucket test-core-bucket
2221
&& awslocal s3api wait bucket-exists --bucket test-optout-bucket
@@ -65,10 +64,7 @@ services:
6564
core:
6665
condition: service_healthy
6766
healthcheck:
68-
test: wget --tries=1 --spider http://localhost:8081/ops/healthcheck
69-
&& wget --tries=1 --spider http://localhost:8082/ops/healthcheck || exit 1
70-
interval: 5s
71-
timeout: 10s
67+
test: wget --tries=1 --spider http://localhost:8081/ops/healthcheck || exit 1
7268
retries: 12
7369
networks:
7470
- e2e_default

src/test/java/app/component/Optout.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@ public class Optout extends App {
1616
// The SQS delta producer runs on port 8082 (8081 + 1)
1717
private static final int DELTA_PRODUCER_PORT_OFFSET = 1;
1818

19-
// Loaded lazily to avoid crashing when env var is missing
2019
private String optoutInternalApiKey;
2120

2221
public Optout(String host, Integer port, String name) {
2322
super(host, port, name);
24-
// Load API key lazily - only fail when actually used
25-
this.optoutInternalApiKey = EnvUtil.getEnv(Const.Config.Core.OPTOUT_INTERNAL_API_KEY, false);
23+
this.optoutInternalApiKey = EnvUtil.getEnv(Const.Config.Core.OPTOUT_API_KEY, false);
2624
}
2725

2826
public Optout(String host, String name) {
2927
super(host, null, name);
30-
this.optoutInternalApiKey = EnvUtil.getEnv(Const.Config.Core.OPTOUT_INTERNAL_API_KEY, false);
28+
this.optoutInternalApiKey = EnvUtil.getEnv(Const.Config.Core.OPTOUT_API_KEY, false);
3129
}
3230

3331
private String getOptoutInternalApiKey() {
3432
if (optoutInternalApiKey == null || optoutInternalApiKey.isEmpty()) {
35-
throw new IllegalStateException("Missing environment variable: " + Const.Config.Core.OPTOUT_INTERNAL_API_KEY);
33+
throw new IllegalStateException("Missing environment variable: " + Const.Config.Core.OPTOUT_API_KEY);
3634
}
3735
return optoutInternalApiKey;
3836
}

src/test/java/common/Const.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public static final class Config {
1313
public static final class Core {
1414
public static final String OPERATOR_API_KEY = "UID2_CORE_E2E_OPERATOR_API_KEY";
1515
public static final String OPTOUT_API_KEY = "UID2_CORE_E2E_OPTOUT_API_KEY";
16-
public static final String OPTOUT_INTERNAL_API_KEY = "UID2_CORE_E2E_OPTOUT_INTERNAL_API_KEY";
1716
public static final String CORE_URL = "UID2_CORE_E2E_CORE_URL";
1817
public static final String OPTOUT_URL = "UID2_CORE_E2E_OPTOUT_URL";
1918
public static final String LOCALSTACK_URL = "UID2_CORE_E2E_LOCALSTACK_URL";

src/test/java/common/KmsHelper.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private KmsHelper() {
3232
/**
3333
* Fetches the public key from LocalStack KMS for the configured key ID.
3434
*
35-
* @return The public key as a base64-encoded string (without PEM headers)
35+
* @return The public key as a base64-encoded string
3636
* @throws Exception if the key cannot be fetched or parsed
3737
*/
3838
public static String getPublicKeyFromLocalstack() throws Exception {
@@ -42,8 +42,6 @@ public static String getPublicKeyFromLocalstack() throws Exception {
4242
.build();
4343

4444
GetPublicKeyResponse response = kmsClient.getPublicKey(request);
45-
46-
// The public key is returned as raw DER-encoded bytes
4745
byte[] publicKeyBytes = response.publicKey().asByteArray();
4846

4947
// Return as base64-encoded string (format expected by JwtService)
@@ -65,10 +63,8 @@ public static PublicKey getPublicKeyObjectFromLocalstack() throws Exception {
6563

6664
GetPublicKeyResponse response = kmsClient.getPublicKey(request);
6765

68-
// The public key is returned as raw DER-encoded X.509 SubjectPublicKeyInfo
6966
byte[] publicKeyBytes = response.publicKey().asByteArray();
7067

71-
// Convert to Java PublicKey
7268
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
7369
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes);
7470
return keyFactory.generatePublic(keySpec);

src/test/java/suite/core/CoreTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public void testAttest_EmptyAttestationRequest(Core core) {
3333
/**
3434
* Tests valid attestation request with JWT signing.
3535
*
36-
* LocalStack 4.x supports KMS Sign operation for RSA keys, so JWTs are generated.
37-
*
3836
* Since LocalStack generates its own RSA key material,
3937
* we dynamically fetch the public key from LocalStack's
4038
* KMS using GetPublicKey API to validate JWT signatures.

0 commit comments

Comments
 (0)