| 2 | import type { Elysia } from "elysia"; |
| 3 | |
| 4 | export interface CapMiddlewareOptions { |
| 5 | /** |
| 6 | * Duration in hours for which the authentication token remains valid |
| 7 | * @default 32 |
| 8 | */ |
| 9 | token_validity_hours?: number; |
| 10 | |
| 11 | /** |
| 12 | * File path where authentication tokens are stored |
| 13 | * @default ".data/middlewareTokens.json" |
| 14 | */ |
| 15 | tokens_store_path?: string; |
| 16 | |
| 17 | /** |
| 18 | * Size of the generated token in bytes |
| 19 | * @default 16 |
| 20 | */ |
| 21 | token_size?: number; |
| 22 | |
| 23 | /** |
| 24 | * Path to the HTML template used for verification |
| 25 | * @default "./index.html" (relative to middleware file) |
| 26 | */ |
| 27 | verification_template_path?: string; |
| 28 | |
| 29 | /** |
| 30 | * Determines how the middleware is applied |
| 31 | * @default "global" |
| 32 | */ |
| 33 | scoping?: "global" | "scoped"; |
| 34 | } |
| 35 | |
| 36 | export interface TokenValidationResult { |
| 37 | success: boolean; |
nothing calls this directly
no outgoing calls
no test coverage detected