Skip to content

Commit

Permalink
chore: add checkstyle rule (#2091)
Browse files Browse the repository at this point in the history
* feat: add unused imports checkstyle rule

* feat: add java doc style rule

* fix: check style
  • Loading branch information
guqing authored May 17, 2022
1 parent 3cf2f9d commit be2c065
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 27 deletions.
2 changes: 2 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="UnusedImports"/>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap">
Expand Down Expand Up @@ -325,6 +326,7 @@
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocStyle"/>
<module name="JavadocMethod">
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private ProviderSettings(Map<String, Object> settings) {
}

/**
* Returns the URL of the Provider's Issuer Identifier
* Returns the URL of the Provider's Issuer Identifier.
*
* @return the URL of the Provider's Issuer Identifier
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class BearerTokenAuthentication
private final Map<String, Object> attributes;

/**
* Constructs a {@link BearerTokenAuthentication} with the provided arguments
* Constructs a {@link BearerTokenAuthentication} with the provided arguments.
*
* @param principal The OAuth 2.0 attributes
* @param credentials The verified token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void commence(HttpServletRequest request, HttpServletResponse response,
}

/**
* Set the default realm name to use in the bearer token error response
* Set the default realm name to use in the bearer token error response.
*
* @param realmName realm name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class BearerTokenAuthenticationFilter extends OncePerRequestFilter {
new NullSecurityContextRepository();

/**
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s)
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s).
*
* @param authenticationManagerResolver authentication manager resolver
*/
Expand All @@ -72,7 +72,7 @@ public BearerTokenAuthenticationFilter(
}

/**
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s)
* Construct a {@code BearerTokenAuthenticationFilter} using the provided parameter(s).
*
* @param authenticationManager authentication manager
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BearerTokenAuthenticationToken extends AbstractAuthenticationToken
private final String token;

/**
* Create a {@code BearerTokenAuthenticationToken} using the provided parameter(s)
* Create a {@code BearerTokenAuthenticationToken} using the provided parameter(s).
*
* @param token - the bearer token
*/
Expand All @@ -28,7 +28,7 @@ public BearerTokenAuthenticationToken(String token) {

/**
* Get the
* <a href="https://tools.ietf.org/html/rfc6750#section-1.2">Bearer Token</a>
* <a href="https://tools.ietf.org/html/rfc6750#section-1.2">Bearer Token</a>.
*
* @return the token that proves the caller's authority to perform the
* {@link jakarta.servlet.http.HttpServletRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class BearerTokenError extends OAuth2Error {
private final String scope;

/**
* Create a {@code BearerTokenError} using the provided parameters
* Create a {@code BearerTokenError} using the provided parameters.
*
* @param errorCode the error code
* @param httpStatus the HTTP status
Expand All @@ -33,7 +33,7 @@ public BearerTokenError(String errorCode, HttpStatus httpStatus, String descript
}

/**
* Create a {@code BearerTokenError} using the provided parameters
* Create a {@code BearerTokenError} using the provided parameters.
*
* @param errorCode the error code
* @param httpStatus the HTTP status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* A factory for creating {@link BearerTokenError} instances that correspond to the
* registered <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error Codes</a>
* registered <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error Codes</a>.
*
* @author guqing
* @since 2.0.0
Expand All @@ -24,7 +24,7 @@ private BearerTokenErrors() {
}

/**
* Create a {@link BearerTokenError} caused by an invalid request
* Create a {@link BearerTokenError} caused by an invalid request.
*
* @param message a description of the error
* @return a {@link BearerTokenError}
Expand All @@ -42,7 +42,7 @@ public static BearerTokenError invalidRequest(String message) {
}

/**
* Create a {@link BearerTokenError} caused by an invalid token
* Create a {@link BearerTokenError} caused by an invalid token.
*
* @param message a description of the error
* @return a {@link BearerTokenError}
Expand All @@ -60,7 +60,7 @@ public static BearerTokenError invalidToken(String message) {
}

/**
* Create a {@link BearerTokenError} caused by an invalid token
* Create a {@link BearerTokenError} caused by an invalid token.
*
* @param scope the scope attribute to use in the error
* @return a {@link BearerTokenError}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Map<String, Object> getTokenAttributes() {
}

/**
* The principal name which is, by default, the {@link Jwt}'s subject
* The principal name which is, by default, the {@link Jwt}'s subject.
*/
@Override
public String getName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;

/**
* authorizing visitor short-circuits once allowed, and collects any resolution errors encountered
* authorizing visitor short-circuits once allowed, and collects any resolution errors encountered.
*
* @author guqing
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ public class RequestInfoFactory {
new RequestInfoFactory(Set.of("api", "apis"), Set.of("api"));

/**
* without leading and trailing slashes
* without leading and trailing slashes.
*/
final Set<String> apiPrefixes;

/**
* without leading and trailing slashes
* without leading and trailing slashes.
*/
final Set<String> grouplessApiPrefixes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.Data;

/**
* RoleRef contains information that points to the role being used
* RoleRef contains information that points to the role being used.
*
* @author guqing
* @since 2.0.0
Expand All @@ -12,17 +12,17 @@
public class RoleRef {

/**
* Kind is the type of resource being referenced
* Kind is the type of resource being referenced.
*/
String kind;

/**
* Name is the name of resource being referenced
* Name is the name of resource being referenced.
*/
String name;

/**
* APIGroup is the group for the resource being referenced
* APIGroup is the group for the resource being referenced.
*/
String apiGroup;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import run.halo.app.identity.authentication.verifier.BearerTokenAuthentication;

/**
* Tests for {@link BearerTokenAuthentication}
* Tests for {@link BearerTokenAuthentication}.
*
* @author guqing
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import run.halo.app.identity.authentication.verifier.BearerTokenAuthenticationToken;

/**
* Tests for {@link BearerTokenAuthenticationToken}
* Tests for {@link BearerTokenAuthenticationToken}.
*
* @author guqing
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import run.halo.app.identity.authentication.verifier.BearerTokenError;

/**
* Tests for {@link BearerTokenError}
* Tests for {@link BearerTokenError}.
*
* @author guqing
* @see <a href="https://tools.ietf.org/html/rfc6750#section-3.1">Bearer Token Error</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import run.halo.app.identity.authentication.verifier.BearerTokenErrors;

/**
* Tests for {@link BearerTokenErrors}
* Tests for {@link BearerTokenErrors}.
*
* @author guqing
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import run.halo.app.identity.authentication.verifier.JwtAuthenticationToken;

/**
* Tests for {@link JwtAuthenticationProvider}
* Tests for {@link JwtAuthenticationProvider}.
*
* @author guqing
* @since 2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import run.halo.app.identity.authentication.verifier.JwtGrantedAuthoritiesConverter;

/**
* Tests for {@link JwtGrantedAuthoritiesConverter}
* Tests for {@link JwtGrantedAuthoritiesConverter}.
*
* @author guqing
* @since 2.0.0
Expand Down

0 comments on commit be2c065

Please sign in to comment.