29 lines
488 B
TypeScript
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[]
|
|
}
|