You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/07/20 18:29:16 UTC

[26/26] incubator-tinkerpop git commit: Add some javadoc to the authentication classes in gremlin server.

Add some javadoc to the authentication classes in gremlin server.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/8db98109
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/8db98109
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/8db98109

Branch: refs/heads/tp30
Commit: 8db981098be75e042146e3cc3c5407cca35671d4
Parents: f020abb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 20 12:22:08 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 20 12:22:08 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java  | 2 ++
 .../gremlin/server/auth/AuthenticationException.java          | 2 ++
 .../apache/tinkerpop/gremlin/server/auth/Authenticator.java   | 7 ++++++-
 .../tinkerpop/gremlin/server/auth/SimpleAuthenticator.java    | 3 +++
 .../server/handler/HttpBasicAuthenticationHandler.java        | 2 ++
 .../gremlin/server/handler/SaslAuthenticationHandler.java     | 6 ++++++
 6 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java
index 089d3ec..8f062fa 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AllowAllAuthenticator.java
@@ -21,6 +21,8 @@ package org.apache.tinkerpop.gremlin.server.auth;
 import java.util.Map;
 
 /**
+ * Allows all requests to be authenticated.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class AllowAllAuthenticator implements Authenticator {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AuthenticationException.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AuthenticationException.java
index 9dc5d65..99f4511 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AuthenticationException.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/AuthenticationException.java
@@ -19,6 +19,8 @@
 package org.apache.tinkerpop.gremlin.server.auth;
 
 /**
+ * An exception that occurs when during authentication such as a failed login.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class AuthenticationException extends Exception {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Authenticator.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Authenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Authenticator.java
index cbea5cc..873ae09 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Authenticator.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Authenticator.java
@@ -26,6 +26,10 @@ import org.apache.tinkerpop.gremlin.server.Channelizer;
 import java.util.Map;
 
 /**
+ * Provides methods related to authentication of a request.  Implementations should provide a SASL based
+ * authentication method, but a handler can choose to use the {@link #authenticate(Map)} method directly if
+ * required for protocols that don't easily support SASL.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public interface Authenticator {
@@ -49,7 +53,8 @@ public interface Authenticator {
 
     /**
      * A "standard" authentication implementation that can be used more generically without SASL support.  This
-     * implementation is used when a particular {@link Channelizer} doesn't support SASL directly (like REST).
+     * implementation is used when a particular {@link Channelizer} doesn't support SASL directly (like basic
+     * HTTP authentication).
      */
     public AuthenticatedUser authenticate(final Map<String, String> credentials) throws AuthenticationException;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java
index b3edc43..76dc618 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java
@@ -38,6 +38,9 @@ import static org.apache.tinkerpop.gremlin.groovy.plugin.dsl.credential.Credenti
 import static org.apache.tinkerpop.gremlin.groovy.plugin.dsl.credential.CredentialGraphTokens.PROPERTY_USERNAME;
 
 /**
+ * A simple implementation of an {@link Authenticator} that uses a {@link Graph} instance as a credential store.
+ * Management of the credential store can be handled through the {@link CredentialGraph} DSL.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class SimpleAuthenticator implements Authenticator {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java
index ccfd5fd..d9d3c1e 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java
@@ -37,6 +37,8 @@ import static org.apache.tinkerpop.gremlin.groovy.plugin.dsl.credential.Credenti
 import static org.apache.tinkerpop.gremlin.groovy.plugin.dsl.credential.CredentialGraphTokens.PROPERTY_USERNAME;
 
 /**
+ * Implements basic HTTP authentication for use with the {@link HttpGremlinEndpointHandler} and REST based API calls.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class HttpBasicAuthenticationHandler extends ChannelInboundHandlerAdapter {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8db98109/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAuthenticationHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAuthenticationHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAuthenticationHandler.java
index 9db34a1..6e88694 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAuthenticationHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SaslAuthenticationHandler.java
@@ -29,10 +29,16 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
 import org.apache.tinkerpop.gremlin.server.auth.AuthenticatedUser;
 import org.apache.tinkerpop.gremlin.server.auth.AuthenticationException;
 import org.apache.tinkerpop.gremlin.server.auth.Authenticator;
+import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer;
+import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * A SASL authentication handler that allows the {@link Authenticator} to be plugged into it. This handler is meant
+ * to be used with protocols that process a {@link RequestMessage} such as the {@link WebSocketChannelizer}
+ * or the {@link NioChannelizer}
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 @ChannelHandler.Sharable