From 39872646eba1160958b6edd042be905b7cf4dd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 4 Jul 2023 15:28:50 +0200 Subject: feat: stabilize 'alpnProtocols' setting (#19704) Ref https://github.com/denoland/deno/issues/19685 --- cli/tests/integration/lsp_tests.rs | 2 +- cli/tsc/dts/lib.deno.unstable.d.ts | 35 ----------------------------------- ext/net/lib.deno_net.d.ts | 16 ++++++++++++++++ ext/net/ops_tls.rs | 2 -- 4 files changed, 17 insertions(+), 38 deletions(-) diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 5164975cf..467fa85a5 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -4788,7 +4788,7 @@ fn lsp_completions_auto_import() { "source": "./b.ts", "data": { "exportName": "foo", - "exportMapKey": "foo|6799|file:///a/b", + "exportMapKey": "foo|6802|file:///a/b", "moduleSpecifier": "./b.ts", "fileName": "file:///a/b.ts" }, diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 70731fc4e..1aa655646 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1132,13 +1132,6 @@ declare namespace Deno { * PEM formatted (RSA or PKCS8) private key of client certificate. */ privateKey?: string; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols supported by - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; } /** **UNSTABLE**: New API, yet to be vetted. @@ -1188,34 +1181,6 @@ declare namespace Deno { */ export function connectTls(options: ConnectTlsOptions): Promise; - /** **UNSTABLE**: New API, yet to be vetted. - * - * @category Network - */ - export interface ListenTlsOptions { - /** **UNSTABLE**: New API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols to announce to - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; - } - - /** **UNSTABLE**: New API, yet to be vetted. - * - * @category Network - */ - export interface StartTlsOptions { - /** **UNSTABLE**: New API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols to announce to - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; - } - /** **UNSTABLE**: New API, yet to be vetted. * * Acquire an advisory file-system lock for the provided file. diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts index ce0efdad2..214a5f14b 100644 --- a/ext/net/lib.deno_net.d.ts +++ b/ext/net/lib.deno_net.d.ts @@ -161,6 +161,12 @@ declare namespace Deno { keyFile?: string; transport?: "tcp"; + + /** Application-Layer Protocol Negotiation (ALPN) protocols to announce to + * the client. If not specified, no ALPN extension will be included in the + * TLS handshake. + */ + alpnProtocols?: string[]; } /** Listen announces on the local transport address over TLS (transport layer @@ -243,6 +249,11 @@ declare namespace Deno { * * Must be in PEM format. */ caCerts?: string[]; + /** Application-Layer Protocol Negotiation (ALPN) protocols supported by + * the client. If not specified, no ALPN extension will be included in the + * TLS handshake. + */ + alpnProtocols?: string[]; } /** Establishes a secure connection over TLS (transport layer security) using @@ -276,6 +287,11 @@ declare namespace Deno { * * Must be in PEM format. */ caCerts?: string[]; + /** Application-Layer Protocol Negotiation (ALPN) protocols to announce to + * the client. If not specified, no ALPN extension will be included in the + * TLS handshake. + */ + alpnProtocols?: string[]; } /** Start TLS handshake from an existing connection using an optional list of diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs index 7f451d0a8..fae4fb9b8 100644 --- a/ext/net/ops_tls.rs +++ b/ext/net/ops_tls.rs @@ -841,7 +841,6 @@ where )?; if let Some(alpn_protocols) = args.alpn_protocols { - super::check_unstable2(&state, "Deno.startTls#alpnProtocols"); tls_config.alpn_protocols = alpn_protocols.into_iter().map(|s| s.into_bytes()).collect(); } @@ -940,7 +939,6 @@ where )?; if let Some(alpn_protocols) = args.alpn_protocols { - super::check_unstable2(&state, "Deno.connectTls#alpnProtocols"); tls_config.alpn_protocols = alpn_protocols.into_iter().map(|s| s.into_bytes()).collect(); } -- cgit v1.2.3