Files
csbi/apps/mnie-server/src/context.ts
T
2026-07-10 19:03:57 +09:00

29 lines
488 B
TypeScript

import type { ServerConfig } from './config'
import type { Db } from './db'
export interface AppBindings {
Variables: {
db: Db
config: ServerConfig
authenticated: boolean
auth: AuthContext
}
}
export type AuthContext =
| {
type: 'none'
authenticated: false
}
| {
type: 'session'
authenticated: true
sessionId: string
}
| {
type: 'apiKey'
authenticated: true
apiKeyId: string
scopes: string[]
}