diff --git a/jwt-opa/src/main/java/com/alertavert/opa/Constants.java b/jwt-opa/src/main/java/com/alertavert/opa/Constants.java index e74452e..68aad04 100644 --- a/jwt-opa/src/main/java/com/alertavert/opa/Constants.java +++ b/jwt-opa/src/main/java/com/alertavert/opa/Constants.java @@ -83,6 +83,8 @@ public class Constants { + "({}) not an instance of ApiTokenAuthentication, cannot progress authorization"; public static final String CANNOT_PARSE_AUTHORIZATION_REQUEST = "Cannot parse Authorization " + "request: {}"; + public static final String ERROR_CANNOT_READ_KEY = "Could not read key: path = {}, algorithm = {}"; + public static final String API_TOKEN = "api_token"; /** diff --git a/jwt-opa/src/main/java/com/alertavert/opa/security/crypto/KeypairFileReader.java b/jwt-opa/src/main/java/com/alertavert/opa/security/crypto/KeypairFileReader.java index ad75c55..a6db527 100644 --- a/jwt-opa/src/main/java/com/alertavert/opa/security/crypto/KeypairFileReader.java +++ b/jwt-opa/src/main/java/com/alertavert/opa/security/crypto/KeypairFileReader.java @@ -29,6 +29,8 @@ import java.security.PrivateKey; import java.security.PublicKey; +import static com.alertavert.opa.Constants.ERROR_CANNOT_READ_KEY; + /** *

KeypairFileReader

* @@ -49,15 +51,10 @@ */ @Slf4j @Value public class KeypairFileReader implements KeypairReader { - - public static final String ERROR_CANNOT_READ_KEY = - "Could not read key: path = {}, algorithm = {}"; - String algorithm; Path secretKeyPath; Path publicKeyPath; - @Override public KeyPair loadKeys() throws KeyLoadException { return new KeyPair(loadPublicKey(), loadPrivateKey());