Iskra API Reference
    Preparing search index...

    Interface ApiKeyConfig

    interface ApiKeyConfig {
        cacheTtl?: number;
        customExtractor?: (c: Context) => string | null;
        enableCache?: boolean;
        extractStrategies?: ("custom" | "header" | "bearer" | "query")[];
        headerName?: string;
        onError?: (error: string, c: Context) => Response | Promise<Response>;
        onValidated?: (key: ApiKeyMetadata, c: Context) => void | Promise<void>;
        queryParamName?: string;
        requireScopes?: boolean;
        skipPaths?: string[];
        staticKeys?: (Partial<ApiKeyMetadata> & { key: string })[];
        store?: KeyStore;
    }
    Index
    cacheTtl?: number

    Ignored, see enableCache.

    customExtractor?: (c: Context) => string | null
    enableCache?: boolean

    Ignored. Keys are looked up in memory on every request; the cache kept a revoked key working and stored it in plaintext.

    extractStrategies?: ("custom" | "header" | "bearer" | "query")[]
    headerName?: string
    onError?: (error: string, c: Context) => Response | Promise<Response>
    onValidated?: (key: ApiKeyMetadata, c: Context) => void | Promise<void>
    queryParamName?: string
    requireScopes?: boolean
    skipPaths?: string[]
    staticKeys?: (Partial<ApiKeyMetadata> & { key: string })[]
    store?: KeyStore

    Keys looked up on each request after staticKeys, such as a database table: hashedKeys((hash) => …) or any KeyStore.