Eine Quelle für Server und Admin-UI: - `AdminLoginResponse`: Union aus `AdminMfaChallenge` (`mfaRequired: true`) und `AdminLoginSession` (`token`, `user`, `amr`, `mfaEnrollmentRecommended`). Die Diskriminante ist `mfaRequired`, damit Clients sauber narrowen. - `AdminAuthMethod` (`pwd|totp|recovery|webauthn`) vs. `AdminMfaMethod` (ohne `pwd`) — Go schreibt `pwd` immer in `amr`, bietet es aber nie als Faktor an. - `AdminMfaStatus`, `AdminMfaTotpEnrollment`, `AdminMfaConfirmResult`, `AdminStepUpResult`. - WebAuthn: `AdminWebAuthnCreationOptions`, `AdminWebAuthnRequestOptions`, `AdminWebAuthnCredentialJSON`, `AdminWebAuthnCredentialView`, `AdminAuthenticatorTransport`. Type-Tests in `types-test/admin-auth.ts`: `Expect<Equal<…>>`-Assertions und `@ts-expect-error` für die nicht möglichen Felder der Challenge. `npm test` führt jetzt Schemas **und** `tsc` aus (TypeScript als devDependency).
25 lines
619 B
JSON
25 lines
619 B
JSON
{
|
|
"name": "tibi-types",
|
|
"version": "0.0.1",
|
|
"description": "tibi hook types and validated config schemas",
|
|
"types": "index.d.ts",
|
|
"scripts": {
|
|
"validate:schemas": "node scripts/validate-schemas.mjs",
|
|
"typecheck": "tsc -p tsconfig.json",
|
|
"test": "npm run validate:schemas && npm run typecheck"
|
|
},
|
|
"devDependencies": {
|
|
"ajv": "^8.20.0",
|
|
"ajv-formats": "^3.0.1",
|
|
"glob": "^11.1.0",
|
|
"js-yaml": "^4.1.1",
|
|
"typescript": "^5.9.3"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://gitbase.de/cms/tibi-types.git"
|
|
},
|
|
"author": "Sebastian Frank",
|
|
"license": "MIT"
|
|
}
|