Skip to content

Commit

Permalink
Reformat javadoc for auth plugins to link to actual classes, should
Browse files Browse the repository at this point in the history
help automated tools to detect dependencies in the future.
  • Loading branch information
klaren committed Feb 9, 2018
1 parent b3b8ea4 commit 885e5a6
Show file tree
Hide file tree
Showing 22 changed files with 80 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ public void remove()
/**
* Returns the index of the first occurrence of the specified element
* in this iterable, or -1 if this iterable does not contain the element.
* More formally, returns the lowest index <tt>i</tt> such that
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
* More formally, returns the lowest index {@code i} such that
* {@code (o==null ? get(i)==null : o.equals(get(i)))},
* or -1 if there is no such index.
*
* @param itemToFind element to find
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Value nodeGetProperty( Read read, NodeCursor nodeCursor, long node
* @param nodeCursor The node cursor to use
* @param node The id of the node
* @param label The id of the label
* @return <tt>true</tt> if the node has the label, otherwise <tt>false</tt>
* @return {@code true} if the node has the label, otherwise {@code false}
* @throws EntityNotFoundException if the node is not there.
*/
public static boolean nodeHasLabel( Read read, NodeCursor nodeCursor, long node, int label )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private CompiledEquivalenceUtils()
* Checks if two objects are equal according to Cypher semantics
* @param lhs the left-hand side to check
* @param rhs the right-hand sid to check
* @return <tt>true</tt> if the two objects are equal otherwise <tt>false</tt>
* @return {@code true} if the two objects are equal otherwise {@code false}
*/
@SuppressWarnings( "unchecked" )
public static boolean equals( Object lhs, Object rhs )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface UniquenessFactory
* level of uniqueness it is not always necessary to eagerly exhaust start
* branches which can speed up the execution of the traversal.
*
* @return <tt>true</tt> if eager start branches must be used, otherwise <tt>false</tt>.
* @return {@code true} if eager start branches must be used, otherwise {@code false}.
*/
boolean eagerStartBranches();
}
4 changes: 2 additions & 2 deletions community/io/src/main/java/org/neo4j/io/fs/OpenMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
* exist then an attempt will be made to create it.
* </li>
* <li>
* {@link #SYNC}: Open for reading and writing, as with <tt>{@link #READ_WRITE}</tt>, and also
* {@link #SYNC}: Open for reading and writing, as with {@link #READ_WRITE}, and also
* require that every update to the file's content or metadata be written synchronously to the underlying storage
* device.
* </li>
* <li>
* {@link #DSYNC}: Open for reading and writing, as with <tt>{@link #READ_WRITE}</tt>, and also
* {@link #DSYNC}: Open for reading and writing, as with {@link #READ_WRITE}, and also
* require that every update to the file's content be written
* synchronously to the underlying storage device.
* </li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void nodeIndexSeek( IndexReference index, NodeValueIndexCursor cursor, IndexOrde
* Checks if a node exists in the database
*
* @param reference The reference of the node to check
* @return <tt>true</tt> if the node exists, otherwise <tt>false</tt>
* @return {@code true} if the node exists, otherwise {@code false}
*/
boolean nodeExists( long reference );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public interface SchemaRead
/**
* Checks if a constraint exists
* @param descriptor The descriptor of the constraint to check.
* @return <tt>true</tt> if the constraint exists, otherwise <tt>false</tt>
* @return {@code true} if the constraint exists, otherwise {@code false}
*/
boolean constraintExists( ConstraintDescriptor descriptor );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public interface Write
* Add a label to a node
* @param node the internal node id
* @param nodeLabel the internal id of the label to add
* @return <tt>true</tt> if a label was added otherwise <tt>false</tt>
* @return {@code true} if a label was added otherwise {@code false}
* @throws ConstraintValidationException if adding the label to node breaks a constraint
*/
boolean nodeAddLabel( long node, int nodeLabel ) throws KernelException;
Expand All @@ -70,7 +70,7 @@ public interface Write
* Remove a label from a node
* @param node the internal node id
* @param nodeLabel the internal id of the label to remove
* @return <tt>true</tt> if node was removed otherwise <tt>false</tt>
* @return {@code true} if node was removed otherwise {@code false}
*/
boolean nodeRemoveLabel( long node, int nodeLabel ) throws KernelException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public AuthorizationViolationException onViolation( String msg )
* procedure annotation.
*
* @param allowed An array of strings that encodes permissions that allows the execution of a procedure
* @return <tt>true</tt> if this mode allows the execution of a procedure with the given parameter string array
* @return {@code true} if this mode allows the execution of a procedure with the given parameter string array
* encoding permission
*/
boolean allowsProcedureWith( String[] allowed );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public class KernelTransactionImplementation implements KernelTransaction, TxSta
private Type type;
private long transactionId;
private long commitTime;
private volatile int reuseCount; // TODO: why volatile?
private volatile int reuseCount;
private volatile Map<String,Object> userMetaData;
private final Operations operations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface AuthProviderOperations
*
* @deprecated
* Settings are recommended to be stored in a separate file. You can use {@link AuthProviderOperations#neo4jHome()}
* to resolve your configuration file, e.g. <code>neo4jHome().resolve("conf/myPlugin.conf" );</code>.
* to resolve your configuration file, e.g. {@code neo4jHome().resolve("conf/myPlugin.conf" );}
*/
@Deprecated
Optional<Path> neo4jConfigFile();
Expand Down Expand Up @@ -103,35 +103,35 @@ interface Log
void error( String message );

/**
* Returns <tt>true</tt> if log level debug is enabled.
* Returns {@code true} if log level debug is enabled.
*
* @return <tt>true</tt> if log level debug is enabled, otherwise <tt>false</tt>
* @return {@code true} if log level debug is enabled, otherwise {@code false}
*/
boolean isDebugEnabled();
}

/**
* If set to <tt>true</tt> the authentication information returned by the plugin will be cached.
* If set to {@code true} the authentication information returned by the plugin will be cached.
* The expiration time of the cached information is configured by the
* <tt>dbms.security.auth_cache_ttl</tt> configuration setting.
* {@code dbms.security.auth_cache_ttl} configuration setting.
*
* <p>Since a principal can be authenticated against cached authentication information this requires
* the capability of matching the credentials of an authentication token against the credentials of the
* authentication information returned by the plugin.
*
* <p>The default value is <tt>false</tt>.
* <p>The default value is {@code false}.
*
* @param authenticationCachingEnabled if caching of authentication information should be enabled or not
*/
void setAuthenticationCachingEnabled( boolean authenticationCachingEnabled );

/**
* If set to <tt>true</tt> the authorization information (i.e. the list of roles for a given principal)
* If set to {@code true} the authorization information (i.e. the list of roles for a given principal)
* returned by the plugin will be cached.
* The expiration time of the cached information is configured by the
* <tt>dbms.security.auth_cache_ttl</tt> configuration setting.
* {@code dbms.security.auth_cache_ttl} configuration setting.
*
* The default value is <tt>true</tt>.
* The default value is {@code true}.
*
* @param authorizationCachingEnabled if caching of authorization information should be enabled or not
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@

import java.util.Map;

import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthPlugin;
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationPlugin;

/**
* The authentication token provided by the client, which is used to authenticate the subject's identity.
*
* <p>A common scenario is to have principal be a username and credentials be a password.
*
* @see org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationPlugin#authenticate(AuthToken)
* @see org.neo4j.server.security.enterprise.auth.plugin.spi.AuthPlugin#authenticateAndAuthorize(AuthToken)
* @see AuthenticationPlugin#authenticate(AuthToken)
* @see AuthPlugin#authenticateAndAuthorize(AuthToken)
*/
public interface AuthToken
{
Expand All @@ -45,7 +48,7 @@ public interface AuthToken
*
* <p>Most commonly this is a password.
*
* <p>The reason this is a character array and not a <tt>String</tt>, is so that sensitive information
* <p>The reason this is a character array and not a {@link String}, is so that sensitive information
* can be cleared from memory after useage without having to wait for the garbage collector to act.
*
* @return the credentials that verifies the identity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
*/
package org.neo4j.server.security.enterprise.auth.plugin.api;

import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationPlugin;
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthorizationPlugin;

/**
* An exception that can be thrown if authorization has expired and the user needs to re-authenticate
* in order to renew authorization.
* Throwing this exception will cause the server to disconnect the client.
*
* <p>This is typically used from the
* {@link org.neo4j.server.security.enterprise.auth.plugin.spi.AuthorizationPlugin#authorize}
* method of a combined authentication and authorization plugin (that implements
* the two separate interfaces <tt>AuthenticationPlugin</tt> and <tt>AuthorizationPlugin</tt>),
* that manages its own caching of auth info.
* <p>This is typically used from the {@link AuthorizationPlugin#authorize}
* method of a combined authentication and authorization plugin (that implements the two separate interfaces
* {@link AuthenticationPlugin} and {@link AuthorizationPlugin}), that manages its own caching of auth info.
*
* @see org.neo4j.server.security.enterprise.auth.plugin.spi.AuthorizationPlugin
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
import org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken;

/**
* An object that can be returned as the result of successful authentication by an <tt>AuthPlugin</tt>.
* An object that can be returned as the result of successful authentication by an {@link AuthPlugin}.
*
* <p>This result type combines authentication and authorization information.
*
* <p>NOTE: If authentication caching is enabled the result type <tt>CacheableAuthInfo</tt> should be used instead.
* <p>NOTE: If authentication caching is enabled the result type {@link CacheableAuthInfo} should be used instead.
*
* @see AuthPlugin#authenticateAndAuthorize(AuthToken)
* @see CacheableAuthInfo
*/
public interface AuthInfo extends Serializable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
/**
* A simplified combined authentication and authorization provider plugin for the Neo4j enterprise security module.
*
* <p>If either the configuration setting <tt>dbms.security.plugin.authentication_enabled</tt> or
* <tt>dbms.security.plugin.authorization_enabled</tt> is set to <tt>true</tt>,
* <p>If either the configuration setting {@code dbms.security.plugin.authentication_enabled} or
* {@code dbms.security.plugin.authorization_enabled} is set to {@code true},
* all objects that implements this interface that exists in the class path at Neo4j startup, will be
* loaded as services.
*
Expand All @@ -48,15 +48,15 @@ public interface AuthPlugin extends AuthProviderLifecycle

/**
* Should perform both authentication and authorization of the identity in the given auth token and return an
* <tt>AuthInfo</tt> result if successful. The <tt>AuthInfo</tt> result can also contain a collection of roles
* {@link AuthInfo} result if successful. The {@link AuthInfo} result can also contain a collection of roles
* that are assigned to the given identity, which constitutes the authorization part.
*
* If authentication failed, either <tt>null</tt> should be returned,
* or an <tt>AuthenticationException</tt> should be thrown.
* If authentication failed, either {@code null} should be returned,
* or an {@link AuthenticationException} should be thrown.
*
* <p>If authentication caching is enabled, then a <tt>CacheableAuthInfo</tt> should be returned.
* <p>If authentication caching is enabled, then a {@link CacheableAuthInfo} should be returned.
*
* @return an <tt>AuthInfo</tt> object if authentication was successful, otherwise <tt>null</tt>
* @return an {@link AuthInfo} object if authentication was successful, otherwise {@code null}
*
* @see org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken
* @see AuthenticationInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken;

/**
* An object that can be returned as the result of successful authentication by an <tt>AuthenticationPlugin</tt>.
* An object that can be returned as the result of successful authentication by an {@link AuthenticationPlugin}.
*
* @see AuthenticationPlugin#authenticate(AuthToken)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* An authentication provider plugin for the Neo4j enterprise security module.
*
* <p>If the configuration setting <tt>dbms.security.plugin.authentication_enabled</tt> is set to <tt>true</tt>,
* <p>If the configuration setting {@code dbms.security.plugin.authentication_enabled} is set to {@code true},
* all objects that implements this interface that exists in the class path at Neo4j startup, will be
* loaded as services.
*
Expand All @@ -47,22 +47,20 @@ public interface AuthenticationPlugin extends AuthProviderLifecycle

/**
* Should perform authentication of the identity in the given auth token and return an
* <tt>AuthenticationInfo</tt> result if successful.
* If authentication failed, either <tt>null</tt> should be returned,
* or an <tt>AuthenticationException</tt> should be thrown.
* {@link AuthenticationInfo} result if successful.
* If authentication failed, either {@code null} should be returned,
* or an {@link AuthenticationException} should be thrown.
* <p>
* If authentication caching is enabled, either a {@link CacheableAuthenticationInfo} or a
* {@link CustomCacheableAuthenticationInfo} should be returned.
*
* <p>If authentication caching is enabled, either a <tt>CacheableAuthenticationInfo</tt> or a
* <tt>CustomCacheableAuthenticationInfo</tt> should be returned.
*
* @return an <tt>AuthenticationInfo</tt> object if authentication was successful, otherwise <tt>null</tt>
* @return an {@link AuthenticationInfo} object if authentication was successful, otherwise {@code null}
* @throws AuthenticationException if authentication failed
*
* @see org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken
* @see AuthenticationInfo
* @see CacheableAuthenticationInfo
* @see CustomCacheableAuthenticationInfo
* @see AuthProviderOperations#setAuthenticationCachingEnabled(boolean)
*/
AuthenticationInfo authenticate( AuthToken authToken );
AuthenticationInfo authenticate( AuthToken authToken ) throws AuthenticationException;

abstract class Adapter extends AuthProviderLifecycle.Adapter implements AuthenticationPlugin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
import java.util.Collection;

/**
* An object that can be returned as the result of authorization by an <tt>AuthorizationPlugin</tt>.
* An object that can be returned as the result of authorization by an {@link AuthorizationPlugin}.
*
* @see AuthorizationPlugin#authorize(Collection)
*/
public interface AuthorizationInfo extends Serializable
{
/**
* Should return a collection of roles assigned to the principals recognized by an <tt>AuthorizationPlugin</tt>.
* Should return a collection of roles assigned to the principals recognized by an {@link AuthorizationPlugin}.
*
* @return the roles assigned to the principals recognized by an <tt>AuthorizationPlugin</tt>
* @return the roles assigned to the principals recognized by an {@link AuthorizationPlugin}.
*/
Collection<String> roles();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
/**
* An authorization provider plugin for the Neo4j enterprise security module.
*
* <p>If the configuration setting <tt>dbms.security.plugin.authorization_enabled</tt> is set to <tt>true</tt>,
* <p>If the configuration setting {@code dbms.security.plugin.authorization_enabled} is set to {@code true},
* all objects that implements this interface that exists in the class path at Neo4j startup, will be
* loaded as services.
*
* <p>NOTE: If the same object also implements <tt>AuthenticationPlugin</tt>, it will not be loaded twice.
* <p>NOTE: If the same object also implements {@link AuthenticationPlugin}, it will not be loaded twice.
*
* @see AuthenticationPlugin
* @see AuthPlugin
* @see AuthorizationExpiredException
*/
Expand Down Expand Up @@ -75,12 +74,12 @@ public String provider()

/**
* Should perform authorization of the given collection of principals and their corresponding authentication
* providers, and return an <tt>AuthorizationInfo</tt> result that contains a collection of roles
* providers, and return an {@link AuthorizationInfo} result that contains a collection of roles
* that are assigned to the given principals.
*
* @param principals a collection of principals and their corresponding authentication providers
*
* @return an <tt>AuthorizationInfo</tt> result that contains the roles that are assigned to the given principals
* @return an {@link AuthorizationInfo} result that contains the roles that are assigned to the given principals
*/
AuthorizationInfo authorize( Collection<PrincipalAndProvider> principals );

Expand Down

0 comments on commit 885e5a6

Please sign in to comment.