Reduce logging of ApiTokenRealm

This commit is contained in:
Sebastian Sdorra
2020-10-22 14:39:09 +02:00
parent 49607236e5
commit 7b91cf82bf
4 changed files with 19 additions and 7 deletions

View File

@@ -28,7 +28,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.jsonwebtoken.io.Decoder;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.io.DecodingException;
import io.jsonwebtoken.io.Encoder;
import io.jsonwebtoken.io.Encoders;
import lombok.AllArgsConstructor;
@@ -62,8 +61,8 @@ class ApiKeyTokenHandler {
Optional<Token> readToken(String token) {
try {
return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class));
} catch (IOException | DecodingException e) {
LOG.warn("error reading api token", e);
} catch (IOException e) {
LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password", e);
return empty();
}
}