Skip to content

Commit e95b7f6

Browse files
committed
Release 1.12.4
Deprecated features: - Option `RelyingParty.allowUnrequestedExtensions` deprecated. The `false` setting (default) is not compatible with WebAuthn Level 2 since authenticators are now always allowed to add unsolicited extensions. The next major version release will remove this option and always behave as if the option had been set to `true`. - Enum value `AttestationType.ECDAA`. ECDAA was removed in WebAuthn Level 2. - Function `TokenBindingStatus.fromJsonString(String)` deprecated. It should not have been part of the public API to begin with.
2 parents 8eb6278 + 3a53f33 commit e95b7f6

20 files changed

+124
-91
lines changed

.github/workflows/scan.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

NEWS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
== Version 1.12.4 ==
2+
3+
Deprecated features:
4+
5+
* Option `RelyingParty.allowUnrequestedExtensions` deprecated. The `false`
6+
setting (default) is not compatible with WebAuthn Level 2 since authenticators
7+
are now always allowed to add unsolicited extensions. The next major version
8+
release will remove this option and always behave as if the option had been
9+
set to `true`.
10+
* Enum value `AttestationType.ECDAA`. ECDAA was removed in WebAuthn Level 2.
11+
* Function `TokenBindingStatus.fromJsonString(String)` deprecated. It should not
12+
have been part of the public API to begin with.
13+
14+
115
== Version 1.12.3 ==
216

317
Fixes:

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Maven:
2525
<dependency>
2626
<groupId>com.yubico</groupId>
2727
<artifactId>webauthn-server-core</artifactId>
28-
<version>1.12.3</version>
28+
<version>1.12.4</version>
2929
<scope>compile</scope>
3030
</dependency>
3131
----------
3232

3333
Gradle:
3434

3535
----------
36-
compile 'com.yubico:webauthn-server-core:1.12.3'
36+
compile 'com.yubico:webauthn-server-core:1.12.4'
3737
----------
3838

3939
=== Semantic versioning

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
dependencies {
66
classpath 'com.cinnober.gradle:semver-git:2.5.0'
77
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
8-
classpath 'io.github.cosmicsilence:gradle-scalafix:0.1.8'
8+
classpath 'io.github.cosmicsilence:gradle-scalafix:0.1.13'
99
}
1010
}
1111
plugins {
@@ -148,6 +148,12 @@ subprojects { project ->
148148
if (project.plugins.hasPlugin('scala')) {
149149
project.scalafix {
150150
configFile = rootProject.file('scalafix.conf')
151+
152+
// Work around dependency resolution issues in April 2022
153+
semanticdb {
154+
autoConfigure = true
155+
version = '4.5.5'
156+
}
151157
}
152158
dependencies.scalafix('com.github.liancheng:organize-imports_2.13:0.6.0')
153159
project.tasks.spotlessApply.dependsOn(project.tasks.scalafix)

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,13 @@ public class RelyingParty {
319319
*
320320
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-extensions">§9. WebAuthn
321321
* Extensions</a>
322+
* @deprecated The <code>false</code> setting (default) is not compatible with WebAuthn Level 2
323+
* since authenticators are now always allowed to add unsolicited extensions. The next major
324+
* version release will remove this option and always behave as if the option had been set to
325+
* <code>
326+
* true</code>.
322327
*/
323-
@Builder.Default private final boolean allowUnrequestedExtensions = false;
328+
@Deprecated @Builder.Default private final boolean allowUnrequestedExtensions = false;
324329

325330
/**
326331
* If <code>false</code>, {@link #finishRegistration(FinishRegistrationOptions)

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AttestationConveyancePreference.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.stream.Stream;
3333
import lombok.AccessLevel;
3434
import lombok.AllArgsConstructor;
35+
import lombok.Getter;
3536
import lombok.NonNull;
3637

3738
/**
@@ -77,25 +78,27 @@ public enum AttestationConveyancePreference implements JsonStringSerializable {
7778
*/
7879
DIRECT("direct");
7980

80-
@NonNull private final String id;
81+
@Getter @NonNull private final String value;
8182

82-
private static Optional<AttestationConveyancePreference> fromString(@NonNull String id) {
83-
return Stream.of(values()).filter(v -> v.id.equals(id)).findAny();
83+
private static Optional<AttestationConveyancePreference> fromString(@NonNull String value) {
84+
return Stream.of(values()).filter(v -> v.value.equals(value)).findAny();
8485
}
8586

8687
@JsonCreator
87-
private static AttestationConveyancePreference fromJsonString(@NonNull String id) {
88-
return fromString(id)
88+
private static AttestationConveyancePreference fromJsonString(@NonNull String value) {
89+
return fromString(value)
8990
.orElseThrow(
9091
() ->
9192
new IllegalArgumentException(
9293
String.format(
9394
"Unknown %s value: %s",
94-
AttestationConveyancePreference.class.getSimpleName(), id)));
95+
AttestationConveyancePreference.class.getSimpleName(), value)));
9596
}
9697

9798
@Override
99+
@Deprecated
100+
/** @deprecated Use {@link #getValue()} instead. */
98101
public String toJsonString() {
99-
return id;
102+
return value;
100103
}
101104
}

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AttestationType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public enum AttestationType {
114114
* @see <a href=
115115
* "https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-ecdaa-algorithm-v2.0-id-20180227.html">FIDO
116116
* ECDAA Algorithm</a>
117+
* @deprecated ECDAA was removed in WebAuthn Level 2.
117118
*/
119+
@Deprecated
118120
ECDAA,
119121

120122
/**

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AuthenticatorAttachment.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Optional;
3232
import java.util.stream.Stream;
3333
import lombok.AllArgsConstructor;
34+
import lombok.Getter;
3435
import lombok.NonNull;
3536

3637
/**
@@ -73,25 +74,27 @@ public enum AuthenticatorAttachment implements JsonStringSerializable {
7374
*/
7475
PLATFORM("platform");
7576

76-
@NonNull private final String id;
77+
@Getter @NonNull private final String value;
7778

78-
private static Optional<AuthenticatorAttachment> fromString(@NonNull String id) {
79-
return Stream.of(values()).filter(v -> v.id.equals(id)).findAny();
79+
private static Optional<AuthenticatorAttachment> fromString(@NonNull String value) {
80+
return Stream.of(values()).filter(v -> v.value.equals(value)).findAny();
8081
}
8182

8283
@JsonCreator
83-
private static AuthenticatorAttachment fromJsonString(@NonNull String id) {
84-
return fromString(id)
84+
private static AuthenticatorAttachment fromJsonString(@NonNull String value) {
85+
return fromString(value)
8586
.orElseThrow(
8687
() ->
8788
new IllegalArgumentException(
8889
String.format(
8990
"Unknown %s value: %s",
90-
AuthenticatorAttachment.class.getSimpleName(), id)));
91+
AuthenticatorAttachment.class.getSimpleName(), value)));
9192
}
9293

9394
@Override
95+
@Deprecated
96+
/** @deprecated Use {@link #getValue()} instead. */
9497
public String toJsonString() {
95-
return id;
98+
return value;
9699
}
97100
}

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AuthenticatorTransport.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ public static AuthenticatorTransport fromU2fTransport(Transport transport) {
152152
}
153153

154154
@Override
155+
@Deprecated
156+
/** @deprecated Use {@link #getId()} instead. */
155157
public String toJsonString() {
156158
return id;
157159
}

webauthn-server-core/src/main/java/com/yubico/webauthn/data/ByteArray.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ public final class ByteArray implements Comparable<ByteArray>, JsonStringSeriali
5151

5252
@NonNull private final byte[] bytes;
5353

54-
@NonNull private final String base64;
54+
@NonNull private final String base64url;
5555

5656
/** Create a new instance by copying the contents of <code>bytes</code>. */
5757
public ByteArray(@NonNull byte[] bytes) {
5858
this.bytes = BinaryUtil.copy(bytes);
59-
this.base64 = BASE64URL_ENCODER.encodeToString(this.bytes);
59+
this.base64url = BASE64URL_ENCODER.encodeToString(this.bytes);
6060
}
6161

62-
private ByteArray(String base64) throws Base64UrlException {
62+
private ByteArray(String base64url) throws Base64UrlException {
6363
try {
64-
this.bytes = BASE64URL_DECODER.decode(base64);
64+
this.bytes = BASE64URL_DECODER.decode(base64url);
6565
} catch (IllegalArgumentException e) {
66-
throw new Base64UrlException("Invalid Base64Url encoding: " + base64, e);
66+
throw new Base64UrlException("Invalid Base64Url encoding: " + base64url, e);
6767
}
68-
this.base64 = base64;
68+
this.base64url = base64url;
6969
}
7070

7171
/** Create a new instance by decoding <code>base64</code> as classic Base64 data. */
@@ -74,13 +74,13 @@ public static ByteArray fromBase64(@NonNull final String base64) {
7474
}
7575

7676
/**
77-
* Create a new instance by decoding <code>base64</code> as Base64Url data.
77+
* Create a new instance by decoding <code>base64url</code> as Base64Url data.
7878
*
79-
* @throws Base64UrlException if <code>base64</code> is not valid Base64Url data.
79+
* @throws Base64UrlException if <code>base64url</code> is not valid Base64Url data.
8080
*/
8181
@JsonCreator
82-
public static ByteArray fromBase64Url(@NonNull final String base64) throws Base64UrlException {
83-
return new ByteArray(base64);
82+
public static ByteArray fromBase64Url(@NonNull final String base64url) throws Base64UrlException {
83+
return new ByteArray(base64url.split("=")[0]);
8484
}
8585

8686
/**
@@ -122,9 +122,9 @@ public String getBase64() {
122122
return BASE64_ENCODER.encodeToString(bytes);
123123
}
124124

125-
/** @return the content bytes encoded as Base64Url data. */
125+
/** @return the content bytes encoded as Base64Url data, without padding. */
126126
public String getBase64Url() {
127-
return base64;
127+
return base64url;
128128
}
129129

130130
/** @return the content bytes encoded as hexadecimal data. */
@@ -133,10 +133,11 @@ public String getHex() {
133133
return BinaryUtil.toHex(bytes);
134134
}
135135

136-
/** Used by JSON serializer. */
137136
@Override
137+
@Deprecated
138+
/** @deprecated Use {@link #getBase64Url()} instead. */
138139
public String toJsonString() {
139-
return base64;
140+
return base64url;
140141
}
141142

142143
@Override

0 commit comments

Comments
 (0)