Skip to content

Commit

Permalink
move signing options too
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 2, 2023
1 parent bdb2d04 commit 679c994
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/cert.ts → src/_cert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type nodeForge from "node-forge";
import forge from "node-forge";
import ipRegex from "ip-regex";
import { defu } from "defu";
import type { Certificate, SigningOptions, HTTPSOptions } from "./types";
import type { Certificate, HTTPSOptions } from "./types";

export interface CertificateOptions {
validityDays: number;
Expand All @@ -26,6 +26,12 @@ export interface CommonCertificateOptions {
domains?: string[];
}

export interface SigningOptions {
signingKey?: string;
signingKeyCert?: string;
signingKeyPassphrase?: string;
}

export interface TLSCertOptions
extends CommonCertificateOptions,
SigningOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/listen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
HTTPSOptions,
} from "./types";
import { formatAddress, formatURL, getNetworkInterfaces } from "./_utils";
import { resolveCertificate } from "./cert";
import { resolveCertificate } from "./_cert";

export async function listen(
handle: RequestListener,
Expand Down
6 changes: 0 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ export interface HTTPSOptions {
domains?: string[];
}

export interface SigningOptions {
signingKey?: string;
signingKeyCert?: string;
signingKeyPassphrase?: string;
}

export interface ListenOptions {
name: string;
port?: GetPortInput;
Expand Down
2 changes: 1 addition & 1 deletion test/cert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, afterEach, test, expect } from "vitest";
import forge from "node-forge";
import { resolve } from "pathe";
import { Listener } from "../src";
import { TLSCertOptions, _private } from "../src/cert";
import { TLSCertOptions, _private } from "../src/_cert";

// eslint-disable-next-line no-console
// console.log = fn()
Expand Down

0 comments on commit 679c994

Please sign in to comment.