1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-14 06:45:12 +02:00

refactor: パスキーまわりのライブラリを更新 (#17354)

* refactor: パスキーまわりのライブラリを更新

* fix
This commit is contained in:
かっこかり
2026-05-03 17:16:06 +09:00
committed by GitHub
parent 9d20152e05
commit 723d8add2f
20 changed files with 96 additions and 243 deletions

View File

@@ -5,6 +5,8 @@ import {
AdminRolesCreateResponse,
EmptyRequest,
EmptyResponse,
I2faRegisterKeyRequest,
I2faKeyDoneResponse,
UsersShowRequest,
} from './autogen/entities.js';
import {
@@ -18,6 +20,8 @@ import {
SignupPendingResponse,
SignupRequest,
SignupResponse,
I2faRegisterKeyResponse,
I2faKeyDoneRequest,
} from './entities.js';
type Overwrite<T, U extends { [Key in keyof T]?: unknown }> = Omit<
@@ -109,6 +113,14 @@ export type Endpoints = Overwrite<
},
},
},
'i/2fa/register-key': {
req: I2faRegisterKeyRequest;
res: I2faRegisterKeyResponse;
},
'i/2fa/key-done': {
req: I2faKeyDoneRequest;
res: I2faKeyDoneResponse;
},
'admin/roles/create': {
req: Overwrite<AdminRolesCreateRequest, { policies: PartialRolePolicyOverride }>;
res: AdminRolesCreateResponse;

View File

@@ -1,5 +1,5 @@
import type { SwitchCaseResponseType } from '../api.js';
import type { Endpoints } from './endpoint.js';
import type { Endpoints } from '../api.types.js';
declare module '../api.js' {
export interface APIClient {

View File

@@ -24446,41 +24446,7 @@ export interface operations {
[name: string]: unknown;
};
content: {
'application/json': {
rp: {
id?: string;
};
user: {
id: string;
name: string;
displayName: string;
};
challenge: string;
pubKeyCredParams: {
type: string;
alg: number;
}[];
timeout: number | null;
excludeCredentials: {
id: string;
type: string;
transports: ('ble' | 'cable' | 'hybrid' | 'internal' | 'nfc' | 'smart-card' | 'usb')[];
}[] | null;
authenticatorSelection: {
/** @enum {string} */
authenticatorAttachment: 'cross-platform' | 'platform';
requireResidentKey: boolean;
/** @enum {string} */
userVerification: 'discouraged' | 'preferred' | 'required';
} | null;
/** @enum {string|null} */
attestation: 'direct' | 'enterprise' | 'indirect' | 'none' | null;
extensions: {
appid: string | null;
credProps: boolean | null;
hmacCreateSecret: boolean | null;
} | null;
};
'application/json': Record<string, never>;
};
};
/** @description Client error */

View File

@@ -10,7 +10,12 @@ import {
User,
UserDetailedNotMe,
} from './autogen/models.js';
import type { AuthenticationResponseJSON, PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
import type {
AuthenticationResponseJSON,
RegistrationResponseJSON,
PublicKeyCredentialCreationOptionsJSON,
PublicKeyCredentialRequestOptionsJSON,
} from '@simplewebauthn/browser';
export * from './autogen/entities.js';
export * from './autogen/models.js';
@@ -324,6 +329,15 @@ export type SigninWithPasskeyResponse = {
signinResponse: SigninFlowResponse & { finished: true };
};
export type I2faRegisterKeyResponse = PublicKeyCredentialCreationOptionsJSON;
export type I2faKeyDoneRequest = {
password: string;
token?: string | null;
name: string;
credential: RegistrationResponseJSON;
};
type Values<T extends Record<PropertyKey, unknown>> = T[keyof T];
export type PartialRolePolicyOverride = Partial<{ [k in keyof RolePolicies]: Omit<Values<Role['policies']>, 'value'> & { value: RolePolicies[k] } }>;