From 4b5c2094fb7cd6151dd819cca883155e806303d9 Mon Sep 17 00:00:00 2001 From: Robin Duda Date: Tue, 1 May 2018 15:53:18 +0200 Subject: [PATCH] fail silently when token type is missing if there is no crypto payload. --- build.gradle | 2 +- core/main/java/com/codingchili/core/security/TokenFactory.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index fc8559d2..3aab923a 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'java' apply plugin: 'idea' apply plugin: 'maven' -project.version = "1.0.34-SNAPSHOT" +project.version = "1.0.35-SNAPSHOT" project.group = 'com.github.codingchili.chili-core' subprojects { diff --git a/core/main/java/com/codingchili/core/security/TokenFactory.java b/core/main/java/com/codingchili/core/security/TokenFactory.java index 6a992df9..13ba4e5e 100644 --- a/core/main/java/com/codingchili/core/security/TokenFactory.java +++ b/core/main/java/com/codingchili/core/security/TokenFactory.java @@ -60,7 +60,8 @@ public boolean verify(Token token) { .send(String.format("Token algorithm '%s' - not enabled/trusted.", algorithm)); return false; } - } else { + // only log an error if the token is secured and type is missing. + } else if (token.getKey() != null) { logger.event("token.verify", Level.WARNING) .send(String.format("Token is missing property '%s' - unable to verify.", CRYPTO_TYPE)); }