-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
528 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference types="node" /> | ||
import { DigestHashAlgorithm, IncomingRequest } from '../types'; | ||
import { BinaryLike } from 'node:crypto'; | ||
export declare function genRFC3230DigestHeader(body: string, hashAlgorithm?: DigestHashAlgorithm): string; | ||
export declare const digestHeaderRegEx: RegExp; | ||
export declare function verifyRFC3230DigestHeader(request: IncomingRequest, rawBody: BinaryLike, failOnNoDigest?: boolean, errorLogger?: ((message: any) => any)): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// <reference types="node" /> | ||
import { IncomingRequest } from "src/types"; | ||
import { BinaryLike } from "node:crypto"; | ||
export declare function verifyDigestHeader(request: IncomingRequest, rawBody: BinaryLike, failOnNoDigest?: boolean, errorLogger?: ((message: any) => any)): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference types="node" /> | ||
import { BinaryLike } from 'node:crypto'; | ||
import { DigestHashAlgorithm } from '../types'; | ||
export declare function createBase64Digest(body: BinaryLike, hash: DigestHashAlgorithm): string; | ||
export declare function createBase64Digest<Ks extends DigestHashAlgorithm[]>(body: BinaryLike, hash: Ks): Map<Ks[number], string>; | ||
export declare function createBase64Digest(body: BinaryLike): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
import { RequestParseOptions } from "../parse.js"; | ||
import type { DraftParsedSignature, IncomingRequest } from '../types.js'; | ||
import type { ParsedDraftSignature, IncomingRequest } from '../types.js'; | ||
export declare class SignatureHeaderContentLackedError extends Error { | ||
constructor(lackedContent: string); | ||
} | ||
export declare function parseDraftRequestSignatureHeader(signatureHeader: string): Record<string, string>; | ||
export declare function parseDraftRequest(request: IncomingRequest, options?: RequestParseOptions): DraftParsedSignature; | ||
export declare class SignatureHeaderClockInvalidError extends Error { | ||
constructor(prop: 'created' | 'expires'); | ||
} | ||
export declare const DraftSignatureHeaderKeys: readonly ["keyId", "algorithm", "created", "expires", "opaque", "headers", "signature"]; | ||
export type DraftSignatureHeaderParsedRaw = { | ||
[key in typeof DraftSignatureHeaderKeys[number]]?: string; | ||
}; | ||
export type DraftSignatureHeaderParsed = { | ||
keyId: string; | ||
algorithm: string; | ||
signature: string; | ||
headers: string[]; | ||
created?: string; | ||
expires?: string; | ||
opaque?: string; | ||
}; | ||
export declare function parseDraftRequestSignatureHeader(signatureHeader: string): DraftSignatureHeaderParsedRaw; | ||
export declare function validateAndProcessParsedDraftSignatureHeader(parsed: DraftSignatureHeaderParsedRaw, options?: RequestParseOptions): DraftSignatureHeaderParsed; | ||
export declare function parseDraftRequest(request: IncomingRequest, options?: RequestParseOptions): ParsedDraftSignature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import type { DraftParsedSignature } from '../types.js'; | ||
export declare function verifySignature(parsed: DraftParsedSignature['value'], publicKeyPem: string, errorLogger?: ((message: any) => any)): boolean; | ||
import type { ParsedDraftSignature } from '../types.js'; | ||
export declare function verifyDraftSignature(parsed: ParsedDraftSignature['value'], publicKeyPem: string, errorLogger?: ((message: any) => any)): boolean; |
Oops, something went wrong.