Skip to content

Commit 6c2a849

Browse files
authored
Merge pull request #277 from IABTechLab/mkc-UID2-4774-require-attestation-operator-config
Require attestation for operator config
2 parents 03f72c9 + 14544c9 commit 6c2a849

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

conf/local-e2e-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
"core_public_url": "http://localhost:8088",
3636
"optout_url": "http://localhost:8081",
3737
"s3_keys_metadata_path": "s3encryption_keys/metadata.json",
38-
"cloud_keys_metadata_path": "cloud_encryption_keys/metadata.json",
38+
"cloud_encryption_keys_metadata_path": "cloud_encryption_keys/metadata.json",
3939
"encryption_support_version": "6.0.0"
4040
}

conf/operator/operator-config.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"identity_token_expires_after_seconds": 3600,
3-
"refresh_token_expires_after_seconds": 86400,
4-
"refresh_identity_token_after_seconds": 900,
5-
"sharing_token_expiry_seconds": 2592000
2+
"version": 1,
3+
"runtime_config": {
4+
"identity_token_expires_after_seconds": 3600,
5+
"refresh_token_expires_after_seconds": 86400,
6+
"refresh_identity_token_after_seconds": 900,
7+
"sharing_token_expiry_seconds": 2592000
8+
}
69
}

src/main/java/com/uid2/core/vertx/CoreVerticle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private Router createRoutesSetup() {
201201
router.get(Endpoints.OPERATORS_REFRESH.toString()).handler(auth.handle(attestationMiddleware.handle(this::handleOperatorRefresh), Role.OPTOUT_SERVICE));
202202
router.get(Endpoints.PARTNERS_REFRESH.toString()).handler(auth.handle(attestationMiddleware.handle(this::handlePartnerRefresh), Role.OPTOUT_SERVICE));
203203
router.get(Endpoints.OPS_HEALTHCHECK.toString()).handler(this::handleHealthCheck);
204-
router.get(Endpoints.OPERATOR_CONFIG.toString()).handler(auth.handle(this::handleGetConfig, Role.OPERATOR));
204+
router.get(Endpoints.OPERATOR_CONFIG.toString()).handler(auth.handle(attestationMiddleware.handle(this::handleGetConfig), Role.OPERATOR));
205205

206206
if (Optional.ofNullable(ConfigStore.Global.getBoolean("enable_test_endpoints")).orElse(false)) {
207207
router.route(Endpoints.ATTEST_GET_TOKEN.toString()).handler(auth.handle(this::handleTestGetAttestationToken, Role.OPERATOR));

src/test/java/com/uid2/core/vertx/CoreVerticleTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,11 @@ void keysRefreshSuccessNoHeaderVersion(Vertx vertx, VertxTestContext testContext
894894
}
895895

896896
@Test
897+
@Tag("dontForceJwt")
897898
void getConfigSuccess(Vertx vertx, VertxTestContext testContext) {
898899
JsonObject expectedConfig = new JsonObject(operatorConfig);
899900

900-
fakeAuth(Role.OPERATOR);
901+
fakeAuth(attestationProtocolPublic, "PUBLIC", Role.OPERATOR);
901902

902903
// Make HTTP Get request to operator config endpoint
903904
this.get(vertx, Endpoints.OPERATOR_CONFIG.toString(), testContext.succeeding(response -> testContext.verify(() -> {
@@ -911,10 +912,11 @@ void getConfigSuccess(Vertx vertx, VertxTestContext testContext) {
911912
}
912913

913914
@Test
915+
@Tag("dontForceJwt")
914916
void getConfigInvalidJson(Vertx vertx, VertxTestContext testContext) {
915917
operatorConfig = "invalid config";
916918

917-
fakeAuth(Role.OPERATOR);
919+
fakeAuth(attestationProtocolPublic, "PUBLIC", Role.OPERATOR);
918920

919921
this.get(vertx, Endpoints.OPERATOR_CONFIG.toString(), testContext.succeeding(response -> testContext.verify(() -> {
920922
assertEquals(500, response.statusCode());

0 commit comments

Comments
 (0)