diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-08 14:05:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-08 14:05:03 +0900 |
| commit | ff9a65e8faa46a101d3ed3dc8915dd1f269ef556 (patch) | |
| tree | a6b1ae734e61da58b4205cd08a505ce392b317a9 /packages/backend/src/models/entities/UserSecurityKey.ts | |
| parent | Update CHANGELOG.md (diff) | |
| download | sharkey-ff9a65e8faa46a101d3ed3dc8915dd1f269ef556.tar.gz sharkey-ff9a65e8faa46a101d3ed3dc8915dd1f269ef556.tar.bz2 sharkey-ff9a65e8faa46a101d3ed3dc8915dd1f269ef556.zip | |
feat: passkey support (#11804)
https://github.com/MisskeyIO/misskey/pull/149
Diffstat (limited to 'packages/backend/src/models/entities/UserSecurityKey.ts')
| -rw-r--r-- | packages/backend/src/models/entities/UserSecurityKey.ts | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/packages/backend/src/models/entities/UserSecurityKey.ts b/packages/backend/src/models/entities/UserSecurityKey.ts index ce1c270d46..96dd27d083 100644 --- a/packages/backend/src/models/entities/UserSecurityKey.ts +++ b/packages/backend/src/models/entities/UserSecurityKey.ts @@ -24,24 +24,47 @@ export class MiUserSecurityKey { @JoinColumn() public user: MiUser | null; + @Column('varchar', { + comment: 'User-defined name for this key', + length: 30, + }) + public name: string; + @Index() @Column('varchar', { - comment: - 'Variable-length public key used to verify attestations (hex-encoded).', + comment: 'The public key of the UserSecurityKey, hex-encoded.', }) public publicKey: string; + @Column('bigint', { + comment: 'The number of times the UserSecurityKey was validated.', + default: 0, + }) + public counter: number; + @Column('timestamp with time zone', { - comment: - 'The date of the last time the UserSecurityKey was successfully validated.', + comment: 'Timestamp of the last time the UserSecurityKey was used.', + default: () => 'now()', }) public lastUsed: Date; @Column('varchar', { - comment: 'User-defined name for this key', - length: 30, + comment: 'The type of Backup Eligibility in authenticator data', + length: 32, nullable: true, }) - public name: string; + public credentialDeviceType: string | null; + + @Column('boolean', { + comment: 'Whether or not the credential has been backed up', + nullable: true, + }) + public credentialBackedUp: boolean | null; + + @Column('varchar', { + comment: 'The type of the credential returned by the browser', + length: 32, array: true, nullable: true, + }) + public transports: string[] | null; constructor(data: Partial<MiUserSecurityKey>) { if (data == null) return; |