Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

SignedCookieStore

import { SignedCookieStore } from "https://raw.githubusercontent.com/worker-tools/signed-cookie-store/master/index.ts";

Signed Cookie Store

A partial implementation of the Cookie Store API that transparently signs and verifies cookies via the Web Cryptography API.

This is likely only useful in server-side implementations, but written in a platform-agnostic way.

class SignedCookieStore implements CookieStore {
constructor(
store: CookieStore,
key: CryptoKey,
);
addEventListener(...args: Parameters<CookieStore["addEventListener"]>): void;
delete(name: string): Promise<void>;
delete(options: CookieStoreDeleteOptions): Promise<void>;
async delete(name: string | CookieStoreDeleteOptions): Promise<void>;
dispatchEvent(event: Event): boolean;
get(name?: string): Promise<CookieListItem | null>;
get(options?: CookieStoreGetOptions): Promise<CookieListItem | null>;
async get(name?: string | CookieStoreGetOptions): Promise<CookieListItem | null>;
getAll(name?: string): Promise<CookieList>;
getAll(options?: CookieStoreGetOptions): Promise<CookieList>;
async getAll(name?: string | CookieStoreGetOptions): Promise<CookieList>;
removeEventListener(...args: Parameters<CookieStore["removeEventListener"]>): void;
set(name: string, value: string): Promise<void>;
set(options: CookieInit): Promise<void>;
async set(options: string | CookieInit, value?: string);
 
static async deriveCryptoKey(opts: DeriveOptions): Promise<CryptoKey>;
}

§Implements

§Constructors

§
new SignedCookieStore(store: CookieStore, key: CryptoKey, opts?: SignedCookieStoreOptions)
[src]

§Methods

§
addEventListener(...args: Parameters<CookieStore["addEventListener"]>): void
[src]
§
delete(name: string): Promise<void>
[src]
delete(options: CookieStoreDeleteOptions): Promise<void>
[src]
delete(name: string | CookieStoreDeleteOptions): Promise<void>
[src]
§
dispatchEvent(event: Event): boolean
[src]
§
get(name?: string): Promise<CookieListItem | null>
[src]
@return

null when the signature cookie is missing.

get(options?: CookieStoreGetOptions): Promise<CookieListItem | null>
[src]
get(name?: string | CookieStoreGetOptions): Promise<CookieListItem | null>
[src]
§
getAll(name?: string): Promise<CookieList>
[src]
@return

A list of cookies, exclusive of all cookies without signatures

getAll(options?: CookieStoreGetOptions): Promise<CookieList>
[src]
getAll(name?: string | CookieStoreGetOptions): Promise<CookieList>
[src]
§
removeEventListener(...args: Parameters<CookieStore["removeEventListener"]>): void
[src]
§
set(name: string, value: string): Promise<void>
[src]
set(options: CookieInit): Promise<void>
[src]
set(options: string | CookieInit, value?: string)
[src]

§Static Methods

§
deriveCryptoKey(opts: DeriveOptions): Promise<CryptoKey>
[src]

A helper function to derive a crypto key from a passphrase.