Skip to content

Commit

Permalink
chore: update to std 0.223
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Apr 19, 2024
1 parent 70e4cbf commit 7a766dc
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 35 deletions.
74 changes: 69 additions & 5 deletions application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,84 @@ export interface ListenOptionsBase {
signal?: AbortSignal;
}

interface TlsCertifiedKeyPem {
/** The format of this key material, which must be PEM. */
keyFormat?: "pem";
/** Private key in `PEM` format. RSA, EC, and PKCS8-format keys are supported. */
key: string;
/** Certificate chain in `PEM` format. */
cert: string;
}

interface TlsCertifiedKeyFromFile {
/** Path to a file containing a PEM formatted CA certificate. Requires
* `--allow-read`.
*
* @tags allow-read
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*/
certFile: string;
/** Path to a file containing a private key file. Requires `--allow-read`.
*
* @tags allow-read
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*/
keyFile: string;
}

interface TlsCertifiedKeyConnectTls {
/**
* Certificate chain in `PEM` format.
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*/
certChain: string;
/**
* Private key in `PEM` format. RSA, EC, and PKCS8-format keys are supported.
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*/
privateKey: string;
}

type TlsCertifiedKeyOptions =
| TlsCertifiedKeyPem
| TlsCertifiedKeyFromFile
| TlsCertifiedKeyConnectTls;

/** Interface options when listening on TLS. */
export interface ListenOptionsTls extends Deno.ListenTlsOptions {
export type ListenOptionsTls = {
/** The port to listen on. */
port: number;
/** A literal IP address or host name that can be resolved to an IP address.
*
* __Note about `0.0.0.0`__ While listening `0.0.0.0` works on all platforms,
* the browsers on Windows don't work with the address `0.0.0.0`.
* You should show the message like `server running on localhost:8080` instead of
* `server running on 0.0.0.0:8080` if your program supports Windows.
*
* @default {"0.0.0.0"} */
hostname?: 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.
*
* **NOTE** this is part of the native HTTP server in Deno 1.9 or later,
* which requires the `--unstable` flag to be available.
*/
alpnProtocols?: string[];
secure: true;
/** An optional abort signal which can be used to close the listener. */
signal?: AbortSignal;
}
} & TlsCertifiedKeyOptions;

interface HandleMethod {
/** Handle an individual server request, returning the server response. This
Expand Down
26 changes: 13 additions & 13 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

// jsr dependencies

export { assert } from "jsr:@std/assert@0.222/assert";
export { concat } from "jsr:@std/bytes@0.222/concat";
export { copy as copyBytes } from "jsr:@std/bytes@0.222/copy";
export { timingSafeEqual } from "jsr:@std/crypto@0.222/timing-safe-equal";
export { KeyStack } from "jsr:@std/crypto@0.222/unstable-keystack";
export { assert } from "jsr:@std/assert@0.223/assert";
export { concat } from "jsr:@std/bytes@0.223/concat";
export { copy as copyBytes } from "jsr:@std/bytes@0.223/copy";
export { timingSafeEqual } from "jsr:@std/crypto@0.223/timing-safe-equal";
export { KeyStack } from "jsr:@std/crypto@0.223/unstable-keystack";
export {
calculate,
type ETagOptions,
type FileInfo,
ifMatch,
ifNoneMatch,
} from "jsr:@std/http@0.222/etag";
} from "jsr:@std/http@0.223/etag";
export {
accepts,
acceptsEncodings,
acceptsLanguages,
} from "jsr:@std/http@0.222/negotiation";
export { UserAgent } from "jsr:@std/http@0.222/user-agent";
export { LimitedReader } from "jsr:@std/io@0.222/limited-reader";
export { readAll } from "jsr:@std/io@0.222/read-all";
export { contentType } from "jsr:@std/media-types@0.222/content-type";
export { typeByExtension } from "jsr:@std/media-types@0.222/type-by-extension";
} from "jsr:@std/http@0.223/negotiation";
export { UserAgent } from "jsr:@std/http@0.223/user-agent";
export { LimitedReader } from "jsr:@std/io@0.223/limited-reader";
export { readAll } from "jsr:@std/io@0.223/read-all";
export { contentType } from "jsr:@std/media-types@0.223/content-type";
export { typeByExtension } from "jsr:@std/media-types@0.223/type-by-extension";
export {
basename,
extname,
Expand All @@ -34,7 +34,7 @@ export {
normalize,
parse,
SEPARATOR,
} from "jsr:@std/path@0.222/";
} from "jsr:@std/path@0.223/";

// 3rd party dependencies

Expand Down
2 changes: 1 addition & 1 deletion examples/closeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application, type Context, Router, Status } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion examples/cookieServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion examples/countingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* `MiddlewareObject` can be ideal for when a middleware needs to encapsulate
* large amounts of logic or its own state. */

import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import {
Application,
Expand Down
2 changes: 1 addition & 1 deletion examples/httpsServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion examples/proxyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This is an example proxy server.
*/

import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application, HttpError, proxy, Status } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion examples/routingServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import {
Application,
Expand Down
2 changes: 1 addition & 1 deletion examples/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion examples/sseServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

// Importing some console colors
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, yellow } from "jsr:@std/fmt@0.223/colors";

import {
Application,
Expand Down
2 changes: 1 addition & 1 deletion examples/staticServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* $CWD/examples/static path.
*/

import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.222/colors";
import { bold, cyan, green, red, yellow } from "jsr:@std/fmt@0.223/colors";

import { Application, HttpError, Status } from "../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Deno.test({
assertEquals(typeof mod.Application, "function");
assertEquals(typeof mod.Context, "function");
assertEquals(typeof mod.etag, "object");
assertEquals(typeof mod.etag.calculate, "function");
assertEquals(typeof mod.etag.getEntity, "function");
assertEquals(typeof mod.etag.factory, "function");
assertEquals(typeof mod.helpers, "object");
assertEquals(typeof mod.helpers.getQuery, "function");
Expand Down
2 changes: 1 addition & 1 deletion request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class Request {
/** An object representing the requesting user agent. If the `User-Agent`
* header isn't defined in the request, all the properties will be undefined.
*
* See [std/http/user_agent#UserAgent](https://deno.land/std@0.222.2/http/user_agent.ts?s=UserAgent)
* See [std/http/user_agent#UserAgent](https://deno.land/std@0.223/http/user_agent.ts?s=UserAgent)
* for more information.
*/
get userAgent(): UserAgent {
Expand Down
12 changes: 6 additions & 6 deletions test_deps.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2018-2024 the oak authors. All rights reserved. MIT license.

export { assertEquals } from "jsr:@std/assert@0.222/assert-equals";
export { assertInstanceOf } from "jsr:@std/assert@0.222/assert-instance-of";
export { assertRejects } from "jsr:@std/assert@0.222/assert-rejects";
export { assertStrictEquals } from "jsr:@std/assert@0.222/assert-strict-equals";
export { assertThrows } from "jsr:@std/assert@0.222/assert-throws";
export { unreachable } from "jsr:@std/assert@0.222/unreachable";
export { assertEquals } from "jsr:@std/assert@0.223/assert-equals";
export { assertInstanceOf } from "jsr:@std/assert@0.223/assert-instance-of";
export { assertRejects } from "jsr:@std/assert@0.223/assert-rejects";
export { assertStrictEquals } from "jsr:@std/assert@0.223/assert-strict-equals";
export { assertThrows } from "jsr:@std/assert@0.223/assert-throws";
export { unreachable } from "jsr:@std/assert@0.223/unreachable";

0 comments on commit 7a766dc

Please sign in to comment.