diff --git a/pom.xml b/pom.xml index 5a91609..e0ea491 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ com.uid2.core.vertx.CoreVerticle io.vertx.core.Launcher - 5.3.0-c5ed833119 + 5.7.0-b6571a9981 ${project.version} diff --git a/src/main/java/com/uid2/core/handler/AttestationFailureHandler.java b/src/main/java/com/uid2/core/handler/AttestationFailureHandler.java index a75679e..da9de92 100644 --- a/src/main/java/com/uid2/core/handler/AttestationFailureHandler.java +++ b/src/main/java/com/uid2/core/handler/AttestationFailureHandler.java @@ -9,7 +9,6 @@ import io.vertx.core.json.JsonObject; import io.vertx.core.net.SocketAddress; import io.vertx.ext.web.RoutingContext; -import org.apache.commons.codec.digest.DigestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,15 +40,13 @@ private void logAttestationFailure(RoutingContext context) { final AttestationFailureReason attestationFailureReason = context.get(Const.RoutingContextData.ATTESTATION_FAILURE_REASON_PROP); final String attestationFailureDataJson = getAttestationFailureDataJson(context); - final String operatorKeyHash = DigestUtils.sha256Hex(operatorKey.getKey()); - final String originatingIpAddress = getOriginatingIpAddress(context); LOG.warn("Attestation failed. StatusCode={} Reason={} Data={} OperatorKeyHash={} OperatorKeyName={} SiteId={} Protocol={} OperatorType={} OriginatingIpAddress={}", context.response().getStatusCode(), attestationFailureReason, attestationFailureDataJson, - operatorKeyHash, + operatorKey.getKeyHash(), operatorKey.getName(), operatorKey.getSiteId(), operatorKey.getProtocol(), diff --git a/src/test/java/com/uid2/core/vertx/TestClientSideKeypairMetadataPath.java b/src/test/java/com/uid2/core/vertx/TestClientSideKeypairMetadataPath.java index 330fb72..9a55860 100644 --- a/src/test/java/com/uid2/core/vertx/TestClientSideKeypairMetadataPath.java +++ b/src/test/java/com/uid2/core/vertx/TestClientSideKeypairMetadataPath.java @@ -81,8 +81,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestCoreVerticle.java b/src/test/java/com/uid2/core/vertx/TestCoreVerticle.java index 5a699ea..f951b03 100644 --- a/src/test/java/com/uid2/core/vertx/TestCoreVerticle.java +++ b/src/test/java/com/uid2/core/vertx/TestCoreVerticle.java @@ -81,8 +81,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(Role... roles) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "test-name", "test-contact", attestationProtocol, 0, false, 88, new HashSet<>(Arrays.asList(roles)), OperatorType.PRIVATE); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "test-name", "test-contact", attestationProtocol, 0, false, 88, new HashSet<>(Arrays.asList(roles)), OperatorType.PRIVATE); + when(authProvider.get(any())).thenReturn(operatorKey); } private void post(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestServiceLinkMetadataPath.java b/src/test/java/com/uid2/core/vertx/TestServiceLinkMetadataPath.java index bb0d447..33ebb69 100644 --- a/src/test/java/com/uid2/core/vertx/TestServiceLinkMetadataPath.java +++ b/src/test/java/com/uid2/core/vertx/TestServiceLinkMetadataPath.java @@ -80,8 +80,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestServiceMetadataPath.java b/src/test/java/com/uid2/core/vertx/TestServiceMetadataPath.java index abd9572..febc4fa 100644 --- a/src/test/java/com/uid2/core/vertx/TestServiceMetadataPath.java +++ b/src/test/java/com/uid2/core/vertx/TestServiceMetadataPath.java @@ -80,8 +80,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPath.java b/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPath.java index 2a80890..40587de 100644 --- a/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPath.java +++ b/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPath.java @@ -79,8 +79,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPathDisabled.java b/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPathDisabled.java index ee603a5..2b4e026 100644 --- a/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPathDisabled.java +++ b/src/test/java/com/uid2/core/vertx/TestSiteSpecificMetadataPathDisabled.java @@ -80,8 +80,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) { diff --git a/src/test/java/com/uid2/core/vertx/TestSitesMetadataPath.java b/src/test/java/com/uid2/core/vertx/TestSitesMetadataPath.java index ea9b049..56d6bff 100644 --- a/src/test/java/com/uid2/core/vertx/TestSitesMetadataPath.java +++ b/src/test/java/com/uid2/core/vertx/TestSitesMetadataPath.java @@ -83,8 +83,8 @@ private String getUrlForEndpoint(String endpoint) { } private void fakeAuth(OperatorType operatorType, int siteId) { - OperatorKey clientKey = new OperatorKey("test-key", "test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); - when(authProvider.get(any())).thenReturn(clientKey); + OperatorKey operatorKey = new OperatorKey("test-key-hash", "test-key-salt", "", "", attestationProtocol, 0, false, siteId, new HashSet<>(), operatorType); + when(authProvider.get(any())).thenReturn(operatorKey); } private void get(Vertx vertx, String endpoint, String body, Handler>> handler) {