From e1ed155a12081278f6ffda7fdb0d78e324d8a533 Mon Sep 17 00:00:00 2001 From: Rouven Bauer Date: Thu, 2 Sep 2021 19:49:26 +0200 Subject: [PATCH 1/3] Add kerberos auth to TestKit backend --- .../org/testkit/backend/messages/requests/NewDriver.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java index 4e1d13ceb4..b73fc0a07a 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java @@ -78,12 +78,15 @@ public TestkitResponse process( TestkitState testkitState ) case "bearer": authToken = AuthTokens.bearer( data.authorizationToken.getTokens().get( "credentials" ) ); break; + case "kerberos": + authToken = AuthTokens.kerberos(data.authorizationToken.getTokens().get( "credentials" )); + break; default: return BackendError.builder() .data( BackendError .BackendErrorBody.builder() .msg( "Auth scheme " + data.authorizationToken.getTokens().get( "scheme" ) + - "not implemented" ) + " not implemented" ) .build() ) .build(); } From fea3e0a3c2c8041a4034e398f3009ccbdefdd84a Mon Sep 17 00:00:00 2001 From: Rouven Bauer Date: Tue, 7 Sep 2021 12:10:10 +0200 Subject: [PATCH 2/3] Turns out kerberos expects ticket instead of credentials --- .../neo4j/org/testkit/backend/messages/requests/NewDriver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java index b73fc0a07a..c27a992754 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java @@ -79,7 +79,7 @@ public TestkitResponse process( TestkitState testkitState ) authToken = AuthTokens.bearer( data.authorizationToken.getTokens().get( "credentials" ) ); break; case "kerberos": - authToken = AuthTokens.kerberos(data.authorizationToken.getTokens().get( "credentials" )); + authToken = AuthTokens.kerberos(data.authorizationToken.getTokens().get( "ticket" )); break; default: return BackendError.builder() From 694aaacd55642bad7f198fdec49d77ff674e68be Mon Sep 17 00:00:00 2001 From: Dmitriy Tverdiakov Date: Fri, 1 Oct 2021 16:53:22 +0100 Subject: [PATCH 3/3] Add Feature:Auth:Kerberos Testkit feature support --- .../org/testkit/backend/messages/requests/GetFeatures.java | 3 ++- .../neo4j/org/testkit/backend/messages/requests/NewDriver.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/GetFeatures.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/GetFeatures.java index d55be83b22..74f91bfb1b 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/GetFeatures.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/GetFeatures.java @@ -40,7 +40,8 @@ public class GetFeatures implements TestkitRequest "ConfHint:connection.recv_timeout_seconds", "Temporary:DriverFetchSize", "Temporary:DriverMaxTxRetryTime", - "Feature:Auth:Bearer" + "Feature:Auth:Bearer", + "Feature:Auth:Kerberos" ) ); private static final Set SYNC_FEATURES = new HashSet<>( Arrays.asList( diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java index c27a992754..66de19f464 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/NewDriver.java @@ -79,7 +79,7 @@ public TestkitResponse process( TestkitState testkitState ) authToken = AuthTokens.bearer( data.authorizationToken.getTokens().get( "credentials" ) ); break; case "kerberos": - authToken = AuthTokens.kerberos(data.authorizationToken.getTokens().get( "ticket" )); + authToken = AuthTokens.kerberos( data.authorizationToken.getTokens().get( "credentials" ) ); break; default: return BackendError.builder()