Skip to content

Commit

Permalink
Update Web Authentication API to level 3
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jun 26, 2024
1 parent 71bd366 commit 5d9e7ee
Show file tree
Hide file tree
Showing 222 changed files with 3,244 additions and 49 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
* Use `table.fill` when appropriate.
[#3446](https://github.com/rustwasm/wasm-bindgen/pull/3446)

* Update Web Authentication API to level 3.
[#4000](https://github.com/rustwasm/wasm-bindgen/pull/4000)

### Fixed

* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.
Expand Down
23 changes: 23 additions & 0 deletions crates/web-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,22 @@ AudioWorkletNode = ["AudioNode", "EventTarget"]
AudioWorkletNodeOptions = []
AudioWorkletProcessor = []
AuthenticationExtensionsClientInputs = []
AuthenticationExtensionsClientInputsJson = []
AuthenticationExtensionsClientOutputs = []
AuthenticationExtensionsClientOutputsJson = []
AuthenticationExtensionsDevicePublicKeyInputs = []
AuthenticationExtensionsDevicePublicKeyOutputs = []
AuthenticationExtensionsLargeBlobInputs = []
AuthenticationExtensionsLargeBlobOutputs = []
AuthenticationExtensionsPrfInputs = []
AuthenticationExtensionsPrfOutputs = []
AuthenticationExtensionsPrfValues = []
AuthenticationResponseJson = []
AuthenticatorAssertionResponse = ["AuthenticatorResponse"]
AuthenticatorAssertionResponseJson = []
AuthenticatorAttachment = []
AuthenticatorAttestationResponse = ["AuthenticatorResponse"]
AuthenticatorAttestationResponseJson = []
AuthenticatorResponse = []
AuthenticatorSelectionCriteria = []
AuthenticatorTransport = []
Expand Down Expand Up @@ -234,6 +246,7 @@ Coordinates = []
CountQueuingStrategy = []
Credential = []
CredentialCreationOptions = []
CredentialPropertiesOutput = []
CredentialRequestOptions = []
CredentialsContainer = []
Crypto = []
Expand Down Expand Up @@ -753,6 +766,7 @@ KeyframeEffect = ["AnimationEffect"]
KeyframeEffectOptions = []
L10nElement = []
L10nValue = []
LargeBlobSupport = []
LatencyMode = []
LifecycleCallbacks = []
LineAlignSetting = []
Expand Down Expand Up @@ -1004,13 +1018,18 @@ PromiseRejectionEvent = ["Event"]
PromiseRejectionEventInit = []
PublicKeyCredential = ["Credential"]
PublicKeyCredentialCreationOptions = []
PublicKeyCredentialCreationOptionsJson = []
PublicKeyCredentialDescriptor = []
PublicKeyCredentialDescriptorJson = []
PublicKeyCredentialEntity = []
PublicKeyCredentialHints = []
PublicKeyCredentialParameters = []
PublicKeyCredentialRequestOptions = []
PublicKeyCredentialRequestOptionsJson = []
PublicKeyCredentialRpEntity = []
PublicKeyCredentialType = []
PublicKeyCredentialUserEntity = []
PublicKeyCredentialUserEntityJson = []
PushEncryptionKeyName = []
PushEvent = ["Event", "ExtendableEvent"]
PushEventInit = []
Expand Down Expand Up @@ -1048,6 +1067,7 @@ RegisterRequest = []
RegisterResponse = []
RegisteredKey = []
RegistrationOptions = []
RegistrationResponseJson = []
Request = []
RequestCache = []
RequestCredentials = []
Expand All @@ -1057,6 +1077,7 @@ RequestInit = []
RequestMediaKeySystemAccessNotification = []
RequestMode = []
RequestRedirect = []
ResidentKeyRequirement = []
ResizeObserver = []
ResizeObserverBoxOptions = []
ResizeObserverEntry = []
Expand Down Expand Up @@ -1392,6 +1413,8 @@ TextTrackList = ["EventTarget"]
TextTrackMode = []
TimeEvent = ["Event"]
TimeRanges = []
TokenBinding = []
TokenBindingStatus = []
Touch = []
TouchEvent = ["Event", "UiEvent"]
TouchEventInit = []
Expand Down
3 changes: 3 additions & 0 deletions crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AllowedBluetoothDevice;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "allowedServices")]
fn allowed_services_shim(this: &AllowedBluetoothDevice, val: &::wasm_bindgen::JsValue);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "deviceId")]
fn device_id_shim(this: &AllowedBluetoothDevice, val: &str);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "mayUseGATT")]
fn may_use_gatt_shim(this: &AllowedBluetoothDevice, val: bool);
}
Expand Down
3 changes: 3 additions & 0 deletions crates/web-sys/src/features/gen_AllowedUsbDevice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AllowedUsbDevice;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "productId")]
fn product_id_shim(this: &AllowedUsbDevice, val: u8);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "serialNumber")]
fn serial_number_shim(this: &AllowedUsbDevice, val: &str);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "vendorId")]
fn vendor_id_shim(this: &AllowedUsbDevice, val: u8);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ pub enum AttestationConveyancePreference {
None = "none",
Indirect = "indirect",
Direct = "direct",
Enterprise = "enterprise",
}
1 change: 1 addition & 0 deletions crates/web-sys/src/features/gen_AudioContextOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ extern "C" {
fn latency_hint_shim(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue);
#[wasm_bindgen(method, setter = "sampleRate")]
fn sample_rate_shim(this: &AudioContextOptions, val: f32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "sinkId")]
fn sink_id_shim(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue);
}
Expand Down
4 changes: 4 additions & 0 deletions crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioDataCopyToOptions;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSampleFormat")]
#[wasm_bindgen(method, setter = "format")]
fn format_shim(this: &AudioDataCopyToOptions, val: AudioSampleFormat);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "frameCount")]
fn frame_count_shim(this: &AudioDataCopyToOptions, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "frameOffset")]
fn frame_offset_shim(this: &AudioDataCopyToOptions, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "planeIndex")]
fn plane_index_shim(this: &AudioDataCopyToOptions, val: u32);
}
Expand Down
6 changes: 6 additions & 0 deletions crates/web-sys/src/features/gen_AudioDataInit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioDataInit;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "data")]
fn data_shim(this: &AudioDataInit, val: &::js_sys::Object);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSampleFormat")]
#[wasm_bindgen(method, setter = "format")]
fn format_shim(this: &AudioDataInit, val: AudioSampleFormat);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "numberOfChannels")]
fn number_of_channels_shim(this: &AudioDataInit, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "numberOfFrames")]
fn number_of_frames_shim(this: &AudioDataInit, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "sampleRate")]
fn sample_rate_shim(this: &AudioDataInit, val: f32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "timestamp")]
fn timestamp_shim(this: &AudioDataInit, val: f64);
}
Expand Down
4 changes: 4 additions & 0 deletions crates/web-sys/src/features/gen_AudioDecoderConfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioDecoderConfig;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "codec")]
fn codec_shim(this: &AudioDecoderConfig, val: &str);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "description")]
fn description_shim(this: &AudioDecoderConfig, val: &::js_sys::Object);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "numberOfChannels")]
fn number_of_channels_shim(this: &AudioDecoderConfig, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "sampleRate")]
fn sample_rate_shim(this: &AudioDecoderConfig, val: u32);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/web-sys/src/features/gen_AudioDecoderInit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioDecoderInit;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "error")]
fn error_shim(this: &AudioDecoderInit, val: &::js_sys::Function);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "output")]
fn output_shim(this: &AudioDecoderInit, val: &::js_sys::Function);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/web-sys/src/features/gen_AudioDecoderSupport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioDecoderSupport;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioDecoderConfig")]
#[wasm_bindgen(method, setter = "config")]
fn config_shim(this: &AudioDecoderSupport, val: &AudioDecoderConfig);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "supported")]
fn supported_shim(this: &AudioDecoderSupport, val: bool);
}
Expand Down
4 changes: 4 additions & 0 deletions crates/web-sys/src/features/gen_AudioEncoderConfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioEncoderConfig;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "bitrate")]
fn bitrate_shim(this: &AudioEncoderConfig, val: f64);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "codec")]
fn codec_shim(this: &AudioEncoderConfig, val: &str);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "numberOfChannels")]
fn number_of_channels_shim(this: &AudioEncoderConfig, val: u32);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "sampleRate")]
fn sample_rate_shim(this: &AudioEncoderConfig, val: u32);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/web-sys/src/features/gen_AudioEncoderInit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioEncoderInit;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "error")]
fn error_shim(this: &AudioEncoderInit, val: &::js_sys::Function);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "output")]
fn output_shim(this: &AudioEncoderInit, val: &::js_sys::Function);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/web-sys/src/features/gen_AudioEncoderSupport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioEncoderSupport;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioEncoderConfig")]
#[wasm_bindgen(method, setter = "config")]
fn config_shim(this: &AudioEncoderSupport, val: &AudioEncoderConfig);
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(method, setter = "supported")]
fn supported_shim(this: &AudioEncoderSupport, val: bool);
}
Expand Down
1 change: 1 addition & 0 deletions crates/web-sys/src/features/gen_AudioSinkOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ extern "C" {
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioSinkOptions;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AudioSinkType")]
#[wasm_bindgen(method, setter = "type")]
fn type__shim(this: &AudioSinkOptions, val: AudioSinkType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ extern "C" {
pub type AuthenticationExtensionsClientInputs;
#[wasm_bindgen(method, setter = "appid")]
fn appid_shim(this: &AuthenticationExtensionsClientInputs, val: &str);
#[wasm_bindgen(method, setter = "appidExclude")]
fn appid_exclude_shim(this: &AuthenticationExtensionsClientInputs, val: &str);
#[wasm_bindgen(method, setter = "credProps")]
fn cred_props_shim(this: &AuthenticationExtensionsClientInputs, val: bool);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")]
#[wasm_bindgen(method, setter = "devicePubKey")]
fn device_pub_key_shim(
this: &AuthenticationExtensionsClientInputs,
val: &AuthenticationExtensionsDevicePublicKeyInputs,
);
#[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")]
#[wasm_bindgen(method, setter = "largeBlob")]
fn large_blob_shim(
this: &AuthenticationExtensionsClientInputs,
val: &AuthenticationExtensionsLargeBlobInputs,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AuthenticationExtensionsPrfInputs")]
#[wasm_bindgen(method, setter = "prf")]
fn prf_shim(
this: &AuthenticationExtensionsClientInputs,
val: &AuthenticationExtensionsPrfInputs,
);
#[wasm_bindgen(method, setter = "uvm")]
fn uvm_shim(this: &AuthenticationExtensionsClientInputs, val: bool);
}
impl AuthenticationExtensionsClientInputs {
#[doc = "Construct a new `AuthenticationExtensionsClientInputs`."]
Expand All @@ -29,6 +55,62 @@ impl AuthenticationExtensionsClientInputs {
self.appid_shim(val);
self
}
#[doc = "Change the `appidExclude` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub fn appid_exclude(&mut self, val: &str) -> &mut Self {
self.appid_exclude_shim(val);
self
}
#[doc = "Change the `credProps` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub fn cred_props(&mut self, val: bool) -> &mut Self {
self.cred_props_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")]
#[doc = "Change the `devicePubKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsDevicePublicKeyInputs`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn device_pub_key(
&mut self,
val: &AuthenticationExtensionsDevicePublicKeyInputs,
) -> &mut Self {
self.device_pub_key_shim(val);
self
}
#[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")]
#[doc = "Change the `largeBlob` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsLargeBlobInputs`*"]
pub fn large_blob(&mut self, val: &AuthenticationExtensionsLargeBlobInputs) -> &mut Self {
self.large_blob_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "AuthenticationExtensionsPrfInputs")]
#[doc = "Change the `prf` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsPrfInputs`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn prf(&mut self, val: &AuthenticationExtensionsPrfInputs) -> &mut Self {
self.prf_shim(val);
self
}
#[doc = "Change the `uvm` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub fn uvm(&mut self, val: bool) -> &mut Self {
self.uvm_shim(val);
self
}
}
impl Default for AuthenticationExtensionsClientInputs {
fn default() -> Self {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#![allow(unused_imports)]
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsClientInputsJSON)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticationExtensionsClientInputsJson` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AuthenticationExtensionsClientInputsJson;
}
#[cfg(web_sys_unstable_apis)]
impl AuthenticationExtensionsClientInputsJson {
#[doc = "Construct a new `AuthenticationExtensionsClientInputsJson`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
}
#[cfg(web_sys_unstable_apis)]
impl Default for AuthenticationExtensionsClientInputsJson {
fn default() -> Self {
Self::new()
}
}
Loading

0 comments on commit 5d9e7ee

Please sign in to comment.