Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* <p>Copyright &copy; 2018 Carlos Macasaet.</p>
* @author Carlos Macasaet
*/
@SuppressWarnings({"PMD.BeanMembersShouldSerialize", "PMD.TooManyMethods"})
@SuppressWarnings("PMD.TooManyMethods")
abstract class AbstractFernetKeyRotator implements RequestStreamHandler {

private final Logger logger = LogManager.getLogger(getClass());
Expand Down Expand Up @@ -177,7 +177,6 @@ protected void conditionallyCreateSecret(final String secretId, final String cli
*/
protected abstract void testSecret(String secretId, String clientRequestToken);

@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
protected void finishSecret(final String secretId, final String clientRequestToken,
final Map<String, List<String>> versions) {
final Entry<? extends String, ?> currentEntry = versions.entrySet().stream().filter(entry -> {
Expand Down
2 changes: 1 addition & 1 deletion fernet-java8/src/main/java/com/macasaet/fernet/Key.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*
* @author Carlos Macasaet
*/
@SuppressWarnings({"PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods", "PMD.GodClass"})
@SuppressWarnings("PMD.GodClass")
public class Key {

private final byte[] signingKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* The type of the payload. The Fernet token encodes the payload in binary. The type T should be a domain
* object or data transfer object representation of that data.
*/
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface StringObjectValidator<T> extends Validator<T> {

default Charset getCharset() {
Expand Down
3 changes: 1 addition & 2 deletions fernet-java8/src/main/java/com/macasaet/fernet/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*
* @author Carlos Macasaet
*/
@SuppressWarnings({"PMD.TooManyMethods", "PMD.AvoidDuplicateLiterals", "PMD.GodClass"})
@SuppressWarnings({"PMD.TooManyMethods", "PMD.GodClass"})
/*
* TooManyMethods can be avoided by making the following API-breaking changes:
* * remove the static `generate` methods and introduce a `TokenFactory` or `TokenBuilder`
Expand Down Expand Up @@ -117,7 +117,6 @@ protected Token(final byte version, final Instant timestamp, final IvParameterSp
* @throws IllegalTokenException if the input string cannot be a valid
* token irrespective of key or timestamp.
*/
@SuppressWarnings({"PMD.PrematureDeclaration", "PMD.DataflowAnomalyAnalysis"})
public static Token fromBytes(final byte[] bytes) {
if (bytes.length < minimumTokenBytes) {
throw new IllegalTokenException("Not enough bits to generate a Token");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @see StringValidator
* @author Carlos Macasaet
*/
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface Validator<T> {

/**
Expand Down Expand Up @@ -98,7 +99,6 @@ default Predicate<T> getObjectValidator() {
* @return the deserialised contents of the token
* @throws TokenValidationException if the token is invalid.
*/
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
default T validateAndDecrypt(final Key key, final Token token) {
final Instant now = Instant.now(getClock());
final byte[] plainText = token.validateAndDecrypt(key, now.minus(getTimeToLive()), now.plus(getMaxClockSkew()));
Expand Down
1 change: 1 addition & 0 deletions src/main/config/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ under the License.
<exclude name="ExcessiveImports" />
<exclude name="DataClass" />
<exclude name="LoosePackageCoupling" />
<exclude name="PublicMemberInNonPublicType" />
</rule>
<rule ref="category/java/design.xml/LawOfDemeter">
<properties>
Expand Down
Loading