Skip to content

Commit

Permalink
Moved constant to Constants class
Browse files Browse the repository at this point in the history
  • Loading branch information
massenz committed Jan 26, 2022
1 parent 646a3d5 commit f226b89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions jwt-opa/src/main/java/com/alertavert/opa/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.security.PrivateKey;
import java.security.PublicKey;

import static com.alertavert.opa.Constants.ERROR_CANNOT_READ_KEY;

/**
* <H2>KeypairFileReader</H2>
*
Expand All @@ -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());
Expand Down

0 comments on commit f226b89

Please sign in to comment.