-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
It appears that since version v1.12.1, the jwk_uri property has become a mandatory requirement. As a result, AuthZpeClient can no longer be used if this property is not configured.
To the best of my knowledge, in v1.11.x, this property was not required for AuthZpeClient to function. This change in behavior introduces a backward compatibility issue.
athenz/clients/java/zpe/src/main/java/com/yahoo/athenz/zpe/AuthZpeClient.java
Lines 202 to 205 in 346e225
| String serverUrl = System.getProperty(ZpeConsts.ZPE_PROP_JWK_URI); | |
| if (serverUrl == null || serverUrl.isEmpty()) { | |
| throw new IllegalArgumentException("Missing required property: " + ZpeConsts.ZPE_PROP_JWK_URI); | |
| } |
Would it be possible to consider modifying the logic? For instance, with a change like the following:
public static void initializeAccessTokenSignKeyResolver() {
final String keyPath = System.getProperty(ZpeConsts.ZPE_PROP_JWK_PRIVATE_KEY_PATH);
final String certPath = System.getProperty(ZpeConsts.ZPE_PROP_JWK_X509_CERT_PATH);
SSLContext sslContext = null;
if (keyPath != null && !keyPath.isEmpty() && certPath != null && !certPath.isEmpty()) {
try {
KeyRefresher keyRefresher = Utils.generateKeyRefresher(null, certPath, keyPath);
keyRefresher.startup();
sslContext = Utils.buildSSLContext(keyRefresher.getKeyManagerProxy(),
keyRefresher.getTrustManagerProxy());
} catch (Exception ex) {
LOG.error("Unable to initialize key refresher: {}", ex.getMessage());
}
}
//
// setAccessTokenSignKeyResolver should only be executed when jwk_uri is configured.
//
String serverUrl = System.getProperty(ZpeConsts.ZPE_PROP_JWK_URI);
if (serverUrl != null && !serverUrl.isEmpty()) {
setAccessTokenSignKeyResolver(serverUrl, sslContext);
setMillisBetweenZtsCalls(Long.parseLong(System.getProperty(ZPE_PROP_MILLIS_BETWEEN_ZTS_CALLS, Long.toString(30 * 1000 * 60))));
}
}Metadata
Metadata
Assignees
Labels
No labels