core&ui: add webauthn support (#484)

Co-authored-by: panda <panda_dtdyy@outlook.com>
Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
pandaandundefined authored and GitHub committed 2023-01-23 17:49:40 +08:00
1 parent 3d3a5480e3
commit d069fe127b
29 files changed
+621 -195

No files matched your search

+22 -1
View File
@@ -1,6 +1,9 @@
import { AttestationFormat } from '@simplewebauthn/server/dist/helpers/decodeAttestationObject';
import { AuthenticationExtensionsAuthenticatorOutputs } from '@simplewebauthn/server/dist/helpers/decodeAuthenticatorExtensions';
import { CredentialDeviceType } from '@simplewebauthn/typescript-types';
import type fs from 'fs';
import type { Dictionary, NumericDictionary } from 'lodash';
import type { Cursor, ObjectID } from 'mongodb';
import type { Binary, Cursor, ObjectID } from 'mongodb';
import type { Context } from './context';
import type { ProblemDoc } from './model/problem';
import type { Handler } from './service/server';
@@ -56,6 +59,24 @@ export interface OAuthUserResponse {
viewLang?: string;
}
export interface Authenticator {
name: string;
regat: number;
fmt: AttestationFormat;
counter: number;
aaguid: string;
credentialID: Binary;
credentialPublicKey: Binary;
credentialType: 'public-key';
attestationObject: Binary;
userVerified: boolean;
credentialDeviceType: CredentialDeviceType;
credentialBackedUp: boolean;
authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
authenticatorAttachment: 'platform' | 'cross-platform';
}
export interface Udoc extends Dictionary<any> {
_id: number;
mail: string;