diff --git a/CHANGELOG.md b/CHANGELOG.md index 082b448c2b..e6c66f0859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ - Feat: プロフィールでのリンク検証 - Feat: 通知をテストできるようになりました - Feat: PWAのアイコンが設定できるようになりました +- Enhance: アンテナの受信ソースに指定したユーザを除外するものを追加 +- Enhance: 二要素認証設定時のセキュリティを強化 + - パスワード入力が必要な操作を行う際、二要素認証が有効であれば確認コードの入力も必要になりました - Enhance: manifest.jsonをオーバーライド可能に - Enhance: 依存関係の更新 - Enhance: ローカリゼーションの更新 @@ -40,10 +43,9 @@ - Feat: Playで直接投稿フォームを埋め込めるように(`Ui:C:postForm`) - Feat: クライアントを起動している間、デバイスの画面が自動でオフになるのを防ぐオプションを追加 - Feat: 新しい実績を追加 -- Enhance: ノート詳細ページを改修 - - 読み込み時のパフォーマンスが向上しました - - リノート一覧、リアクション一覧がタブとして追加されました - - ノートのメニューからは当該項目は消えました +- Enhance: ノート詳細ページでリノート一覧、リアクション一覧タブを追加 + - ノートのメニューからは当該項目は消えました +- Enhance: センシティブなメディアを目立たせる設定を追加 - Enhance: プロフィールにその人が作ったPlayの一覧出せるように - Enhance: メニューのスイッチの動作を改善 - Enhance: 絵文字ピッカーの検索の表示件数を100件に増加 @@ -62,6 +64,7 @@ - Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように - Enhance: Mk:apiが失敗した時にエラー型の値(AiScript 0.16.0で追加)を返すように - Enhance: ScratchpadでAsync:系関数やボタンのコールバックなどのエラーにもダイアログを出すように(試験的なためPlayなどには未実装) +- Enhance: ノート詳細ページ読み込み時のパフォーマンスが向上しました - Enhance: タイムラインでリスト/アンテナ選択時のパフォーマンスを改善 - Enhance: 「Moderation note」、「Add moderation note」をローカライズできるように - Enhance: 細かなデザインの調整 @@ -89,6 +92,7 @@ - Fix: muteがapiからのuser list timeline取得で機能しない問題を修正 - Fix: ジョブキュー管理画面の認証を回避できる問題を修正 - Fix: 一部のサーバー内部エラーがスタックトレースを返さないように修正 +- Fix: 一部のリモートユーザーをフォローすることができない問題を修正 ## 13.14.2 diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index 3d6020841d..525b393372 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -1679,7 +1679,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Již jste zaregistrovali dvoufaktorové ověřovací zařízení." registerTOTP: "Registrovat aplikaci autentizátoru" - passwordToTOTP: "Zadejte své heslo" step1: "Nejprve si do zařízení nainstalujte aplikaci pro ověřování (například {a} nebo {b})." step2: "Poté naskenujte QR kód zobrazený na této obrazovce." step2Click: "Kliknutím na tento QR kód můžete zaregistrovat 2FA do bezpečnostního klíče nebo aplikace autentizace telefonu." diff --git a/locales/de-DE.yml b/locales/de-DE.yml index 159687f093..85d395c9f3 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -1126,6 +1126,10 @@ renotes: "Renotes" loadReplies: "Antworten anzeigen" loadConversation: "Unterhaltung anzeigen" pinnedList: "Angeheftete Liste" +keepScreenOn: "Bildschirm angeschaltet lassen" +verifiedLink: "Link-Besitz wurde verifiziert" +notifyNotes: "Über neue Notizen benachrichtigen" +unnotifyNotes: "Nicht über neue Notizen benachrichtigen" _announcement: forExistingUsers: "Nur für existierende Nutzer" forExistingUsersDescription: "Ist diese Option aktiviert, wird diese Ankündigung nur Nutzern angezeigt, die zum Zeitpunkt der Ankündigung bereits registriert sind. Ist sie deaktiviert, wird sie auch Nutzern, die sich nach dessen Veröffentlichung registrieren, angezeigt." @@ -1792,7 +1796,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Du hast bereits ein Gerät für Zwei-Faktor-Authentifizierung registriert." registerTOTP: "Authentifizierungs-App registrieren" - passwordToTOTP: "Bitte Passwort eingeben" step1: "Installiere zuerst eine Authentifizierungsapp (z.B. {a} oder {b}) auf deinem Gerät." step2: "Dann, scanne den angezeigten QR-Code mit deinem Gerät." step2Click: "Durch Klicken dieses QR-Codes kannst du Verifikation mit deinem Security-Token oder einer App registrieren." @@ -1971,6 +1974,7 @@ _profile: metadataContent: "Inhalt" changeAvatar: "Profilbild ändern" changeBanner: "Banner ändern" + verifiedLinkDescription: "Gibst du hier eine URL ein, die einen Link zu deinem Profile enthält, wird neben diesem Feld ein Icon zur Besitzbestätigung angezeigt." _exportOrImport: allNotes: "Alle Notizen" favoritedNotes: "Als Favorit markierte Notizen" @@ -2093,6 +2097,7 @@ _notification: yourFollowRequestAccepted: "Deine Follow-Anfrage wurde akzeptiert" youWereInvitedToGroup: "{userName} hat dich in eine Gruppe eingeladen" pollEnded: "Umfrageergebnisse sind verfügbar" + newNote: "Neue Notiz" unreadAntennaNote: "Antenne {name}" emptyPushNotificationMessage: "Push-Benachrichtigungen wurden aktualisiert" achievementEarned: "Errungenschaft freigeschaltet" diff --git a/locales/en-US.yml b/locales/en-US.yml index 2a0ad3ae6d..0cff01bc26 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1175,6 +1175,10 @@ renotes: "Renotes" loadReplies: "Show replies" loadConversation: "Show conversation" pinnedList: "Pinned list" +keepScreenOn: "Keep screen on" +verifiedLink: "Link ownership has been verified" +notifyNotes: "Notify about new notes" +unnotifyNotes: "Stop notifying about new notes" additionalPermissionsForFlash: "Allow to add permission to Play" thisFlashRequiresTheFollowingPermissions: "This Play requires the following permissions" doYouWantToAllowThisPlayToAccessYourAccount: "Do you want to allow this Play to access your account?" @@ -1957,7 +1961,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "You have already registered a 2-factor authentication device." registerTOTP: "Register authenticator app" - passwordToTOTP: "Enter your password" step1: "First, install an authentication app (such as {a} or {b}) on your device." step2: "Then, scan the QR code displayed on this screen." step2Click: "Clicking on this QR code will allow you to register 2FA to your security key or phone authenticator app." @@ -2136,6 +2139,7 @@ _profile: metadataContent: "Content" changeAvatar: "Change avatar" changeBanner: "Change banner" + verifiedLinkDescription: "By entering an URL that contains a link to your profile here, an ownership verification icon can be displayed next to the field." _exportOrImport: allNotes: "All notes" favoritedNotes: "Favorite notes" @@ -2259,6 +2263,7 @@ _notification: yourFollowRequestAccepted: "Your follow request was accepted" youWereInvitedToGroup: "{userName} invited you to a group" pollEnded: "Poll results have become available" + newNote: "New note" unreadAntennaNote: "Antenna {name}" emptyPushNotificationMessage: "Push notifications have been updated" achievementEarned: "Achievement unlocked" diff --git a/locales/es-ES.yml b/locales/es-ES.yml index 2e579541bc..089860e6fa 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -1785,7 +1785,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Ya has completado la configuración." registerTOTP: "Registrar aplicación autenticadora" - passwordToTOTP: "Ingresa tu contraseña" step1: "Primero, instale en su dispositivo la aplicación de autenticación {a} o {b} u otra." step2: "Luego, escanee con la aplicación el código QR mostrado en pantalla." step2Click: "Clicking on this QR code will allow you to register 2FA to your security key or phone authenticator app.\nTocar este código QR te permitirá registrar la autenticación 2FA a tu llave de seguridad o aplicación autenticadora." diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index d9a9f42e3c..4a03731997 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -492,6 +492,7 @@ createAccount: "Créer un compte" existingAccount: "Compte existant" regenerate: "Générer à nouveau" fontSize: "Taille de la police" +limitTo: "Limiter à {x}" noFollowRequests: "Vous n’avez aucune demande d’abonnement en attente" openImageInNewTab: "Ouvrir les images dans un nouvel onglet" dashboard: "Tableau de bord" diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 33af63c49c..4551a693ba 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -1761,7 +1761,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Kamu telah mendaftarkan perangkat otentikasi dua faktor." registerTOTP: "Daftarkan aplikasi autentikator" - passwordToTOTP: "Masukkan kata sandimu" step1: "Pertama, pasang aplikasi otentikasi (seperti {a} atau {b}) di perangkat kamu." step2: "Lalu, pindai kode QR yang ada di layar." step2Click: "Mengeklik kode QR ini akan membolehkanmu untuk mendaftarkan 2FA ke security-key atau aplikasi autentikator ponsel." diff --git a/locales/index.d.ts b/locales/index.d.ts index 79bc18d509..5546eccae8 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1182,6 +1182,8 @@ export interface Locale { "verifiedLink": string; "notifyNotes": string; "unnotifyNotes": string; + "authentication": string; + "authenticationRequiredToContinue": string; "additionalPermissionsForFlash": string; "thisFlashRequiresTheFollowingPermissions": string; "doYouWantToAllowThisPlayToAccessYourAccount": string; @@ -2090,7 +2092,6 @@ export interface Locale { "_2fa": { "alreadyRegistered": string; "registerTOTP": string; - "passwordToTOTP": string; "step1": string; "step2": string; "step2Click": string; @@ -2173,6 +2174,7 @@ export interface Locale { "users": string; "userList": string; "userGroup": string; + "userBlacklist": string; }; "_weekday": { "sunday": string; diff --git a/locales/it-IT.yml b/locales/it-IT.yml index d67d2a2a06..e609053fcb 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -134,7 +134,7 @@ renoteMute: "Silenzia i Rinota" renoteUnmute: "Non silenziare i Rinota" block: "Blocca" unblock: "Sblocca" -suspend: "Sospendi" +suspend: "Sospensione" unsuspend: "Revoca la sospensione" blockConfirm: "Vuoi davvero bloccare il profilo?" unblockConfirm: "Vuoi davvero sbloccare il profilo?" @@ -180,7 +180,7 @@ youHaveNoLists: "Non hai ancora creato nessuna lista" followConfirm: "Vuoi seguire {name}?" proxyAccount: "Profilo proxy" proxyAccountDescription: "Un profilo proxy funziona come follower per i profili remoti, sotto certe condizioni. Ad esempio, quando un profilo locale ne inserisce uno remoto in una lista (senza seguirlo), se nessun altro segue quel profilo remoto, le attività non possono essere distribuite. Dunque, il profilo proxy le seguirà per tutti." -host: "Server remoto" +host: "Host" selectUser: "Seleziona profilo" recipient: "Destinatario" annotation: "Annotazione preventiva" @@ -287,7 +287,7 @@ images: "Immagini" image: "Immagini" birthday: "Compleanno" yearsOld: "{age} anni" -registeredDate: "Iscrizione a.." +registeredDate: "Data iscrizione" location: "Posizione" theme: "Tema" themeForLightMode: "Tema da utilizzare per il modo chiaro" @@ -508,7 +508,7 @@ noFollowRequests: "Non hai alcuna richiesta di follow" openImageInNewTab: "Apri le immagini in un nuovo tab" dashboard: "Pannello di controllo" local: "Locale" -remote: "Remoto" +remote: "Remota" total: "Totale" weekOverWeekChanges: "Settimanale" dayOverDayChanges: "Giornaliero" @@ -563,8 +563,8 @@ installedDate: "Data installazione" lastUsedDate: "Data di ultimo uso" state: "Stato" sort: "Ordina per" -ascendingOrder: "Ascendente" -descendingOrder: "Discendente" +ascendingOrder: "Aumenta" +descendingOrder: "Diminuisce" scratchpad: "ScratchPad" scratchpadDescription: "Lo Scratchpad offre un ambiente per esperimenti di AiScript. È possibile scrivere, eseguire e confermare i risultati dell'interazione del codice con CherryPick." output: "Uscita" @@ -633,7 +633,7 @@ emailConfigInfo: "Utilizzato per verificare il tuo indirizzo di posta elettronic email: "Email" emailAddress: "Indirizzo di posta elettronica" smtpConfig: "Impostazioni del server SMTP" -smtpHost: "Server remoto" +smtpHost: "Host SMTP" smtpPort: "Porta" smtpUser: "Nome utente" smtpPass: "Password" @@ -1126,6 +1126,10 @@ renotes: "Rinota" loadReplies: "Leggi le risposte" loadConversation: "Leggi la conversazione" pinnedList: "Elenco in primo piano" +keepScreenOn: "Mantieni lo schermo acceso" +verifiedLink: "Abbiamo confermato la validità di questo collegamento" +notifyNotes: "Notifica nuove Note" +unnotifyNotes: "Interrompi le notifiche di nuove Note" _announcement: forExistingUsers: "Solo ai profili attuali" forExistingUsersDescription: "L'annuncio sarà visibile solo ai profili esistenti in questo momento. Se disabilitato, sarà visibile anche ai profili che verranno creati dopo la pubblicazione di questo annuncio." @@ -1476,10 +1480,10 @@ _role: _condition: isLocal: "Profilo locale" isRemote: "Profilo remoto" - createdLessThan: "Creato meno di" - createdMoreThan: "Creato più di" - followersLessThanOrEq: "Ha meno di N follower" - followersMoreThanOrEq: "Ha più di N follower" + createdLessThan: "Profilo creato da meno di N" + createdMoreThan: "Profilo creato da più di N" + followersLessThanOrEq: "Profilo con N follower o meno" + followersMoreThanOrEq: "Profilo con N follower o più" followingLessThanOrEq: "Segue N profili o meno" followingMoreThanOrEq: "Segue N profili o più" notesLessThanOrEq: "Conteggio Note inferiore o uguale a" @@ -1792,7 +1796,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "La configurazione è stata già completata." registerTOTP: "Registra un'app di autenticazione" - passwordToTOTP: "Inserire la password" step1: "Innanzitutto, installare sul dispositivo un'applicazione di autenticazione come {a} o {b}." step2: "Quindi, scansionare il codice QR visualizzato con l'app." step2Click: "Cliccando sul codice QR, puoi registrarlo con l'app di autenticazione o il portachiavi installato sul tuo dispositivo." @@ -1971,6 +1974,7 @@ _profile: metadataContent: "Contenuto" changeAvatar: "Modifica immagine profilo" changeBanner: "Cambia intestazione" + verifiedLinkDescription: "Puoi verificare il tuo profilo mostrando una icona. Devi inserire la URL alla pagina che contiene un link al tuo profilo." _exportOrImport: allNotes: "Tutte le note" favoritedNotes: "Note preferite" @@ -2093,6 +2097,7 @@ _notification: yourFollowRequestAccepted: "La tua richiesta di follow è stata accettata" youWereInvitedToGroup: "Invitat@ al gruppo" pollEnded: "Risultati del sondaggio." + newNote: "Nuove Note" unreadAntennaNote: "Antenna {name}" emptyPushNotificationMessage: "Le notifiche push sono state aggiornate." achievementEarned: "Obiettivo raggiunto" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0f1fa24f27..6e90413d40 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -761,7 +761,7 @@ alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定 loadRawImages: "添付画像のサムネイルをオリジナル画質にする" disableShowingAnimatedImages: "アニメーション画像を再生しない" disableShowingAnimatedImagesDescription: "無効にすると、動く画像が再生されます。光敏感性発作を起こすことがありますので、ご注意ください。" -highlightSensitiveMedia: "センシティブなメディアを目立たせる" +highlightSensitiveMedia: "メディアがセンシティブであることを分かりやすく表示" verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。\nもしメールが来なかったらスパムメールボックスを確認してください。" notSet: "未設定" emailVerified: "メールアドレスが確認されました" @@ -1179,6 +1179,8 @@ keepScreenOn: "デバイスの画面を常にオンにする" verifiedLink: "このリンク先の所有者であることが確認されました" notifyNotes: "投稿を通知" unnotifyNotes: "投稿の通知を解除" +authentication: "認証" +authenticationRequiredToContinue: "続けるには認証を行ってください" additionalPermissionsForFlash: "Playへの追加許可" thisFlashRequiresTheFollowingPermissions: "このPlayは以下の権限を要求しています" doYouWantToAllowThisPlayToAccessYourAccount: "このPlayによるアカウントへのアクセスを許可しますか?" @@ -2004,7 +2006,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "既に設定は完了しています。" registerTOTP: "認証アプリの設定を開始" - passwordToTOTP: "パスワードを入力してください" step1: "まず、{a}や{b}などの認証アプリをお使いのデバイスにインストールします。" step2: "次に、表示されているQRコードをアプリでスキャンします。" step2Click: "QRコードをクリックすると、お使いの端末にインストールされている認証アプリやキーリングに登録できます。" @@ -2087,6 +2088,7 @@ _antennaSources: users: "指定した一人または複数のユーザーのノート" userList: "指定したリストのユーザーのノート" userGroup: "指定したグループのユーザーのノート" + userBlacklist: "指定した一人または複数のユーザーを除いた全てのノート" _weekday: sunday: "日曜日" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 693f97fd62..aa7870cde9 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -1777,7 +1777,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "もう設定終わっとるわ。" registerTOTP: "認証アプリの設定はじめる" - passwordToTOTP: "パスワードを入れてーや" step1: "ほんなら、{a}や{b}とかの認証アプリを使っとるデバイスにインストールしてな。" step2: "次に、ここにあるQRコードをアプリでスキャンしてな~。" step2Click: "QRコードをクリックすると、今使とる端末に入っとる認証アプリとかキーリングに登録できるで。" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 8a16f4cc0f..d574350215 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1945,7 +1945,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "이미 설정되어 있어요!" registerTOTP: "인증 앱 설정 시작" - passwordToTOTP: "비밀번호를 입력하세요." step1: "먼저, {a}나 {b}등의 인증 앱을 사용 중인 디바이스에 설치해 주세요." step2: "인증 앱을 설치했다면, 표시되어 있는 QR 코드를 앱으로 스캔해 주세요." step2Click: "QR 코드를 클릭하면 기기에 설치된 인증 앱에 등록할 수 있어요." diff --git a/locales/pt-PT.yml b/locales/pt-PT.yml index f0bd95889f..443721a10f 100644 --- a/locales/pt-PT.yml +++ b/locales/pt-PT.yml @@ -411,6 +411,7 @@ aboutMisskey: "Sobre CherryPick" administrator: "Administrador" token: "Símbolo" 2fa: "Autenticação de dois fatores" +setupOf2fa: "Configuração de autenticação de dois fatores" totp: "Aplicativo Autenticador" totpDescription: "Digite a senha de uso único informado pelo aplicativo autenticador" moderator: "Moderador" @@ -918,6 +919,7 @@ pleaseSelect: "Por favor, selecione." reverse: "Inversão" colored: "Colorido" refreshInterval: "Intervalo de atualização" +label: "Etiqueta" type: "Tipo" speed: "Velocidade" slow: "Lento" @@ -1008,6 +1010,7 @@ waitingForMailAuth: "Verificação de e-mail pendente " icon: "Avatar" replies: "Responder" renotes: "Repostar" +keepScreenOn: "Manter a tela do dispositivo sempre ligada" _initialAccountSetting: followUsers: "Siga usuários que lhe interessam para criar a sua linha do tempo." _serverSettings: diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 07d59a1ba0..b6b25a30b4 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -1688,7 +1688,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Двухфакторная аутентификация уже настроена." registerTOTP: "Начните настраивать приложение-аутентификатор" - passwordToTOTP: "Пожалуйста, введите свой пароль" step1: "Прежде всего, установите на устройство приложение для аутентификации, например, {a} или {b}." step2: "Далее отсканируйте отображаемый QR-код при помощи приложения." step2Click: "Нажав на QR-код, вы можете зарегистрироваться с помощью приложения для аутентификации или брелка для ключей, установленного на вашем устройстве." diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml index 91d631f7ac..72af3f1a79 100644 --- a/locales/sv-SE.yml +++ b/locales/sv-SE.yml @@ -510,7 +510,6 @@ _sfx: chat: "Chatt" antenna: "Antenner" _2fa: - passwordToTOTP: "Skriv in ditt lösenord" renewTOTPCancel: "Nej tack" _antennaSources: all: "Alla noter" diff --git a/locales/th-TH.yml b/locales/th-TH.yml index 9380d6999d..cf4e17ad7c 100644 --- a/locales/th-TH.yml +++ b/locales/th-TH.yml @@ -1776,7 +1776,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "คุณได้ลงทะเบียนอุปกรณ์ยืนยันตัวตนแบบ 2 ชั้นแล้ว" registerTOTP: "ลงทะเบียนแอพตัวตรวจสอบสิทธิ์" - passwordToTOTP: "กรอกรหัสผ่าน" step1: "ขั้นตอนแรก ติดตั้งแอปยืนยันตัวตน (เช่น {a} หรือ {b}) บนอุปกรณ์ของคุณ" step2: "จากนั้นสแกนรหัส QR ที่แสดงบนหน้าจอนี้" step2Click: "การคลิกที่รหัส QR นี้จะช่วยให้คุณนั้นสามารถลงทะเบียน 2FA กับคีย์ความปลอดภัยหรือแอปตรวจสอบความถูกต้องของโทรศัพท์ได้" diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index cdc1e4679c..ba5d98ec40 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -1020,9 +1020,9 @@ enableChartsForRemoteUser: "Tạo biểu đồ người dùng từ xa" video: "Video" videos: "Các video" dataSaver: "Tiết kiệm dung lượng" -accountMigration: "Gộp chung tài khoản" +accountMigration: "Chuyển tài khoản" accountMoved: "Người dùng này đã chuyển sang một tài khoản mới:" -accountMovedShort: "Tài khoản này đã được gộp" +accountMovedShort: "Tài khoản này đã được chuyển" operationForbidden: "Thao tác này không thể thực hiện" forceShowAds: "Luôn hiện quảng cáo" notificationDisplay: "Thông báo" @@ -1060,9 +1060,12 @@ renotes: "Đăng lại" loadReplies: "Hiển thị các trả lời" pinnedList: "Các mục đã được ghim" keepScreenOn: "Giữ màn hình luôn bật" +verifiedLink: "Chúng tôi đã xác nhận bạn là chủ sở hữu của đường dẫn này" _announcement: forExistingUsers: "Chỉ những người dùng đã tồn tại" + forExistingUsersDescription: "Nếu được bật, thông báo này sẽ chỉ hiển thị với những người dùng đã tồn tại vào lúc thông báo được tạo. Nếu tắt đi, những tài khoản mới đăng ký sau khi thông báo được đăng lên cũng sẽ thấy nó." end: "Lưu trữ thông báo" + tooManyActiveAnnouncementDescription: "Có quá nhiều thông báo sẽ làm trải nghiệm của người dùng tệ đi. Vui lòng lưu trữ những thông báo đã hết hiệu lực." readConfirmTitle: "Đánh dấu là đã đọc?" readConfirmText: "Điều này sẽ đánh dấu nội dung của \"{title}\" là đã đọc." _initialAccountSetting: @@ -1070,7 +1073,28 @@ _initialAccountSetting: letsStartAccountSetup: "Để bắt đầu, hãy cùng thiết lập tài khoản nhé." letsFillYourProfile: "Đầu tiên, hãy thiết lập hồ sơ của bạn." profileSetting: "Thiết lập hồ sơ" + privacySetting: "Cài đặt quyền riêng tư" + theseSettingsCanEditLater: "Bạn vẫn có thể thay đổi những cài đặt này." + youCanEditMoreSettingsInSettingsPageLater: "Còn rất nhiều những cài đặt khác bạn có thể thay đổi ở trang \"Cài đặt\". Hãy nhớ ghé thăm trong lần sau nhé." + followUsers: "Thử theo dõi một vài người mà bạn có thể thích để xây dựng dòng thời gian của mình." + pushNotificationDescription: "Bật thông báo đẩy sẽ cho phép bạn nhận thông báo từ {name} trực tiếp từ thiết bị của bạn." + initialAccountSettingCompleted: "Thiết lập tài khoản thành công!" + haveFun: "Hãy tận hưởng {name} nhé!" + ifYouNeedLearnMore: "Nếu bạn muốn tìm hiểu thêm về cách sử dụng {name} (Misskey), hãy vào {link}." + skipAreYouSure: "Bạn thực sự muốn bỏ qua mục thiết lập tài khoản?" + laterAreYouSure: "Bạn thực sự muốn thiết lập tài khoản vào lúc khác?" +_serverSettings: + iconUrl: "Biểu tượng URL" + appIconResolutionMustBe: "Độ phân giải tối thiểu là {resolution}." + manifestJsonOverride: "Ghi đè manifest.json" _accountMigration: + moveFrom: "Chuyển một tài khoản khác vào tài khoản này" + moveFromLabel: "Tài khoản gốc #{n}" + moveTo: "Chuyển tài khoản này vào một tài khoản khác" + moveCannotBeUndone: "Việc chuyển tài khoản không thể huỷ." + moveAccountDescription: "Điều này sẽ chuyển tài khoản này sang một tài khoản khác.\n ・Những người theo dõi sẽ tự động được chuyển sang tài khoản mới\n ・Tài khoản này sẽ tự bỏ theo dõi những người mà bạn đã theo dõi trước đây\n ・Bạn sẽ không thể đăng tút mới, v.v trên tài khoản này\n\nDù việc chuyển người theo dõi được diễn ra tự động, bạn vẫn phải tự chuẩn bị một vài bước để chuyển danh sách những người dùng bạn đang theo dõi. Để làm vậy, vui lòng thực hiện việc xuất dữ liệu những người dùng đã theo dõi mà sau này bạn sẽ dùng để nhập vào tài khoản mới ở menu Cài đặt. Hành động tương tự áp dụng với danh sách những người dùng bị chặn hoặc tắt tiếng.\n\n(Điều này áp dụng cho phiên bản Misskey v13.12.0 và sau này. Các phần mềm ActivityPub khác , ví dụ như Mastodon, sẽ có thể hoạt động khác đi.)" + startMigration: "Chuyển" + movedAndCannotBeUndone: "\nTài khoản này đã được chuyển đi.\nViệc di chuyển tài khoản không thể bị huỷ bỏ." movedTo: "Tài khoản mới:" _achievements: earnedAt: "Ngày thu nhận" @@ -1110,6 +1134,8 @@ _achievements: title: "Hàng tinh đăng bài" description: "Đã đăng bài 50,000 lần rồi" _notes100000: + title: "ALL YOUR NOTE ARE BELONG TO US" + description: "Đăng 100,000 tút" flavor: "Liệu viết bài gì tầm này vậy? " _login3: title: "Sơ cấp I" @@ -1141,6 +1167,15 @@ _achievements: _login400: title: "Khách hàng thường xuyên cấp III" description: "Tổng số ngày đăng nhập đạt 400 ngày" + _login1000: + flavor: "Cảm ơn bạn đã sử dụng Misskey!" + _noteFavorited1: + title: "Nhà thiên văn học" + _myNoteFavorited1: + title: "Đi tìm những ngôi sao" + _profileFilled: + title: "Luôn sẵn sàng" + description: "Thiết lập tài khoản của bạn" _markedAsCat: title: "Tôi là một con mèo" description: "Bật chế độ mèo" @@ -1166,8 +1201,18 @@ _achievements: _followers10: title: "FOLLOW ME!!" description: "Người theo dõi bạn vượt lên 10 người" + _followers50: + title: "Từng chút một" + description: "Đạt được 50 lượt theo dõi" + _followers100: + title: "Người nổi tiếng" + description: "Đạt được 100 lượt theo dõi" + _followers300: + title: "Vui lòng xếp thành hàng nào" + description: "Đạt được 300 lượt theo dõi" _followers500: title: "Trạm phát sóng" + description: "Đạt được 500 lượt theo dõi" _followers1000: title: "Người có tầm ảnh hưởng" description: "Người theo dõi bạn vượt lên 1000 người" @@ -1186,11 +1231,15 @@ _achievements: description: "Tìm thấy được những kho báu cất giấu" _client30min: title: "Giải lao xỉu" + description: "Giữ Misskey mở trong ít nhất 30 phút" + _client60min: + description: "Giữ Misskey mở trong ít nhất 60 phút" _noteDeletedWithin1min: title: "Xem như không có gì đâu nha" _postedAtLateNight: title: "Loài ăn đêm" description: "Đăng bài trong đêm khuya " + flavor: "Đến giờ đi ngủ rồi." _postedAt0min0sec: title: "Tín hiệu báo giờ" description: "Đăng bài vào 0 phút 0 giây" @@ -1221,6 +1270,8 @@ _achievements: _setNameToSyuilo: title: "Ngưỡng mộ với vị thần" description: "Đạt tên là syuilo" + _passedSinceAccountCreated1: + title: "Kỷ niệm một năm" _loggedInOnBirthday: title: "Sinh nhật vủi vẻ" description: "Đăng nhập vào ngày sinh" @@ -1546,7 +1597,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "Bạn đã đăng ký thiết bị xác minh 2 bước." registerTOTP: "Đăng ký ứng dụng xác thực" - passwordToTOTP: "Nhắn mật mã" step1: "Trước tiên, hãy cài đặt một ứng dụng xác minh (chẳng hạn như {a} hoặc {b}) trên thiết bị của bạn." step2: "Sau đó, quét mã QR hiển thị trên màn hình này." step2Click: "Quét mã QR trên ứng dụng xác thực (Authy, Google authenticator, v.v.)" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 75deb9cc89..d1128cd2a8 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1127,6 +1127,9 @@ loadReplies: "查看回复" loadConversation: "查看对话" pinnedList: "已置顶的列表" keepScreenOn: "保持设备屏幕开启" +verifiedLink: "已验证的链接" +notifyNotes: "打开发帖通知" +unnotifyNotes: "关闭发帖通知" _announcement: forExistingUsers: "仅限现有用户" forExistingUsersDescription: "若启用,该公告将仅对创建此公告时存在的用户可见。 如果禁用,则在创建此公告后注册的用户也可以看到该公告。" @@ -1793,7 +1796,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "此设备已被注册" registerTOTP: "开始设置认证应用" - passwordToTOTP: "请输入您的密码" step1: "首先,在您的设备上安装验证应用,例如 {a} 或 {b}。" step2: "然后,扫描屏幕上显示的二维码。" step2Click: "通过点击二维码,您可以使用设备上安装的身份验证器应用程序或密钥环进行注册" @@ -1972,6 +1974,7 @@ _profile: metadataContent: "内容" changeAvatar: "修改头像" changeBanner: "修改横幅" + verifiedLinkDescription: "如果将内容设置为 URL,当链接所指向的网页内包含自己的个人资料链接时,可以显示一个已验证图标。" _exportOrImport: allNotes: "所有帖子" favoritedNotes: "收藏的帖子" @@ -2094,6 +2097,7 @@ _notification: yourFollowRequestAccepted: "您的关注请求已通过" youWereInvitedToGroup: "您有新的群组邀请" pollEnded: "问卷调查结果已生成。" + newNote: "新的帖子" unreadAntennaNote: "天线 {name}" emptyPushNotificationMessage: "推送通知已更新" achievementEarned: "获得成就" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 461c2a6ad8..baab998379 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -15,7 +15,7 @@ gotIt: "知道了" cancel: "取消" noThankYou: "現在不要" enterUsername: "輸入使用者名稱" -renotedBy: "{user} 轉傳了" +renotedBy: "{user} 轉發" noNotes: "無貼文" noNotifications: "沒有通知" instance: "伺服器" @@ -106,10 +106,10 @@ unfollow: "取消追隨" followRequestPending: "追隨許可待批准" enterEmoji: "輸入表情符號" renote: "轉發" -unrenote: "取消轉傳" -renoted: "轉傳成功" -cantRenote: "無法轉傳此貼文。" -cantReRenote: "無法轉傳之前已經轉傳過的內容。" +unrenote: "取消轉發" +renoted: "轉發成功" +cantRenote: "無法轉發此貼文。" +cantReRenote: "無法轉發之前已經轉發過的內容。" quote: "引用" inChannelRenote: "在頻道內轉發" inChannelQuote: "在頻道內引用" @@ -558,7 +558,7 @@ recentUsed: "最近使用" install: "安裝" uninstall: "解除安裝" installedApps: "已授權的應用程式" -nothing: "無" +nothing: "查無項目" installedDate: "安裝時間" lastUsedDate: "最後上線日期" state: "狀態" @@ -669,7 +669,7 @@ behavior: "行為" sample: "範例" abuseReports: "檢舉" reportAbuse: "檢舉" -reportAbuseRenote: "檢舉轉貼" +reportAbuseRenote: "檢舉轉發貼文" reportAbuseOf: "檢舉{name}" fillAbuseReportDescription: "請填寫檢舉的詳細理由。如有需要,請附上相關 URL。" abuseReported: "檢舉完成。感謝您的報告。" @@ -1126,6 +1126,10 @@ renotes: "轉發" loadReplies: "閱覽回覆" loadConversation: "閱覽對話" pinnedList: "已置頂的清單" +keepScreenOn: "保持設備螢幕開啟" +verifiedLink: "已驗證連結" +notifyNotes: "開啟貼文通知" +unnotifyNotes: "關閉貼文通知" _announcement: forExistingUsers: "僅限既有的使用者" forExistingUsersDescription: "啟用代表僅向現存使用者顯示;停用代表張貼後註冊的新使用者也會看到。" @@ -1767,7 +1771,7 @@ _ago: future: "未來" justNow: "剛剛" secondsAgo: "{n} 秒前" - minutesAgo: "{n}分鐘前 " + minutesAgo: "{n} 分鐘前 " hoursAgo: "{n} 小時前" daysAgo: "{n} 天前" weeksAgo: "{n} 週前" @@ -1792,7 +1796,6 @@ _timelineTutorial: _2fa: alreadyRegistered: "此裝置已被註冊過了" registerTOTP: "開始設定驗證應用程式" - passwordToTOTP: "請輸入密碼" step1: "首先,在您的裝置上安裝驗證程式,例如 {a} 或 {b}。" step2: "然後,掃描螢幕上的 QR 碼。" step2Click: "您可以點擊 QR 碼,以使用裝置上的驗證應用程式或金鑰環註冊。" @@ -1971,6 +1974,7 @@ _profile: metadataContent: "内容" changeAvatar: "更換大頭貼" changeBanner: "變更橫幅圖像" + verifiedLinkDescription: "如果輸入包含您個人資料的網站 URL,欄位旁邊將出現驗證圖示。" _exportOrImport: allNotes: "所有貼文" favoritedNotes: "「我的最愛」貼文" @@ -2093,6 +2097,7 @@ _notification: yourFollowRequestAccepted: "您的追隨請求已通過" youWereInvitedToGroup: "您有新的群組邀請" pollEnded: "問卷調查已產生結果" + newNote: "新的貼文" unreadAntennaNote: "天線 {name}" emptyPushNotificationMessage: "推送通知已更新" achievementEarned: "獲得成就" diff --git a/package.json b/package.json index 82d66cb036..19a3266256 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cherrypick", - "version": "2023.9.0-beta.10-cp-4.3.0-beta.6", + "version": "2023.9.0-beta.11-cp-4.3.0-beta.6", "codename": "nasubi", "repository": { "type": "git", @@ -58,7 +58,7 @@ "cross-env": "7.0.3", "cypress": "13.2.0", "eslint": "8.49.0", - "start-server-and-test": "2.0.0" + "start-server-and-test": "2.0.1" }, "optionalDependencies": { "@tensorflow/tfjs-core": "4.4.0" diff --git a/packages/backend/migration/1689325027964-UserBlacklistAnntena.js b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js new file mode 100644 index 0000000000..ce246b20f8 --- /dev/null +++ b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js @@ -0,0 +1,10 @@ +export class UserBlacklistAnntena1689325027964 { + name = 'UserBlacklistAnntena1689325027964' + + async up(queryRunner) { + await queryRunner.query(`ALTER TYPE "antenna_src_enum" ADD VALUE 'users_blacklist' AFTER 'list'`); + } + + async down(queryRunner) { + } +} diff --git a/packages/backend/package.json b/packages/backend/package.json index a7d81efc0c..4c3931ef37 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -80,7 +80,7 @@ "@simplewebauthn/server": "8.1.1", "@sinonjs/fake-timers": "11.1.0", "@swc/cli": "0.1.62", - "@swc/core": "1.3.86", + "@swc/core": "1.3.87", "@vitalets/google-translate-api": "9.2.0", "accepts": "1.3.8", "ajv": "8.12.0", @@ -89,7 +89,7 @@ "bcryptjs": "2.4.3", "blurhash": "2.0.5", "body-parser": "1.20.2", - "bullmq": "4.11.2", + "bullmq": "4.11.3", "cacheable-lookup": "7.0.0", "cbor": "9.0.1", "chalk": "5.3.0", diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index b2fc81e859..229ba5a80b 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -130,6 +130,12 @@ export class AntennaService implements OnApplicationShutdown { return this.utilityService.getFullApAccount(username, host).toLowerCase(); }); if (!accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; + } else if (antenna.src === 'users_blacklist') { + const accts = antenna.users.map(x => { + const { username, host } = Acct.parse(x); + return this.utilityService.getFullApAccount(username, host).toLowerCase(); + }); + if (accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; } const keywords = antenna.keywords diff --git a/packages/backend/src/core/CoreModule.ts b/packages/backend/src/core/CoreModule.ts index b50d3fcd7c..2800677883 100644 --- a/packages/backend/src/core/CoreModule.ts +++ b/packages/backend/src/core/CoreModule.ts @@ -52,6 +52,7 @@ import { UserKeypairService } from './UserKeypairService.js'; import { UserListService } from './UserListService.js'; import { UserMutingService } from './UserMutingService.js'; import { UserSuspendService } from './UserSuspendService.js'; +import { UserAuthService } from './UserAuthService.js'; import { VideoProcessingService } from './VideoProcessingService.js'; import { WebhookService } from './WebhookService.js'; import { ProxyAccountService } from './ProxyAccountService.js'; @@ -183,6 +184,7 @@ const $UserKeypairService: Provider = { provide: 'UserKeypairService', useExisti const $UserListService: Provider = { provide: 'UserListService', useExisting: UserListService }; const $UserMutingService: Provider = { provide: 'UserMutingService', useExisting: UserMutingService }; const $UserSuspendService: Provider = { provide: 'UserSuspendService', useExisting: UserSuspendService }; +const $UserAuthService: Provider = { provide: 'UserAuthService', useExisting: UserAuthService }; const $VideoProcessingService: Provider = { provide: 'VideoProcessingService', useExisting: VideoProcessingService }; const $WebhookService: Provider = { provide: 'WebhookService', useExisting: WebhookService }; const $UtilityService: Provider = { provide: 'UtilityService', useExisting: UtilityService }; @@ -317,6 +319,7 @@ const $ApEventService: Provider = { provide: 'ApEventService', useExisting: ApEv UserListService, UserMutingService, UserSuspendService, + UserAuthService, VideoProcessingService, WebhookService, UtilityService, @@ -444,6 +447,7 @@ const $ApEventService: Provider = { provide: 'ApEventService', useExisting: ApEv $UserListService, $UserMutingService, $UserSuspendService, + $UserAuthService, $VideoProcessingService, $WebhookService, $UtilityService, @@ -572,6 +576,7 @@ const $ApEventService: Provider = { provide: 'ApEventService', useExisting: ApEv UserListService, UserMutingService, UserSuspendService, + UserAuthService, VideoProcessingService, WebhookService, UtilityService, @@ -698,6 +703,7 @@ const $ApEventService: Provider = { provide: 'ApEventService', useExisting: ApEv $UserListService, $UserMutingService, $UserSuspendService, + $UserAuthService, $VideoProcessingService, $WebhookService, $UtilityService, diff --git a/packages/backend/src/core/UserAuthService.ts b/packages/backend/src/core/UserAuthService.ts new file mode 100644 index 0000000000..54575e3c1d --- /dev/null +++ b/packages/backend/src/core/UserAuthService.ts @@ -0,0 +1,45 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey, cherrypick contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Inject, Injectable } from '@nestjs/common'; +import { QueryFailedError } from 'typeorm'; +import * as OTPAuth from 'otpauth'; +import { DI } from '@/di-symbols.js'; +import type { MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js'; +import { bindThis } from '@/decorators.js'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import type { MiLocalUser } from '@/models/User.js'; + +@Injectable() +export class UserAuthService { + constructor( + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + + @Inject(DI.userProfilesRepository) + private userProfilesRepository: UserProfilesRepository, + ) { + } + + @bindThis + public async twoFactorAuthenticate(profile: MiUserProfile, token: string): Promise { + if (profile.twoFactorBackupSecret?.includes(token)) { + await this.userProfilesRepository.update({ userId: profile.userId }, { + twoFactorBackupSecret: profile.twoFactorBackupSecret.filter((secret) => secret !== token), + }); + } else { + const delta = OTPAuth.TOTP.validate({ + secret: OTPAuth.Secret.fromBase32(profile.twoFactorSecret!), + digits: 6, + token, + window: 5, + }); + + if (delta === null) { + throw new Error('authentication failed'); + } + } + } +} diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts index 2f147d5cce..d63669fa42 100644 --- a/packages/backend/src/core/activitypub/ApResolverService.ts +++ b/packages/backend/src/core/activitypub/ApResolverService.ts @@ -4,9 +4,10 @@ */ import { Inject, Injectable } from '@nestjs/common'; +import { IsNull, Not } from 'typeorm'; import type { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { InstanceActorService } from '@/core/InstanceActorService.js'; -import type { NotesRepository, PollsRepository, NoteReactionsRepository, UsersRepository } from '@/models/_.js'; +import type { NotesRepository, PollsRepository, NoteReactionsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { MetaService } from '@/core/MetaService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; @@ -32,6 +33,7 @@ export class Resolver { private notesRepository: NotesRepository, private pollsRepository: PollsRepository, private noteReactionsRepository: NoteReactionsRepository, + private followRequestsRepository: FollowRequestsRepository, private utilityService: UtilityService, private instanceActorService: InstanceActorService, private metaService: MetaService, @@ -146,13 +148,24 @@ export class Resolver { return this.noteReactionsRepository.findOneByOrFail({ id: parsed.id }).then(async reaction => this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, { uri: null }))); case 'follows': - // rest should be - if (parsed.rest == null || !/^\w+$/.test(parsed.rest)) throw new Error('resolveLocal: invalid follow URI'); - - return Promise.all( - [parsed.id, parsed.rest].map(id => this.usersRepository.findOneByOrFail({ id })), - ) - .then(([follower, followee]) => this.apRendererService.addContext(this.apRendererService.renderFollow(follower as MiLocalUser | MiRemoteUser, followee as MiLocalUser | MiRemoteUser, url))); + return this.followRequestsRepository.findOneBy({ id: parsed.id }) + .then(async followRequest => { + if (followRequest == null) throw new Error('resolveLocal: invalid follow request ID'); + const [follower, followee] = await Promise.all([ + this.usersRepository.findOneBy({ + id: followRequest.followerId, + host: IsNull(), + }), + this.usersRepository.findOneBy({ + id: followRequest.followeeId, + host: Not(IsNull()), + }), + ]); + if (follower == null || followee == null) { + throw new Error('resolveLocal: follower or followee does not exist'); + } + return this.apRendererService.addContext(this.apRendererService.renderFollow(follower as MiLocalUser | MiRemoteUser, followee as MiLocalUser | MiRemoteUser, url)); + }); default: throw new Error(`resolveLocal: type ${parsed.type} unhandled`); } @@ -177,6 +190,9 @@ export class ApResolverService { @Inject(DI.noteReactionsRepository) private noteReactionsRepository: NoteReactionsRepository, + @Inject(DI.followRequestsRepository) + private followRequestsRepository: FollowRequestsRepository, + private utilityService: UtilityService, private instanceActorService: InstanceActorService, private metaService: MetaService, @@ -196,6 +212,7 @@ export class ApResolverService { this.notesRepository, this.pollsRepository, this.noteReactionsRepository, + this.followRequestsRepository, this.utilityService, this.instanceActorService, this.metaService, diff --git a/packages/backend/src/models/Antenna.ts b/packages/backend/src/models/Antenna.ts index 16b467b9a4..3cc088a494 100644 --- a/packages/backend/src/models/Antenna.ts +++ b/packages/backend/src/models/Antenna.ts @@ -42,8 +42,8 @@ export class MiAntenna { }) public name: string; - @Column('enum', { enum: ['home', 'all', 'users', 'list', 'group'] }) - public src: 'home' | 'all' | 'users' | 'list' | 'group'; + @Column('enum', { enum: ['home', 'all', 'users', 'list', 'group', 'users_blacklist'] }) + public src: 'home' | 'all' | 'users' | 'list' | 'group' | 'users_blacklist'; @Column({ ...id(), diff --git a/packages/backend/src/models/json-schema/antenna.ts b/packages/backend/src/models/json-schema/antenna.ts index cdf5e647d2..7b96369ace 100644 --- a/packages/backend/src/models/json-schema/antenna.ts +++ b/packages/backend/src/models/json-schema/antenna.ts @@ -47,7 +47,7 @@ export const packedAntennaSchema = { src: { type: 'string', optional: false, nullable: false, - enum: ['home', 'all', 'users', 'list', 'group'], + enum: ['home', 'all', 'users', 'list', 'group', 'users_blacklist'], }, userListId: { type: 'string', diff --git a/packages/backend/src/server/api/SigninApiService.ts b/packages/backend/src/server/api/SigninApiService.ts index 09bf81759a..9b721a2a0b 100644 --- a/packages/backend/src/server/api/SigninApiService.ts +++ b/packages/backend/src/server/api/SigninApiService.ts @@ -19,6 +19,7 @@ import type { MiLocalUser } from '@/models/User.js'; import { IdService } from '@/core/IdService.js'; import { bindThis } from '@/decorators.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; import { RateLimiterService } from './RateLimiterService.js'; import { SigninService } from './SigninService.js'; import type { AuthenticationResponseJSON } from '@simplewebauthn/typescript-types'; @@ -42,6 +43,7 @@ export class SigninApiService { private idService: IdService, private rateLimiterService: RateLimiterService, private signinService: SigninService, + private userAuthService: UserAuthService, private webAuthnService: WebAuthnService, ) { } @@ -124,7 +126,7 @@ export class SigninApiService { const same = await bcrypt.compare(password, profile.password!); const fail = async (status?: number, failure?: { id: string }) => { - // Append signin history + // Append signin history await this.signinsRepository.insert({ id: this.idService.genId(), createdAt: new Date(), @@ -154,27 +156,15 @@ export class SigninApiService { }); } - if (profile.twoFactorBackupSecret?.includes(token)) { - await this.userProfilesRepository.update({ userId: profile.userId }, { - twoFactorBackupSecret: profile.twoFactorBackupSecret.filter((secret) => secret !== token), - }); - return this.signinService.signin(request, reply, user); - } - - const delta = OTPAuth.TOTP.validate({ - secret: OTPAuth.Secret.fromBase32(profile.twoFactorSecret!), - digits: 6, - token, - window: 1, - }); - - if (delta === null) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { return await fail(403, { id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', }); - } else { - return this.signinService.signin(request, reply, user); } + + return this.signinService.signin(request, reply, user); } else if (body.credential) { if (!same && !profile.usePasswordLessLogin) { return await fail(403, { @@ -203,6 +193,6 @@ export class SigninApiService { reply.code(200); return authRequest; } - // never get here + // never get here } } diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index d638730b23..91e43c1bb8 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -53,7 +53,7 @@ export const paramDef = { type: 'object', properties: { name: { type: 'string', minLength: 1, maxLength: 100 }, - src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'group'] }, + src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'group', 'users_blacklist'] }, userListId: { type: 'string', format: 'misskey:id', nullable: true }, userGroupId: { type: 'string', format: 'misskey:id', nullable: true }, keywords: { type: 'array', items: { diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index c3aa59cdf5..871584c196 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -52,7 +52,7 @@ export const paramDef = { properties: { antennaId: { type: 'string', format: 'misskey:id' }, name: { type: 'string', minLength: 1, maxLength: 100 }, - src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'group'] }, + src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'group', 'users_blacklist'] }, userListId: { type: 'string', format: 'misskey:id', nullable: true }, userGroupId: { type: 'string', format: 'misskey:id', nullable: true }, keywords: { type: 'array', items: { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts index d60b918bfb..543a2c93ce 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -47,7 +47,7 @@ export default class extends Endpoint { // eslint- secret: OTPAuth.Secret.fromBase32(profile.twoFactorTempSecret), digits: 6, token, - window: 1, + window: 5, }); if (delta === null) { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index c0788d4a48..421c1e14b6 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -12,6 +12,7 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/_.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -37,6 +38,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, name: { type: 'string', minLength: 1, maxLength: 30 }, credential: { type: 'object' }, }, @@ -54,16 +56,28 @@ export default class extends Endpoint { private userSecurityKeysRepository: UserSecurityKeysRepository, private webAuthnService: WebAuthnService, + private userAuthService: UserAuthService, private userEntityService: UserEntityService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index 3dcbd1a0ad..8218b7b09a 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -10,6 +10,7 @@ import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -41,6 +42,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -53,8 +55,10 @@ export default class extends Endpoint { private userProfilesRepository: UserProfilesRepository, private webAuthnService: WebAuthnService, + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOne({ where: { userId: me.id, @@ -66,10 +70,20 @@ export default class extends Endpoint { throw new ApiError(meta.errors.userNotFound); } - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register.ts b/packages/backend/src/server/api/endpoints/i/2fa/register.ts index c11999ccb5..bb3f3591b9 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -12,6 +12,7 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -31,6 +32,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -43,14 +45,27 @@ export default class extends Endpoint { // eslint- @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index 55d3dfe01a..caf62f169f 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -11,6 +11,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -30,6 +31,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, credentialId: { type: 'string' }, }, required: ['password', 'credentialId'], @@ -45,15 +47,27 @@ export default class extends Endpoint { // eslint- private userProfilesRepository: UserProfilesRepository, private userEntityService: UserEntityService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts index 9e13f1a0c1..032c316de1 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -11,6 +11,7 @@ import type { UserProfilesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -30,6 +31,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -41,15 +43,27 @@ export default class extends Endpoint { // eslint- private userProfilesRepository: UserProfilesRepository, private userEntityService: UserEntityService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/change-password.ts b/packages/backend/src/server/api/endpoints/i/change-password.ts index ae9261cf34..61afae98bc 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -8,6 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -20,6 +21,7 @@ export const paramDef = { properties: { currentPassword: { type: 'string' }, newPassword: { type: 'string', minLength: 1 }, + token: { type: 'string', nullable: true }, }, required: ['currentPassword', 'newPassword'], } as const; @@ -29,14 +31,28 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.currentPassword, profile.password!); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.currentPassword, profile.password!); + + if (!passwordMatched) { throw new Error('incorrect password'); } diff --git a/packages/backend/src/server/api/endpoints/i/delete-account.ts b/packages/backend/src/server/api/endpoints/i/delete-account.ts index 917a59fc49..e5f5e04112 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -9,6 +9,7 @@ import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DeleteAccountService } from '@/core/DeleteAccountService.js'; import { DI } from '@/di-symbols.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -20,6 +21,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -33,19 +35,32 @@ export default class extends Endpoint { // eslint- @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + private userAuthService: UserAuthService, private deleteAccountService: DeleteAccountService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); + + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } + + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + const userDetailed = await this.usersRepository.findOneByOrFail({ id: me.id }); if (userDetailed.isDeleted) { return; } - // Compare password - const same = await bcrypt.compare(ps.password, profile.password!); - - if (!same) { + const passwordMatched = await bcrypt.compare(ps.password, profile.password!); + if (!passwordMatched) { throw new Error('incorrect password'); } diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index 74e327f8f1..22e0447f6b 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -14,6 +14,7 @@ import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { L_CHARS, secureRndstr } from '@/misc/secure-rndstr.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -46,6 +47,7 @@ export const paramDef = { properties: { password: { type: 'string' }, email: { type: 'string', nullable: true }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -61,15 +63,27 @@ export default class extends Endpoint { // eslint- private userEntityService: UserEntityService, private emailService: EmailService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password!); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password!); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/test/e2e/2fa.ts b/packages/backend/test/e2e/2fa.ts index e06cf4c8ad..eee6757495 100644 --- a/packages/backend/test/e2e/2fa.ts +++ b/packages/backend/test/e2e/2fa.ts @@ -60,10 +60,12 @@ describe('2要素認証', () => { }; const keyDoneParam = (param: { + token: string, keyName: string, credentialId: Buffer, creationOptions: PublicKeyCredentialCreationOptionsJSON, }): { + token: string, password: string, name: string, credential: RegistrationResponseJSON, @@ -94,6 +96,7 @@ describe('2要素認証', () => { return { password, + token: param.token, name: param.keyName, credential: { id: param.credentialId.toString('base64url'), @@ -218,6 +221,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、セキュリティキーでログインできる。', async () => { @@ -233,6 +242,7 @@ describe('2要素認証', () => { const registerKeyResponse = await api('/i/2fa/register-key', { password, + token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(registerKeyResponse.status, 200); assert.notEqual(registerKeyResponse.body.rp, undefined); @@ -241,6 +251,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -271,6 +282,12 @@ describe('2要素認証', () => { })); assert.strictEqual(signinResponse2.status, 200); assert.notEqual(signinResponse2.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、セキュリティキーでパスワードレスログインできる。', async () => { @@ -285,6 +302,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -292,6 +310,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -326,6 +345,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse2.status, 200); assert.notEqual(signinResponse2.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定したセキュリティキーの名前を変更できる。', async () => { @@ -340,6 +365,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -347,6 +373,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -367,6 +394,12 @@ describe('2要素認証', () => { assert.strictEqual(securityKeys.length, 1); assert.strictEqual(securityKeys[0].name, renamedKey); assert.notEqual(securityKeys[0].lastUsed, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定したセキュリティキーを削除できる。', async () => { @@ -381,6 +414,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -388,6 +422,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -400,6 +435,7 @@ describe('2要素認証', () => { assert.strictEqual(iResponse.status, 200); for (const key of iResponse.body.securityKeysList) { const removeKeyResponse = await api('/i/2fa/remove-key', { + token: otpToken(registerResponse.body.secret), password, credentialId: key.id, }, alice); @@ -418,6 +454,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定解除できる。(パスワードのみでログインできる。)', async () => { @@ -438,6 +480,7 @@ describe('2要素認証', () => { assert.strictEqual(usersShowResponse.body.twoFactorEnabled, true); const unregisterResponse = await api('/i/2fa/unregister', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(unregisterResponse.status, 204); @@ -447,5 +490,11 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); }); diff --git a/packages/backend/test/misc/mock-resolver.ts b/packages/backend/test/misc/mock-resolver.ts index d779670189..0ff4c29bc9 100644 --- a/packages/backend/test/misc/mock-resolver.ts +++ b/packages/backend/test/misc/mock-resolver.ts @@ -15,7 +15,7 @@ import type { LoggerService } from '@/core/LoggerService.js'; import type { MetaService } from '@/core/MetaService.js'; import type { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; -import type { NoteReactionsRepository, NotesRepository, PollsRepository, UsersRepository } from '@/models/_.js'; +import type { NoteReactionsRepository, NotesRepository, PollsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; type MockResponse = { type: string; @@ -33,6 +33,7 @@ export class MockResolver extends Resolver { {} as NotesRepository, {} as PollsRepository, {} as NoteReactionsRepository, + {} as FollowRequestsRepository, {} as UtilityService, {} as InstanceActorService, {} as MetaService, diff --git a/packages/cherrypick-js/package.json b/packages/cherrypick-js/package.json index 57340e0a50..717c28bd21 100644 --- a/packages/cherrypick-js/package.json +++ b/packages/cherrypick-js/package.json @@ -39,7 +39,7 @@ ], "dependencies": { "@swc/cli": "0.1.62", - "@swc/core": "1.3.86", + "@swc/core": "1.3.87", "eventemitter3": "5.0.1", "reconnecting-websocket": "4.4.0" } diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 4bd092a18a..9325ddc51c 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -116,7 +116,7 @@ "@types/ws": "8.5.5", "@typescript-eslint/eslint-plugin": "6.7.2", "@typescript-eslint/parser": "6.7.2", - "@vitest/coverage-v8": "0.34.4", + "@vitest/coverage-v8": "0.34.5", "@vue/runtime-core": "3.3.4", "acorn": "8.10.0", "cross-env": "7.0.3", @@ -134,14 +134,14 @@ "prettier": "3.0.3", "react": "18.2.0", "react-dom": "18.2.0", - "start-server-and-test": "2.0.0", - "storybook": "7.4.2", + "start-server-and-test": "2.0.1", + "storybook": "7.4.3", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", "summaly": "github:misskey-dev/summaly", "vite-plugin-turbosnap": "1.0.3", - "vitest": "0.34.4", + "vitest": "0.34.5", "vitest-fetch-mock": "0.2.2", "vue-eslint-parser": "9.3.1", - "vue-tsc": "1.8.11" + "vue-tsc": "1.8.13" } } diff --git a/packages/frontend/src/components/MkInput.vue b/packages/frontend/src/components/MkInput.vue index 2674a2ac09..5b1a88c6e6 100644 --- a/packages/frontend/src/components/MkInput.vue +++ b/packages/frontend/src/components/MkInput.vue @@ -161,6 +161,10 @@ onMounted(() => { } }); }); + +defineExpose({ + focus, +});