diff --git a/vertx-auth-common/src/main/generated/io/vertx/ext/auth/JWTOptionsConverter.java b/vertx-auth-common/src/main/generated/io/vertx/ext/auth/JWTOptionsConverter.java index 27f90db60..617401529 100644 --- a/vertx-auth-common/src/main/generated/io/vertx/ext/auth/JWTOptionsConverter.java +++ b/vertx-auth-common/src/main/generated/io/vertx/ext/auth/JWTOptionsConverter.java @@ -49,7 +49,7 @@ public static void fromJson(Iterable> json, break; case "expiresInSeconds": if (member.getValue() instanceof Number) { - obj.setExpires(((Number)member.getValue()).intValue()); + obj.setExpiresInSeconds(((Number)member.getValue()).intValue()); } break; case "header": @@ -114,7 +114,7 @@ public static void toJson(JWTOptions obj, java.util.Map json) { obj.getAudience().forEach(item -> array.add(item)); json.put("audience", array); } - json.put("expiresInSeconds", obj.getExpires()); + json.put("expiresInSeconds", obj.getExpiresInSeconds()); if (obj.getHeader() != null) { json.put("header", obj.getHeader()); } diff --git a/vertx-auth-common/src/main/java/io/vertx/ext/auth/JWTOptions.java b/vertx-auth-common/src/main/java/io/vertx/ext/auth/JWTOptions.java index 2b7b06ee2..92371e60d 100644 --- a/vertx-auth-common/src/main/java/io/vertx/ext/auth/JWTOptions.java +++ b/vertx-auth-common/src/main/java/io/vertx/ext/auth/JWTOptions.java @@ -96,11 +96,11 @@ public JWTOptions setNoTimestamp(boolean noTimestamp) { return this; } - public int getExpires() { + public int getExpiresInSeconds() { return expires; } - public JWTOptions setExpires(int expires) { + public JWTOptions setExpiresInSeconds(int expires) { this.expires = expires; return this; } diff --git a/vertx-auth-common/src/main/java/io/vertx/ext/auth/impl/jose/JWT.java b/vertx-auth-common/src/main/java/io/vertx/ext/auth/impl/jose/JWT.java index b0f5eebce..b6de32700 100644 --- a/vertx-auth-common/src/main/java/io/vertx/ext/auth/impl/jose/JWT.java +++ b/vertx-auth-common/src/main/java/io/vertx/ext/auth/impl/jose/JWT.java @@ -363,8 +363,8 @@ public String sign(JsonObject payload, JWTOptions options) { payload.put("iat", payload.getValue("iat", timestamp)); } - if (options.getExpires() > 0) { - payload.put("exp", timestamp + options.getExpires()); + if (options.getExpiresInSeconds() > 0) { + payload.put("exp", timestamp + options.getExpiresInSeconds()); } if (options.getAudience() != null && options.getAudience().size() >= 1) { diff --git a/vertx-auth-jwt/src/test/java/io/vertx/ext/auth/test/jwt/JWTAuthProviderTest.java b/vertx-auth-jwt/src/test/java/io/vertx/ext/auth/test/jwt/JWTAuthProviderTest.java index e859039e9..03c44f0fb 100644 --- a/vertx-auth-jwt/src/test/java/io/vertx/ext/auth/test/jwt/JWTAuthProviderTest.java +++ b/vertx-auth-jwt/src/test/java/io/vertx/ext/auth/test/jwt/JWTAuthProviderTest.java @@ -232,7 +232,7 @@ public void testExpiration(TestContext should) { .put("sub", "Paulo"); final String token = authProvider.generateToken(payload, - new JWTOptions().setExpires(1).setNoTimestamp(true)); + new JWTOptions().setExpiresInSeconds(1).setNoTimestamp(true)); should.assertNotNull(token); @@ -628,7 +628,7 @@ public void testValidateTokenWithIgnoreExpired(TestContext should) throws Interr .generateToken( new JsonObject(), new JWTOptions() - .setExpires(1) + .setExpiresInSeconds(1) .setSubject("subject") .setAlgorithm("HS256")); diff --git a/vertx-auth-oauth2/src/main/generated/io/vertx/ext/auth/oauth2/OAuth2OptionsConverter.java b/vertx-auth-oauth2/src/main/generated/io/vertx/ext/auth/oauth2/OAuth2OptionsConverter.java index e4f8ee05c..8f657f679 100644 --- a/vertx-auth-oauth2/src/main/generated/io/vertx/ext/auth/oauth2/OAuth2OptionsConverter.java +++ b/vertx-auth-oauth2/src/main/generated/io/vertx/ext/auth/oauth2/OAuth2OptionsConverter.java @@ -75,9 +75,9 @@ public static void fromJson(Iterable> json, obj.setIntrospectionPath((String)member.getValue()); } break; - case "jwkMaxAge": + case "jwkMaxAgeInSeconds": if (member.getValue() instanceof Number) { - obj.setJwkMaxAge(((Number)member.getValue()).longValue()); + obj.setJwkMaxAgeInSeconds(((Number)member.getValue()).longValue()); } break; case "jwkPath": @@ -207,7 +207,7 @@ public static void toJson(OAuth2Options obj, java.util.Map json) if (obj.getIntrospectionPath() != null) { json.put("introspectionPath", obj.getIntrospectionPath()); } - json.put("jwkMaxAge", obj.getJwkMaxAge()); + json.put("jwkMaxAgeInSeconds", obj.getJwkMaxAgeInSeconds()); if (obj.getJwkPath() != null) { json.put("jwkPath", obj.getJwkPath()); } diff --git a/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/OAuth2Options.java b/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/OAuth2Options.java index d51be2ec1..c6c12593b 100644 --- a/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/OAuth2Options.java +++ b/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/OAuth2Options.java @@ -146,7 +146,7 @@ public OAuth2Options(OAuth2Options other) { headers = null; } jwkPath = other.getJwkPath(); - jwkMaxAge = other.getJwkMaxAge(); + jwkMaxAge = other.getJwkMaxAgeInSeconds(); httpClientOptions = other.getHttpClientOptions(); userAgent = other.getUserAgent(); supportedGrantTypes = other.getSupportedGrantTypes(); @@ -565,7 +565,7 @@ public boolean isRotateJWKs() { * * @param rotateJWKs {@code true} to rotate keys as described in {@link OAuth2Auth#jWKSet(Handler)}. * @return self - * @deprecated use {@link #setJwkMaxAge(long)} instead + * @deprecated use {@link #setJwkMaxAgeInSeconds(long)} instead */ @Deprecated public OAuth2Options setRotateJWKs(boolean rotateJWKs) { @@ -703,16 +703,16 @@ public OAuth2Options setHttpClientOptions(HttpClientOptions httpClientOptions) { return this; } - public long getJwkMaxAge() { + public long getJwkMaxAgeInSeconds() { return jwkMaxAge; } /** * -1 means no rotation for JWKs * - * @param jwkMaxAge timeout of JWKs rotation + * @param jwkMaxAgeInSeconds timeout of JWKs rotation */ - public void setJwkMaxAge(long jwkMaxAge) { - this.jwkMaxAge = jwkMaxAge; + public void setJwkMaxAgeInSeconds(long jwkMaxAgeInSeconds) { + this.jwkMaxAge = jwkMaxAgeInSeconds; } } diff --git a/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/OAuth2AuthProviderImpl.java b/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/OAuth2AuthProviderImpl.java index 6a294e269..1c7c52308 100644 --- a/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/OAuth2AuthProviderImpl.java +++ b/vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/OAuth2AuthProviderImpl.java @@ -137,7 +137,7 @@ public Future jWKSet() { // ensure that leeway is never negative int leeway = max(0, config.getJWTOptions().getLeeway()); // delay is in ms, while cache max age is sec - final long delay = json.getLong("maxAge", config.getJwkMaxAge()) * 1000 - leeway; + final long delay = json.getLong("maxAge", config.getJwkMaxAgeInSeconds()) * 1000 - leeway; // salesforce (for example) sometimes disables the max-age as setting it to 0 // for these cases we just cancel if (delay > 0) { diff --git a/vertx-auth-webauthn/src/main/java/io/vertx/ext/auth/webauthn/WebAuthnOptions.java b/vertx-auth-webauthn/src/main/java/io/vertx/ext/auth/webauthn/WebAuthnOptions.java index eb10f7473..c81f5fa5a 100644 --- a/vertx-auth-webauthn/src/main/java/io/vertx/ext/auth/webauthn/WebAuthnOptions.java +++ b/vertx-auth-webauthn/src/main/java/io/vertx/ext/auth/webauthn/WebAuthnOptions.java @@ -191,7 +191,7 @@ public class WebAuthnOptions { private boolean requireResidentKey; private UserVerification userVerification; - private Long timeoutInMilliseconds; + private Long timeout; private Attestation attestation; // Needs to be a list, order is important @@ -220,7 +220,7 @@ private void init() { extensions = new JsonObject() .put("txAuthSimple", ""); - timeoutInMilliseconds = 60_000L; + timeout = 60_000L; challengeLength = 64; // Support FIDO2 devices, MACOSX, default addPubKeyCredParam(ES256); @@ -361,9 +361,8 @@ public WebAuthnOptions setUserVerification(UserVerification userVerification) { return this; } - //ms public Long getTimeoutInMilliseconds() { - return timeoutInMilliseconds; + return timeout; } public WebAuthnOptions setTimeoutInMilliseconds(Long timeoutInMilliseconds) { @@ -372,7 +371,7 @@ public WebAuthnOptions setTimeoutInMilliseconds(Long timeoutInMilliseconds) { throw new IllegalArgumentException("Timeout must be >= 0"); } } - this.timeoutInMilliseconds = timeoutInMilliseconds; + this.timeout = timeoutInMilliseconds; return this; }