Skip to content

Commit b20d5d5

Browse files
committed
Polish JavaDoc for new toCredentials*Json() methods
1 parent 66f50a6 commit b20d5d5

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.fasterxml.jackson.annotation.JsonCreator;
2828
import com.fasterxml.jackson.annotation.JsonProperty;
2929
import com.fasterxml.jackson.core.JsonProcessingException;
30+
import com.yubico.webauthn.data.ByteArray;
3031
import com.yubico.webauthn.data.PublicKeyCredentialRequestOptions;
3132
import java.util.Optional;
3233
import lombok.Builder;
@@ -79,14 +80,19 @@ public Optional<String> getUsername() {
7980
}
8081

8182
/**
82-
* Serialize this {@link AssertionRequest} value to JSON suitable for sending to the client and
83-
* passing as an argument to <code>navigator.credentials.get()</code>, after decoding binary
84-
* options from Base64Url strings.
83+
* Serialize this {@link AssertionRequest} value to JSON suitable for sending to the client.
8584
*
8685
* <p>This is an alias of <code>getPublicKeyCredentialRequestOptions().toCredentialsGetJson()
8786
* </code>.
8887
*
89-
* @see PublicKeyCredentialRequestOptions#toCredentialsGetJson()
88+
* <p>Any {@link ByteArray} values in this data structure will be {@link ByteArray#getBase64Url()
89+
* Base64Url} encoded. Those values MUST be decoded into <code>BufferSource</code> values (such as
90+
* <code>Uint8Array</code>) on the client side before calling <code>navigator.credentials.get()
91+
* </code>.
92+
*
93+
* <p>After decoding binary values, the resulting JavaScript object is suitable for passing as an
94+
* argument to <code>navigator.credentials.get()</code>.
95+
*
9096
* @return a JSON value suitable for sending to the client and passing as an argument to <code>
9197
* navigator.credentials.get()</code>, after decoding binary options from Base64Url strings.
9298
* @throws JsonProcessingException if JSON serialization fails.

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,15 @@ private PublicKeyCredentialCreationOptions(
147147

148148
/**
149149
* Serialize this {@link PublicKeyCredentialCreationOptions} value to JSON suitable for sending to
150-
* the client and passing as an argument to <code>navigator.credentials.create()</code>, after
151-
* decoding binary options from Base64Url strings.
150+
* the client.
151+
*
152+
* <p>Any {@link ByteArray} values in this data structure will be {@link ByteArray#getBase64Url()
153+
* Base64Url} encoded. Those values MUST be decoded into <code>BufferSource</code> values (such as
154+
* <code>Uint8Array</code>) on the client side before calling <code>navigator.credentials.create()
155+
* </code>.
156+
*
157+
* <p>After decoding binary values, the resulting JavaScript object is suitable for passing as an
158+
* argument to <code>navigator.credentials.create()</code>.
152159
*
153160
* @return a JSON value suitable for sending to the client and passing as an argument to <code>
154161
* navigator.credentials.create()</code>, after decoding binary options from Base64Url

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,15 @@ public Optional<List<PublicKeyCredentialDescriptor>> getAllowCredentials() {
127127

128128
/**
129129
* Serialize this {@link PublicKeyCredentialRequestOptions} value to JSON suitable for sending to
130-
* the client and passing as an argument to <code>navigator.credentials.get()</code>, after
131-
* decoding binary options from Base64Url strings.
130+
* the client.
131+
*
132+
* <p>Any {@link ByteArray} values in this data structure will be {@link ByteArray#getBase64Url()
133+
* Base64Url} encoded. Those values MUST be decoded into <code>BufferSource</code> values (such as
134+
* <code>Uint8Array</code>) on the client side before calling <code>navigator.credentials.get()
135+
* </code>.
136+
*
137+
* <p>After decoding binary values, the resulting JavaScript object is suitable for passing as an
138+
* argument to <code>navigator.credentials.get()</code>.
132139
*
133140
* @return a JSON value suitable for sending to the client and passing as an argument to <code>
134141
* navigator.credentials.get()</code>, after decoding binary options from Base64Url strings.

0 commit comments

Comments
 (0)