From 27e6714827e60c0e0b6fd957f4019725452f2ddf Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 3 Mar 2024 16:51:39 -0800 Subject: [PATCH] Create requireCredentialSecureMode `requireCredentialSecureMode` is a replacement for `requireCredential` as a three-valued enum. Keeping `requireCredential` as a boolean makes future merges easier, and whether the endpoint should be allowed in secure mode is determined by `requireCredentialSecureMode`. This implies that `requireCredential: true, requireCredentialSecureMode: false` is an invalid value. --- packages/backend/src/server/api/ApiCallService.ts | 3 +-- packages/backend/src/server/api/endpoint-base.ts | 6 +++--- packages/backend/src/server/api/endpoints.ts | 13 +++++++++---- .../api/endpoints/admin/abuse-user-reports.ts | 3 ++- .../server/api/endpoints/admin/accounts/create.ts | 3 ++- .../server/api/endpoints/admin/accounts/delete.ts | 3 ++- .../api/endpoints/admin/accounts/find-by-email.ts | 3 ++- .../src/server/api/endpoints/admin/ad/create.ts | 3 ++- .../src/server/api/endpoints/admin/ad/delete.ts | 3 ++- .../src/server/api/endpoints/admin/ad/list.ts | 3 ++- .../src/server/api/endpoints/admin/ad/update.ts | 3 ++- .../api/endpoints/admin/announcements/create.ts | 3 ++- .../api/endpoints/admin/announcements/delete.ts | 3 ++- .../api/endpoints/admin/announcements/list.ts | 3 ++- .../api/endpoints/admin/announcements/update.ts | 3 ++- .../src/server/api/endpoints/admin/approve-user.ts | 3 ++- .../endpoints/admin/avatar-decorations/create.ts | 3 ++- .../endpoints/admin/avatar-decorations/delete.ts | 3 ++- .../api/endpoints/admin/avatar-decorations/list.ts | 3 ++- .../endpoints/admin/avatar-decorations/update.ts | 3 ++- .../server/api/endpoints/admin/delete-account.ts | 3 ++- .../endpoints/admin/delete-all-files-of-a-user.ts | 3 ++- .../api/endpoints/admin/drive/clean-remote-files.ts | 3 ++- .../src/server/api/endpoints/admin/drive/cleanup.ts | 3 ++- .../src/server/api/endpoints/admin/drive/files.ts | 3 ++- .../server/api/endpoints/admin/drive/show-file.ts | 3 ++- .../api/endpoints/admin/emoji/add-aliases-bulk.ts | 3 ++- .../src/server/api/endpoints/admin/emoji/add.ts | 3 ++- .../src/server/api/endpoints/admin/emoji/copy.ts | 3 ++- .../server/api/endpoints/admin/emoji/delete-bulk.ts | 3 ++- .../src/server/api/endpoints/admin/emoji/delete.ts | 3 ++- .../server/api/endpoints/admin/emoji/import-zip.ts | 3 ++- .../server/api/endpoints/admin/emoji/list-remote.ts | 3 ++- .../src/server/api/endpoints/admin/emoji/list.ts | 3 ++- .../endpoints/admin/emoji/remove-aliases-bulk.ts | 3 ++- .../api/endpoints/admin/emoji/set-aliases-bulk.ts | 3 ++- .../api/endpoints/admin/emoji/set-category-bulk.ts | 3 ++- .../api/endpoints/admin/emoji/set-license-bulk.ts | 3 ++- .../src/server/api/endpoints/admin/emoji/update.ts | 3 ++- .../endpoints/admin/federation/delete-all-files.ts | 3 ++- .../federation/refresh-remote-instance-metadata.ts | 3 ++- .../admin/federation/remove-all-following.ts | 3 ++- .../endpoints/admin/federation/update-instance.ts | 3 ++- .../server/api/endpoints/admin/get-index-stats.ts | 3 ++- .../server/api/endpoints/admin/get-table-stats.ts | 3 ++- .../src/server/api/endpoints/admin/get-user-ips.ts | 3 ++- .../src/server/api/endpoints/admin/invite/create.ts | 3 ++- .../src/server/api/endpoints/admin/invite/list.ts | 3 ++- .../backend/src/server/api/endpoints/admin/meta.ts | 3 ++- .../src/server/api/endpoints/admin/nsfw-user.ts | 3 ++- .../src/server/api/endpoints/admin/promo/create.ts | 3 ++- .../src/server/api/endpoints/admin/queue/clear.ts | 3 ++- .../api/endpoints/admin/queue/deliver-delayed.ts | 3 ++- .../api/endpoints/admin/queue/inbox-delayed.ts | 3 ++- .../src/server/api/endpoints/admin/queue/promote.ts | 3 ++- .../src/server/api/endpoints/admin/queue/stats.ts | 3 ++- .../src/server/api/endpoints/admin/relays/add.ts | 3 ++- .../src/server/api/endpoints/admin/relays/list.ts | 3 ++- .../src/server/api/endpoints/admin/relays/remove.ts | 3 ++- .../server/api/endpoints/admin/reset-password.ts | 3 ++- .../endpoints/admin/resolve-abuse-user-report.ts | 3 ++- .../src/server/api/endpoints/admin/roles/assign.ts | 3 ++- .../src/server/api/endpoints/admin/roles/create.ts | 3 ++- .../src/server/api/endpoints/admin/roles/delete.ts | 3 ++- .../src/server/api/endpoints/admin/roles/list.ts | 3 ++- .../src/server/api/endpoints/admin/roles/show.ts | 3 ++- .../server/api/endpoints/admin/roles/unassign.ts | 3 ++- .../admin/roles/update-default-policies.ts | 3 ++- .../src/server/api/endpoints/admin/roles/update.ts | 3 ++- .../src/server/api/endpoints/admin/roles/users.ts | 3 ++- .../src/server/api/endpoints/admin/send-email.ts | 3 ++- .../src/server/api/endpoints/admin/server-info.ts | 3 ++- .../api/endpoints/admin/show-moderation-logs.ts | 3 ++- .../src/server/api/endpoints/admin/show-user.ts | 3 ++- .../src/server/api/endpoints/admin/show-users.ts | 3 ++- .../src/server/api/endpoints/admin/silence-user.ts | 3 ++- .../src/server/api/endpoints/admin/suspend-user.ts | 3 ++- .../src/server/api/endpoints/admin/unnsfw-user.ts | 3 ++- .../server/api/endpoints/admin/unset-user-avatar.ts | 3 ++- .../server/api/endpoints/admin/unset-user-banner.ts | 3 ++- .../server/api/endpoints/admin/unsilence-user.ts | 3 ++- .../server/api/endpoints/admin/unsuspend-user.ts | 3 ++- .../src/server/api/endpoints/admin/update-meta.ts | 3 ++- .../server/api/endpoints/admin/update-user-note.ts | 3 ++- .../src/server/api/endpoints/announcements.ts | 3 ++- .../src/server/api/endpoints/antennas/create.ts | 3 ++- .../src/server/api/endpoints/antennas/delete.ts | 3 ++- .../src/server/api/endpoints/antennas/list.ts | 3 ++- .../src/server/api/endpoints/antennas/notes.ts | 3 ++- .../src/server/api/endpoints/antennas/show.ts | 3 ++- .../src/server/api/endpoints/antennas/update.ts | 3 ++- packages/backend/src/server/api/endpoints/ap/get.ts | 3 ++- .../backend/src/server/api/endpoints/ap/show.ts | 3 ++- .../backend/src/server/api/endpoints/app/create.ts | 3 ++- .../backend/src/server/api/endpoints/app/show.ts | 3 ++- .../backend/src/server/api/endpoints/auth/accept.ts | 3 ++- .../server/api/endpoints/auth/session/generate.ts | 3 ++- .../src/server/api/endpoints/auth/session/show.ts | 3 ++- .../server/api/endpoints/auth/session/userkey.ts | 3 ++- .../src/server/api/endpoints/blocking/create.ts | 3 ++- .../src/server/api/endpoints/blocking/delete.ts | 3 ++- .../src/server/api/endpoints/blocking/list.ts | 3 ++- .../src/server/api/endpoints/bubble-game/ranking.ts | 3 +++ .../server/api/endpoints/bubble-game/register.ts | 1 + .../src/server/api/endpoints/channels/create.ts | 3 ++- .../src/server/api/endpoints/channels/favorite.ts | 3 ++- .../src/server/api/endpoints/channels/featured.ts | 3 ++- .../src/server/api/endpoints/channels/follow.ts | 3 ++- .../src/server/api/endpoints/channels/followed.ts | 3 ++- .../server/api/endpoints/channels/my-favorites.ts | 3 ++- .../src/server/api/endpoints/channels/owned.ts | 3 ++- .../src/server/api/endpoints/channels/search.ts | 3 ++- .../src/server/api/endpoints/channels/show.ts | 3 ++- .../src/server/api/endpoints/channels/timeline.ts | 3 ++- .../src/server/api/endpoints/channels/unfavorite.ts | 3 ++- .../src/server/api/endpoints/channels/unfollow.ts | 3 ++- .../src/server/api/endpoints/channels/update.ts | 3 ++- .../src/server/api/endpoints/charts/active-users.ts | 3 ++- .../src/server/api/endpoints/charts/ap-request.ts | 3 ++- .../src/server/api/endpoints/charts/drive.ts | 3 ++- .../src/server/api/endpoints/charts/federation.ts | 3 ++- .../src/server/api/endpoints/charts/instance.ts | 3 ++- .../src/server/api/endpoints/charts/notes.ts | 3 ++- .../src/server/api/endpoints/charts/user/drive.ts | 3 ++- .../server/api/endpoints/charts/user/following.ts | 3 ++- .../src/server/api/endpoints/charts/user/notes.ts | 3 ++- .../src/server/api/endpoints/charts/user/pv.ts | 3 ++- .../server/api/endpoints/charts/user/reactions.ts | 3 ++- .../src/server/api/endpoints/charts/users.ts | 3 ++- .../src/server/api/endpoints/clips/add-note.ts | 3 ++- .../src/server/api/endpoints/clips/create.ts | 3 ++- .../src/server/api/endpoints/clips/delete.ts | 3 ++- .../src/server/api/endpoints/clips/favorite.ts | 3 ++- .../backend/src/server/api/endpoints/clips/list.ts | 3 ++- .../src/server/api/endpoints/clips/my-favorites.ts | 3 ++- .../backend/src/server/api/endpoints/clips/notes.ts | 3 ++- .../src/server/api/endpoints/clips/remove-note.ts | 3 ++- .../backend/src/server/api/endpoints/clips/show.ts | 3 ++- .../src/server/api/endpoints/clips/unfavorite.ts | 3 ++- .../src/server/api/endpoints/clips/update.ts | 3 ++- packages/backend/src/server/api/endpoints/drive.ts | 3 ++- .../backend/src/server/api/endpoints/drive/files.ts | 3 ++- .../api/endpoints/drive/files/attached-notes.ts | 3 ++- .../api/endpoints/drive/files/check-existence.ts | 3 ++- .../src/server/api/endpoints/drive/files/create.ts | 3 ++- .../src/server/api/endpoints/drive/files/delete.ts | 3 ++- .../api/endpoints/drive/files/find-by-hash.ts | 3 ++- .../src/server/api/endpoints/drive/files/find.ts | 3 ++- .../src/server/api/endpoints/drive/files/show.ts | 3 ++- .../src/server/api/endpoints/drive/files/update.ts | 3 ++- .../api/endpoints/drive/files/upload-from-url.ts | 3 ++- .../src/server/api/endpoints/drive/folders.ts | 3 ++- .../server/api/endpoints/drive/folders/create.ts | 3 ++- .../server/api/endpoints/drive/folders/delete.ts | 3 ++- .../src/server/api/endpoints/drive/folders/find.ts | 3 ++- .../src/server/api/endpoints/drive/folders/show.ts | 3 ++- .../server/api/endpoints/drive/folders/update.ts | 3 ++- .../src/server/api/endpoints/drive/stream.ts | 3 ++- .../server/api/endpoints/email-address/available.ts | 3 ++- packages/backend/src/server/api/endpoints/emoji.ts | 3 ++- packages/backend/src/server/api/endpoints/emojis.ts | 3 ++- .../backend/src/server/api/endpoints/endpoint.ts | 3 ++- .../backend/src/server/api/endpoints/endpoints.ts | 3 ++- .../server/api/endpoints/export-custom-emojis.ts | 3 ++- .../server/api/endpoints/federation/followers.ts | 3 ++- .../server/api/endpoints/federation/following.ts | 3 ++- .../server/api/endpoints/federation/instances.ts | 3 ++- .../api/endpoints/federation/show-instance.ts | 3 ++- .../src/server/api/endpoints/federation/stats.ts | 3 ++- .../api/endpoints/federation/update-remote-user.ts | 3 ++- .../src/server/api/endpoints/federation/users.ts | 3 ++- .../api/endpoints/fetch-external-resources.ts | 3 ++- .../backend/src/server/api/endpoints/fetch-rss.ts | 3 ++- .../src/server/api/endpoints/flash/create.ts | 3 ++- .../src/server/api/endpoints/flash/delete.ts | 3 ++- .../src/server/api/endpoints/flash/featured.ts | 3 ++- .../backend/src/server/api/endpoints/flash/like.ts | 3 ++- .../src/server/api/endpoints/flash/my-likes.ts | 3 ++- .../backend/src/server/api/endpoints/flash/my.ts | 3 ++- .../backend/src/server/api/endpoints/flash/show.ts | 3 ++- .../src/server/api/endpoints/flash/unlike.ts | 3 ++- .../src/server/api/endpoints/flash/update.ts | 3 ++- .../src/server/api/endpoints/following/create.ts | 3 ++- .../src/server/api/endpoints/following/delete.ts | 3 ++- .../server/api/endpoints/following/invalidate.ts | 3 ++- .../api/endpoints/following/requests/accept.ts | 3 ++- .../api/endpoints/following/requests/cancel.ts | 3 ++- .../server/api/endpoints/following/requests/list.ts | 3 ++- .../api/endpoints/following/requests/reject.ts | 3 ++- .../server/api/endpoints/following/update-all.ts | 3 ++- .../src/server/api/endpoints/following/update.ts | 3 ++- .../src/server/api/endpoints/gallery/featured.ts | 3 ++- .../src/server/api/endpoints/gallery/popular.ts | 3 ++- .../src/server/api/endpoints/gallery/posts.ts | 3 ++- .../server/api/endpoints/gallery/posts/create.ts | 3 ++- .../server/api/endpoints/gallery/posts/delete.ts | 3 ++- .../src/server/api/endpoints/gallery/posts/like.ts | 3 ++- .../src/server/api/endpoints/gallery/posts/show.ts | 3 ++- .../server/api/endpoints/gallery/posts/unlike.ts | 3 ++- .../server/api/endpoints/gallery/posts/update.ts | 3 ++- .../server/api/endpoints/get-avatar-decorations.ts | 3 ++- .../server/api/endpoints/get-online-users-count.ts | 3 ++- .../src/server/api/endpoints/hashtags/list.ts | 3 ++- .../src/server/api/endpoints/hashtags/search.ts | 3 ++- .../src/server/api/endpoints/hashtags/show.ts | 3 ++- .../src/server/api/endpoints/hashtags/trend.ts | 3 ++- .../src/server/api/endpoints/hashtags/users.ts | 3 ++- packages/backend/src/server/api/endpoints/i.ts | 3 ++- .../backend/src/server/api/endpoints/i/2fa/done.ts | 3 ++- .../src/server/api/endpoints/i/2fa/key-done.ts | 3 ++- .../src/server/api/endpoints/i/2fa/password-less.ts | 3 ++- .../src/server/api/endpoints/i/2fa/register-key.ts | 3 ++- .../src/server/api/endpoints/i/2fa/register.ts | 3 ++- .../src/server/api/endpoints/i/2fa/remove-key.ts | 3 ++- .../src/server/api/endpoints/i/2fa/unregister.ts | 3 ++- .../src/server/api/endpoints/i/2fa/update-key.ts | 3 ++- packages/backend/src/server/api/endpoints/i/apps.ts | 3 ++- .../src/server/api/endpoints/i/authorized-apps.ts | 3 ++- .../src/server/api/endpoints/i/change-password.ts | 3 ++- .../src/server/api/endpoints/i/claim-achievement.ts | 3 ++- .../src/server/api/endpoints/i/delete-account.ts | 3 ++- .../src/server/api/endpoints/i/export-antennas.ts | 3 ++- .../src/server/api/endpoints/i/export-blocking.ts | 3 ++- .../src/server/api/endpoints/i/export-clips.ts | 1 + .../src/server/api/endpoints/i/export-data.ts | 3 ++- .../src/server/api/endpoints/i/export-favorites.ts | 3 ++- .../src/server/api/endpoints/i/export-following.ts | 3 ++- .../src/server/api/endpoints/i/export-mute.ts | 3 ++- .../src/server/api/endpoints/i/export-notes.ts | 3 ++- .../src/server/api/endpoints/i/export-user-lists.ts | 3 ++- .../backend/src/server/api/endpoints/i/favorites.ts | 3 ++- .../src/server/api/endpoints/i/gallery/likes.ts | 3 ++- .../src/server/api/endpoints/i/gallery/posts.ts | 3 ++- .../src/server/api/endpoints/i/import-antennas.ts | 3 ++- .../src/server/api/endpoints/i/import-blocking.ts | 3 ++- .../src/server/api/endpoints/i/import-following.ts | 3 ++- .../src/server/api/endpoints/i/import-muting.ts | 3 ++- .../src/server/api/endpoints/i/import-notes.ts | 3 ++- .../src/server/api/endpoints/i/import-user-lists.ts | 3 ++- packages/backend/src/server/api/endpoints/i/move.ts | 3 ++- .../server/api/endpoints/i/notifications-grouped.ts | 3 ++- .../src/server/api/endpoints/i/notifications.ts | 3 ++- .../src/server/api/endpoints/i/page-likes.ts | 3 ++- .../backend/src/server/api/endpoints/i/pages.ts | 3 ++- packages/backend/src/server/api/endpoints/i/pin.ts | 3 ++- .../server/api/endpoints/i/read-all-unread-notes.ts | 3 ++- .../src/server/api/endpoints/i/read-announcement.ts | 3 ++- .../src/server/api/endpoints/i/regenerate-token.ts | 3 ++- .../src/server/api/endpoints/i/registry/get-all.ts | 3 ++- .../server/api/endpoints/i/registry/get-detail.ts | 3 ++- .../server/api/endpoints/i/registry/get-unsecure.ts | 3 ++- .../src/server/api/endpoints/i/registry/get.ts | 3 ++- .../api/endpoints/i/registry/keys-with-type.ts | 3 ++- .../src/server/api/endpoints/i/registry/keys.ts | 3 ++- .../src/server/api/endpoints/i/registry/remove.ts | 3 ++- .../api/endpoints/i/registry/scopes-with-domain.ts | 3 ++- .../src/server/api/endpoints/i/registry/set.ts | 3 ++- .../src/server/api/endpoints/i/revoke-token.ts | 3 ++- .../src/server/api/endpoints/i/signin-history.ts | 3 ++- .../backend/src/server/api/endpoints/i/unpin.ts | 3 ++- .../src/server/api/endpoints/i/update-email.ts | 3 ++- .../backend/src/server/api/endpoints/i/update.ts | 3 ++- .../src/server/api/endpoints/i/webhooks/create.ts | 3 ++- .../src/server/api/endpoints/i/webhooks/delete.ts | 3 ++- .../src/server/api/endpoints/i/webhooks/list.ts | 3 ++- .../src/server/api/endpoints/i/webhooks/show.ts | 3 ++- .../src/server/api/endpoints/i/webhooks/update.ts | 3 ++- .../src/server/api/endpoints/invite/create.ts | 3 ++- .../src/server/api/endpoints/invite/delete.ts | 3 ++- .../src/server/api/endpoints/invite/limit.ts | 3 ++- .../backend/src/server/api/endpoints/invite/list.ts | 3 ++- packages/backend/src/server/api/endpoints/meta.ts | 3 ++- .../src/server/api/endpoints/miauth/gen-token.ts | 3 ++- .../backend/src/server/api/endpoints/mute/create.ts | 3 ++- .../backend/src/server/api/endpoints/mute/delete.ts | 3 ++- .../backend/src/server/api/endpoints/mute/list.ts | 3 ++- .../backend/src/server/api/endpoints/my/apps.ts | 3 ++- packages/backend/src/server/api/endpoints/notes.ts | 3 ++- .../server/api/endpoints/notes/bubble-timeline.ts | 3 ++- .../src/server/api/endpoints/notes/children.ts | 3 ++- .../backend/src/server/api/endpoints/notes/clips.ts | 3 ++- .../src/server/api/endpoints/notes/conversation.ts | 3 ++- .../src/server/api/endpoints/notes/create.ts | 3 ++- .../src/server/api/endpoints/notes/delete.ts | 3 ++- .../backend/src/server/api/endpoints/notes/edit.ts | 3 ++- .../server/api/endpoints/notes/favorites/create.ts | 3 ++- .../server/api/endpoints/notes/favorites/delete.ts | 3 ++- .../src/server/api/endpoints/notes/featured.ts | 3 ++- .../server/api/endpoints/notes/global-timeline.ts | 3 ++- .../server/api/endpoints/notes/hybrid-timeline.ts | 3 ++- .../backend/src/server/api/endpoints/notes/like.ts | 3 ++- .../server/api/endpoints/notes/local-timeline.ts | 3 ++- .../src/server/api/endpoints/notes/mentions.ts | 3 ++- .../api/endpoints/notes/polls/recommendation.ts | 3 ++- .../src/server/api/endpoints/notes/polls/vote.ts | 3 ++- .../src/server/api/endpoints/notes/reactions.ts | 3 ++- .../server/api/endpoints/notes/reactions/create.ts | 3 ++- .../server/api/endpoints/notes/reactions/delete.ts | 3 ++- .../src/server/api/endpoints/notes/renotes.ts | 3 ++- .../src/server/api/endpoints/notes/replies.ts | 3 ++- .../src/server/api/endpoints/notes/search-by-tag.ts | 3 ++- .../src/server/api/endpoints/notes/search.ts | 3 ++- .../backend/src/server/api/endpoints/notes/show.ts | 3 ++- .../backend/src/server/api/endpoints/notes/state.ts | 3 ++- .../api/endpoints/notes/thread-muting/create.ts | 3 ++- .../api/endpoints/notes/thread-muting/delete.ts | 3 ++- .../src/server/api/endpoints/notes/timeline.ts | 3 ++- .../src/server/api/endpoints/notes/translate.ts | 3 ++- .../src/server/api/endpoints/notes/unrenote.ts | 3 ++- .../api/endpoints/notes/user-list-timeline.ts | 3 ++- .../src/server/api/endpoints/notes/versions.ts | 3 ++- .../server/api/endpoints/notifications/create.ts | 3 ++- .../src/server/api/endpoints/notifications/flush.ts | 1 + .../api/endpoints/notifications/mark-all-as-read.ts | 3 ++- .../endpoints/notifications/test-notification.ts | 3 ++- .../backend/src/server/api/endpoints/page-push.ts | 3 ++- .../src/server/api/endpoints/pages/create.ts | 3 ++- .../src/server/api/endpoints/pages/delete.ts | 3 ++- .../src/server/api/endpoints/pages/featured.ts | 3 ++- .../backend/src/server/api/endpoints/pages/like.ts | 3 ++- .../backend/src/server/api/endpoints/pages/show.ts | 3 ++- .../src/server/api/endpoints/pages/unlike.ts | 3 ++- .../src/server/api/endpoints/pages/update.ts | 3 ++- packages/backend/src/server/api/endpoints/ping.ts | 3 ++- .../src/server/api/endpoints/pinned-users.ts | 3 ++- .../backend/src/server/api/endpoints/promo/read.ts | 3 ++- .../src/server/api/endpoints/renote-mute/create.ts | 3 ++- .../src/server/api/endpoints/renote-mute/delete.ts | 3 ++- .../src/server/api/endpoints/renote-mute/list.ts | 3 ++- .../server/api/endpoints/request-reset-password.ts | 3 ++- .../backend/src/server/api/endpoints/reset-db.ts | 3 ++- .../src/server/api/endpoints/reset-password.ts | 3 ++- .../backend/src/server/api/endpoints/retention.ts | 3 ++- .../server/api/endpoints/reversi/cancel-match.ts | 1 + .../src/server/api/endpoints/reversi/games.ts | 1 + .../src/server/api/endpoints/reversi/invitations.ts | 1 + .../src/server/api/endpoints/reversi/match.ts | 1 + .../src/server/api/endpoints/reversi/show-game.ts | 1 + .../src/server/api/endpoints/reversi/surrender.ts | 1 + .../src/server/api/endpoints/reversi/verify.ts | 3 +++ .../backend/src/server/api/endpoints/roles/list.ts | 3 ++- .../backend/src/server/api/endpoints/roles/notes.ts | 3 ++- .../backend/src/server/api/endpoints/roles/show.ts | 3 ++- .../backend/src/server/api/endpoints/roles/users.ts | 3 ++- .../backend/src/server/api/endpoints/server-info.ts | 3 ++- .../backend/src/server/api/endpoints/sponsors.ts | 3 ++- packages/backend/src/server/api/endpoints/stats.ts | 3 ++- .../backend/src/server/api/endpoints/sw/register.ts | 3 ++- .../server/api/endpoints/sw/show-registration.ts | 3 ++- .../src/server/api/endpoints/sw/unregister.ts | 3 ++- .../server/api/endpoints/sw/update-registration.ts | 3 ++- packages/backend/src/server/api/endpoints/test.ts | 3 ++- .../src/server/api/endpoints/username/available.ts | 3 ++- packages/backend/src/server/api/endpoints/users.ts | 3 ++- .../src/server/api/endpoints/users/achievements.ts | 3 ++- .../backend/src/server/api/endpoints/users/clips.ts | 3 ++- .../server/api/endpoints/users/featured-notes.ts | 3 ++- .../src/server/api/endpoints/users/flashs.ts | 3 ++- .../src/server/api/endpoints/users/followers.ts | 3 ++- .../src/server/api/endpoints/users/following.ts | 3 ++- .../src/server/api/endpoints/users/gallery/posts.ts | 3 ++- .../endpoints/users/get-frequently-replied-users.ts | 3 ++- .../api/endpoints/users/lists/create-from-public.ts | 3 ++- .../src/server/api/endpoints/users/lists/create.ts | 3 ++- .../src/server/api/endpoints/users/lists/delete.ts | 3 ++- .../server/api/endpoints/users/lists/favorite.ts | 3 ++- .../api/endpoints/users/lists/get-memberships.ts | 3 ++- .../src/server/api/endpoints/users/lists/list.ts | 3 ++- .../src/server/api/endpoints/users/lists/pull.ts | 3 ++- .../src/server/api/endpoints/users/lists/push.ts | 3 ++- .../src/server/api/endpoints/users/lists/show.ts | 3 ++- .../server/api/endpoints/users/lists/unfavorite.ts | 3 ++- .../api/endpoints/users/lists/update-membership.ts | 3 ++- .../src/server/api/endpoints/users/lists/update.ts | 3 ++- .../backend/src/server/api/endpoints/users/notes.ts | 3 ++- .../backend/src/server/api/endpoints/users/pages.ts | 3 ++- .../src/server/api/endpoints/users/reactions.ts | 3 ++- .../server/api/endpoints/users/recommendation.ts | 3 ++- .../src/server/api/endpoints/users/relation.ts | 3 ++- .../src/server/api/endpoints/users/report-abuse.ts | 3 ++- .../endpoints/users/search-by-username-and-host.ts | 3 ++- .../src/server/api/endpoints/users/search.ts | 3 ++- .../backend/src/server/api/endpoints/users/show.ts | 3 ++- .../src/server/api/endpoints/users/update-memo.ts | 3 ++- 384 files changed, 768 insertions(+), 379 deletions(-) diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index de0434e602..74125fc944 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -272,8 +272,7 @@ export class ApiCallService implements OnApplicationShutdown { } } - const requireCredential = (ep.meta.requireCredential === 'always' || - (ep.meta.requireCredential === 'conditional' && this.config.secureApiMode)); + const requireCredential = (ep.meta.requireCredential || (ep.meta.requireCredentialSecureMode && this.config.secureApiMode)); if (requireCredential || ep.meta.requireModerator || ep.meta.requireAdmin) { if (user == null) { throw new ApiError({ diff --git a/packages/backend/src/server/api/endpoint-base.ts b/packages/backend/src/server/api/endpoint-base.ts index 2f15bdecf4..e061aa3a8e 100644 --- a/packages/backend/src/server/api/endpoint-base.ts +++ b/packages/backend/src/server/api/endpoint-base.ts @@ -28,16 +28,16 @@ type File = { // TODO: paramsの型をT['params']のスキーマ定義から推論する type Executor = - (params: SchemaType, user: T['requireCredential'] extends 'always' ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, cleanup?: () => any, ip?: string | null, headers?: Record | null) => + (params: SchemaType, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, cleanup?: () => any, ip?: string | null, headers?: Record | null) => Promise>>; export abstract class Endpoint { - public exec: (params: any, user: T['requireCredential'] extends 'always' ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record | null) => Promise; + public exec: (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record | null) => Promise; constructor(meta: T, paramDef: Ps, cb: Executor) { const validate = ajv.compile(paramDef); - this.exec = (params: any, user: T['requireCredential'] extends 'always' ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record | null) => { + this.exec = (params: any, user: T['requireCredential'] extends true ? MiLocalUser : MiLocalUser | null, token: MiAccessToken | null, file?: File, ip?: string | null, headers?: Record | null) => { let cleanup: undefined | (() => void) = undefined; if (meta.requireFile) { diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 604d1fa582..06607233c0 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -791,7 +791,12 @@ interface IEndpointMetaBase { * このエンドポイントにリクエストするのにユーザー情報が必須か否か * 省略した場合は false として解釈されます。 */ - readonly requireCredential?: 'always' | 'conditional' | 'never'; + readonly requireCredential?: boolean; + + /** + * Should a credential be required when the server is in secureApiMode + */ + readonly requireCredentialSecureMode?: boolean; /** * isModeratorなロールを必要とするか @@ -871,14 +876,14 @@ interface IEndpointMetaBase { readonly cacheSec?: number; } -export type IEndpointMeta = (Omit & { - requireCredential?: 'conditional', +export type IEndpointMeta = (Omit & { + requireCredential?: false, requireAdmin?: false, requireModerator?: false, }) | (Omit & { secure: true, }) | (Omit & { - requireCredential: 'always', + requireCredential: true, kind: (typeof permissions)[number], }) | (Omit & { requireModerator: true, diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts index b05f832210..adf3b41c7f 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -13,7 +13,8 @@ import { AbuseUserReportEntityService } from '@/core/entities/AbuseUserReportEnt export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:abuse-user-reports', diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index ecefc5a7c4..86e02e0ff0 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -17,7 +17,8 @@ import { Packed } from '@/misc/json-schema.js'; export const meta = { tags: ['admin'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index a8b2827389..fc44931c8e 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -14,7 +14,8 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:account', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts index 727a8061a7..0e04f9929b 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts @@ -13,7 +13,8 @@ import { ApiError } from '@/server/api/error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'read:admin:account', diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts index 414ea4ffc1..3e9fd2a227 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -13,7 +13,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:ad', res: { diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts index ccd0afb83b..68ea43077c 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:ad', diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index cb0a3d5f92..66077716a7 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:ad', res: { diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts index 7e5ab100d0..1dd1804dc9 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:ad', diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts index e7c11387b3..3fe3fe8588 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -10,7 +10,8 @@ import { AnnouncementService } from '@/core/AnnouncementService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:announcements', diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts index 7d36d544cb..c945a39ce5 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:announcements', diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index 73d07b4b09..f5da9e94ea 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -14,7 +14,8 @@ import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:announcements', diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index 437e02d9a0..3d5be26662 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:announcements', diff --git a/packages/backend/src/server/api/endpoints/admin/approve-user.ts b/packages/backend/src/server/api/endpoints/admin/approve-user.ts index 02a8dbf1f2..2bea098b36 100644 --- a/packages/backend/src/server/api/endpoints/admin/approve-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/approve-user.ts @@ -8,7 +8,8 @@ import { EmailService } from '@/core/EmailService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:approve-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts index 4b8fbe82b3..3cda4a4987 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts @@ -10,7 +10,8 @@ import { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageAvatarDecorations', kind: 'write:admin:avatar-decorations', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts index dbfada9aef..236d6bed2a 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageAvatarDecorations', kind: 'write:admin:avatar-decorations', errors: { diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts index 12e3050d9a..c91786e365 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts @@ -15,7 +15,8 @@ import { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageAvatarDecorations', kind: 'read:admin:avatar-decorations', diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts index fb57e70e8e..94ba2c4c66 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageAvatarDecorations', kind: 'write:admin:avatar-decorations', diff --git a/packages/backend/src/server/api/endpoints/admin/delete-account.ts b/packages/backend/src/server/api/endpoints/admin/delete-account.ts index 082d01a235..b6d3931d36 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-account.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:delete-account', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 3935192782..52832d6c08 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:delete-all-files-of-a-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts index 9ec5dc6b25..f970354ed7 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:drive', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts index 5d1718f28d..baca9abfa4 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:drive', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index f5a050f8fb..f9e70bbb8f 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -13,7 +13,8 @@ import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.j export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:drive', diff --git a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts index 197c336229..790477169e 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:drive', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts index 9e444cf984..4ec0085b41 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts index dd9c587863..7b68f752bd 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts index 27c15535e0..271e23a212 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -17,7 +17,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts index bf9e26e1be..00fccc5245 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts index 1a9e1ababb..7f7832feb4 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts index a052f14c29..25a1e1f2b5 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts @@ -9,7 +9,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts index fd841342fd..b92718214f 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -15,7 +15,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'read:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts index e29336d5c1..0989fb20c3 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -15,7 +15,8 @@ import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'read:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts index a77f1dffaa..c780443f4d 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts index 240ba91397..73c3e4e626 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts index ce3374947b..6f51b59697 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts index ad0676eaf3..eae8d58def 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts @@ -10,7 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 892da67b8d..6f7689965d 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canManageCustomEmojis', kind: 'write:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts index 53f3007165..64b76ba49a 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:federation', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 678a2ce849..a76e5d305e 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:federation', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts index 5f219e6c56..e7cd2775db 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -12,7 +12,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:federation', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts index f5094ece04..ede75fcf88 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts @@ -14,7 +14,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:federation', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts index 9872f11b46..6f3c2fd7a7 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts @@ -9,7 +9,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'read:admin:index-stats', diff --git a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts index c7e300baff..e2844e559e 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts @@ -9,7 +9,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'read:admin:table-stats', diff --git a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts index 9897cbcff3..8f700f5a2f 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts @@ -12,7 +12,8 @@ import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:user-ips', res: { diff --git a/packages/backend/src/server/api/endpoints/admin/invite/create.ts b/packages/backend/src/server/api/endpoints/admin/invite/create.ts index 0d4df6160b..8ced9970e5 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/admin/invite/list.ts b/packages/backend/src/server/api/endpoints/admin/invite/list.ts index cca34e1a79..d36173d2d3 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 666ee2437c..d8364ee559 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -13,7 +13,8 @@ import { DEFAULT_POLICIES } from '@/core/RoleService.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'read:admin:meta', diff --git a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts index e817d1f522..4e144426e4 100644 --- a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts @@ -6,7 +6,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:nsfw-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/promo/create.ts b/packages/backend/src/server/api/endpoints/admin/promo/create.ts index bd9646c116..1daa54ed10 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:promo', diff --git a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts index 8f08ef16ba..308428e281 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -11,7 +11,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:queue', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts index cf3341b8f9..deb151c584 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -11,7 +11,8 @@ import type { DeliverQueue } from '@/core/QueueModule.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:queue', diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 91c08db1cc..4f5b424fce 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -11,7 +11,8 @@ import type { InboxQueue } from '@/core/QueueModule.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:queue', diff --git a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts index b1ace65013..c45051533d 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts @@ -11,7 +11,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:queue', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts index b380462b01..4b3b84800b 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -10,7 +10,8 @@ import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, Obj export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:emoji', diff --git a/packages/backend/src/server/api/endpoints/admin/relays/add.ts b/packages/backend/src/server/api/endpoints/admin/relays/add.ts index f9185973e2..5bfeff6812 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:relays', diff --git a/packages/backend/src/server/api/endpoints/admin/relays/list.ts b/packages/backend/src/server/api/endpoints/admin/relays/list.ts index a6c7870c75..eda94ccda9 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -10,7 +10,8 @@ import { RelayService } from '@/core/RelayService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:relays', diff --git a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts index f887f438b1..604ec5fe29 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -10,7 +10,8 @@ import { RelayService } from '@/core/RelayService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:relays', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index c9cf0ec2d4..86161362ae 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -15,7 +15,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:reset-password', diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 13f948f78a..a1469df179 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -15,7 +15,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:resolve-abuse-user-report', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/roles/assign.ts b/packages/backend/src/server/api/endpoints/admin/roles/assign.ts index e544090200..f3c3ef36b5 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/assign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/assign.ts @@ -13,7 +13,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index 87d138638a..e044310978 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -11,7 +11,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/delete.ts b/packages/backend/src/server/api/endpoints/admin/roles/delete.ts index 0d5ee76051..9de6eb596a 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/delete.ts @@ -13,7 +13,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/list.ts b/packages/backend/src/server/api/endpoints/admin/roles/list.ts index 32a60c6cd2..eb18ea94cd 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/list.ts @@ -12,7 +12,8 @@ import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/show.ts b/packages/backend/src/server/api/endpoints/admin/roles/show.ts index 6d4b9c79fa..9287a3bac2 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/show.ts @@ -13,7 +13,8 @@ import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts b/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts index a325f01299..7c22972e0b 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts @@ -13,7 +13,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts b/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts index 165c259f47..e67b39e3b6 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts @@ -11,7 +11,8 @@ import { MetaService } from '@/core/MetaService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:roles', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index 736b824e9a..1793e5068a 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -14,7 +14,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/roles/users.ts b/packages/backend/src/server/api/endpoints/admin/roles/users.ts index f26c481d5f..7355971edf 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin', 'role', 'users'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, requireModerator: true, kind: 'read:admin:roles', diff --git a/packages/backend/src/server/api/endpoints/admin/send-email.ts b/packages/backend/src/server/api/endpoints/admin/send-email.ts index be1645fb23..62f83031ea 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -10,7 +10,8 @@ import { EmailService } from '@/core/EmailService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:send-email', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index d85cc8de91..e270be7a1c 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -12,7 +12,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:server-info', diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index b572978b4f..d8df71d227 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -13,7 +13,8 @@ import { ModerationLogEntityService } from '@/core/entities/ModerationLogEntityS export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'read:admin:show-moderation-log', diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index e70be57780..9cdca02224 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -15,7 +15,8 @@ import { notificationRecieveConfig } from '@/models/json-schema/user.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:show-user', diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index 171d1f85b5..bba92583d4 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -14,7 +14,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'read:admin:show-users', diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index ab1d1d1a6b..c91199301a 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -7,7 +7,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:silence-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 399db02943..ef0ea1819b 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -19,7 +19,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:suspend-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts index 1b3fd60f57..9b9a70aaf4 100644 --- a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts @@ -6,7 +6,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:unnsfw-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts b/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts index 71a6e76b04..31d6ee4821 100644 --- a/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts +++ b/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts @@ -12,7 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:unset-user-avatar', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts b/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts index a4edc51529..7234bec46f 100644 --- a/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts +++ b/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts @@ -12,7 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:unset-user-banner', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 2b97a191cc..ed524f98dc 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -6,7 +6,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:unsilence-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index 27759d5010..4fe4eb91a0 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:unsuspend-user', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 948b254ed0..c9eefed51a 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -12,7 +12,8 @@ import { MetaService } from '@/core/MetaService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireAdmin: true, kind: 'write:admin:meta', } as const; diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index dce5ab964e..57e77897f8 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -12,7 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireModerator: true, kind: 'write:admin:user-note', } as const; diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index 0c525d6fcc..0a592b99b9 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -14,7 +14,8 @@ import type { AnnouncementReadsRepository, AnnouncementsRepository } from '@/mod export const meta = { tags: ['meta'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index 4b519ba580..df222ba079 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['antennas'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index ef92b3a57b..6026c06bd6 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['antennas'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 30fbd6ad57..5b4109b99b 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['antennas', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index d3b5dcc5c2..11e9924e36 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -20,7 +20,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['antennas', 'account', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index a472562418..36b7c51210 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['antennas', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index 8356417b60..b736115b4b 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['antennas'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index 947e037b1d..a35032360a 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -11,7 +11,8 @@ import { ApResolverService } from '@/core/activitypub/ApResolverService.js'; export const meta = { tags: ['federation'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:federation', limit: { diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index 76377cbfda..ae6aec3a1c 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -24,7 +24,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['federation'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', limit: { diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index e839b1d478..39dc3be3a2 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -15,7 +15,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['app'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 5db68e94eb..9d594cf5b6 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['app'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, errors: { noSuchApp: { diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index a4a5096eeb..bdc0730a67 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['auth'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/auth/session/generate.ts b/packages/backend/src/server/api/endpoints/auth/session/generate.ts index 4849b14728..e4997f70b1 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['auth'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/auth/session/show.ts b/packages/backend/src/server/api/endpoints/auth/session/show.ts index 4ca0e8347c..7a741f0398 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['auth'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, errors: { noSuchSession: { diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index e5af7c6a3c..baa084a881 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['auth'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index 6751c796af..09f42db841 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -21,7 +21,8 @@ export const meta = { max: 20, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:blocks', diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index 254a5b09d1..f5664fd753 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -21,7 +21,8 @@ export const meta = { max: 100, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:blocks', diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index bbc4bcfff7..0e11aaabdd 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:blocks', diff --git a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts b/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts index ab877bbe20..dfcd0f993c 100644 --- a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts +++ b/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts @@ -14,6 +14,9 @@ export const meta = { allowGet: true, cacheSec: 60, + requireCredential: false, + requireCredentialSecureMode: true, + errors: { }, diff --git a/packages/backend/src/server/api/endpoints/bubble-game/register.ts b/packages/backend/src/server/api/endpoints/bubble-game/register.ts index 0a999e42cd..daf1e5dfb1 100644 --- a/packages/backend/src/server/api/endpoints/bubble-game/register.ts +++ b/packages/backend/src/server/api/endpoints/bubble-game/register.ts @@ -13,6 +13,7 @@ import { ApiError } from '../../error.js'; export const meta = { requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index db39d4f057..35bdef1d39 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/channels/favorite.ts b/packages/backend/src/server/api/endpoints/channels/favorite.ts index c5197c0367..347f029f9a 100644 --- a/packages/backend/src/server/api/endpoints/channels/favorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/favorite.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index 6b723d1351..c655dfe5cc 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['channels'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index c6deb2ef31..de7edca8df 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index 167ba987aa..e55fbeb257 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['channels', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:channels', diff --git a/packages/backend/src/server/api/endpoints/channels/my-favorites.ts b/packages/backend/src/server/api/endpoints/channels/my-favorites.ts index 1eb3aa9cc7..268af17a61 100644 --- a/packages/backend/src/server/api/endpoints/channels/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/channels/my-favorites.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['channels', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:channels', diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index 3c355efa8d..1ba6edf090 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['channels', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:channels', diff --git a/packages/backend/src/server/api/endpoints/channels/search.ts b/packages/backend/src/server/api/endpoints/channels/search.ts index ba25ebd357..55c3b7d786 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -15,7 +15,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['channels'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index 297b23b5e3..ab72208d45 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 5064fde578..28c1fb6a63 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -20,7 +20,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes', 'channels'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts index e32f55b6c3..6c00ad52a0 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index a8c5885ff8..dee70528ba 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index ab68b38cb1..85a470604b 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['channels'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:channels', diff --git a/packages/backend/src/server/api/endpoints/charts/active-users.ts b/packages/backend/src/server/api/endpoints/charts/active-users.ts index dd86a16e9a..e150b17962 100644 --- a/packages/backend/src/server/api/endpoints/charts/active-users.ts +++ b/packages/backend/src/server/api/endpoints/charts/active-users.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/active-users.js'; export const meta = { tags: ['charts', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/ap-request.ts b/packages/backend/src/server/api/endpoints/charts/ap-request.ts index b4a2229c3b..3dffa4aa9d 100644 --- a/packages/backend/src/server/api/endpoints/charts/ap-request.ts +++ b/packages/backend/src/server/api/endpoints/charts/ap-request.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/ap-request.js'; export const meta = { tags: ['charts'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/drive.ts b/packages/backend/src/server/api/endpoints/charts/drive.ts index c59c908004..8d071a5cc5 100644 --- a/packages/backend/src/server/api/endpoints/charts/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/drive.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/drive.js'; export const meta = { tags: ['charts', 'drive'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/federation.ts b/packages/backend/src/server/api/endpoints/charts/federation.ts index 1011c21e29..7221064cae 100644 --- a/packages/backend/src/server/api/endpoints/charts/federation.ts +++ b/packages/backend/src/server/api/endpoints/charts/federation.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/federation.js'; export const meta = { tags: ['charts'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/instance.ts b/packages/backend/src/server/api/endpoints/charts/instance.ts index 5c676bee89..cef5c64d36 100644 --- a/packages/backend/src/server/api/endpoints/charts/instance.ts +++ b/packages/backend/src/server/api/endpoints/charts/instance.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/instance.js'; export const meta = { tags: ['charts'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/notes.ts b/packages/backend/src/server/api/endpoints/charts/notes.ts index d9b912fd99..758e7dba00 100644 --- a/packages/backend/src/server/api/endpoints/charts/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/notes.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/notes.js'; export const meta = { tags: ['charts', 'notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/drive.ts b/packages/backend/src/server/api/endpoints/charts/user/drive.ts index 6365b25ad0..10347e4537 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/drive.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/per-user-drive.js'; export const meta = { tags: ['charts', 'drive', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/following.ts b/packages/backend/src/server/api/endpoints/charts/user/following.ts index aa4c6d572c..6b8c3b8327 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/per-user-following.js'; export const meta = { tags: ['charts', 'users', 'following'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/notes.ts b/packages/backend/src/server/api/endpoints/charts/user/notes.ts index 8413abc709..f995e830d1 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/notes.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/per-user-notes.js'; export const meta = { tags: ['charts', 'users', 'notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/pv.ts b/packages/backend/src/server/api/endpoints/charts/user/pv.ts index 955bd4231d..f54eae46a7 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/pv.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/pv.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/per-user-pv.js'; export const meta = { tags: ['charts', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts index fae86f2281..dfea00490f 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/per-user-reactions.js'; export const meta = { tags: ['charts', 'users', 'reactions'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/charts/users.ts b/packages/backend/src/server/api/endpoints/charts/users.ts index 6a36506a3c..3ee016f5e9 100644 --- a/packages/backend/src/server/api/endpoints/charts/users.ts +++ b/packages/backend/src/server/api/endpoints/charts/users.ts @@ -12,7 +12,8 @@ import { schema } from '@/core/chart/charts/entities/users.js'; export const meta = { tags: ['charts', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: getJsonSchema(schema), diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index 3b366923fd..b40beee640 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account', 'notes', 'clips'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index 4428b78543..40960631d9 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -13,7 +13,8 @@ import { ClipService } from '@/core/ClipService.js'; export const meta = { tags: ['clips'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index 38d1a8c137..e738f16918 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -11,7 +11,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clips'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/clips/favorite.ts b/packages/backend/src/server/api/endpoints/clips/favorite.ts index ec86fa7b7e..12d182d67b 100644 --- a/packages/backend/src/server/api/endpoints/clips/favorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/favorite.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clip'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index a73a1794c8..a3efad4427 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['clips', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/clips/my-favorites.ts b/packages/backend/src/server/api/endpoints/clips/my-favorites.ts index 5ceceb14a6..3a92a7581d 100644 --- a/packages/backend/src/server/api/endpoints/clips/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/clips/my-favorites.ts @@ -12,7 +12,8 @@ import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; export const meta = { tags: ['account', 'clip'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:clip-favorite', diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 0a75c759e5..835968599d 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account', 'notes', 'clips'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/clips/remove-note.ts b/packages/backend/src/server/api/endpoints/clips/remove-note.ts index ab22e0be90..add1e6dc57 100644 --- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts @@ -11,7 +11,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account', 'notes', 'clips'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index e97bcad1ba..67362dba8b 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clips', 'account'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts index 4572bfecd1..9a5586f2f2 100644 --- a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clip'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index 66fd449a84..b6a55e9681 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clips'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index 66d7c387e6..a372746b70 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -12,7 +12,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['drive', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index c9af73f045..2362570199 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index 37b768c8be..dea1560acb 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts index 794eacdbdc..ce5d4234ee 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -11,7 +11,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index aac67dbf76..1023c41487 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts index d835913527..a6f7a22268 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts index a90c7ef651..e5329d4acb 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index 9db2ee4ed5..63fba1247e 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -11,7 +11,8 @@ import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.j import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, tags: ['drive'], diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts index ce074fd315..2eee462a52 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts index 924eedc3dc..76b5c09688 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -15,7 +15,8 @@ import { DB_MAX_IMAGE_COMMENT_LENGTH } from '@/const.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index d9b9a307cb..e5c7a4d4dd 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -21,7 +21,8 @@ export const meta = { description: 'Request the server to download a new drive file from the specified URL.', - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index e36b8a5440..c0c5f91d85 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/folders/create.ts b/packages/backend/src/server/api/endpoints/drive/folders/create.ts index aea3d9ba26..f4cb7c173b 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts index dcb3570d7c..af8140a422 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/folders/find.ts b/packages/backend/src/server/api/endpoints/drive/folders/find.ts index 5fea32f6a6..81c85cd445 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/folders/show.ts b/packages/backend/src/server/api/endpoints/drive/folders/show.ts index ce9f92ba50..78dd1a499b 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/folders/update.ts b/packages/backend/src/server/api/endpoints/drive/folders/update.ts index 425ca747cd..797e444028 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:drive', diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 9333a0d8b4..0e564c0c10 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:drive', diff --git a/packages/backend/src/server/api/endpoints/email-address/available.ts b/packages/backend/src/server/api/endpoints/email-address/available.ts index c8d2503f02..a835c9eacc 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -10,7 +10,8 @@ import { EmailService } from '@/core/EmailService.js'; export const meta = { tags: ['users'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index 592bd21a9b..bece0b5b49 100644 --- a/packages/backend/src/server/api/endpoints/emoji.ts +++ b/packages/backend/src/server/api/endpoints/emoji.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['meta'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 3600, diff --git a/packages/backend/src/server/api/endpoints/emojis.ts b/packages/backend/src/server/api/endpoints/emojis.ts index 1a58c19946..f2d876c529 100644 --- a/packages/backend/src/server/api/endpoints/emojis.ts +++ b/packages/backend/src/server/api/endpoints/emojis.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['meta'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 3600, diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index a8d4082d6f..0eb96d7e1d 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import endpoints from '../endpoints.js'; export const meta = { - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, tags: ['meta'], diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index d9b862e8ee..c71abee497 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import endpoints from '../endpoints.js'; export const meta = { - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, tags: ['meta'], diff --git a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts index 131cc6f255..9fd3c7c310 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1hour'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index f261ba57a6..2fad7e93f9 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['federation'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 32a91ab982..9530b14fd8 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['federation'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index e9ebd7698a..7f53c1dfe3 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -14,7 +14,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['federation'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 3600, diff --git a/packages/backend/src/server/api/endpoints/federation/show-instance.ts b/packages/backend/src/server/api/endpoints/federation/show-instance.ts index 5488f04845..a9735df00a 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['federation'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index 7aaf527d47..2513d917c1 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -14,7 +14,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['federation'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 60 * 60, diff --git a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts index 6bc94f7fc5..e77e2fdb98 100644 --- a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts +++ b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts @@ -11,7 +11,8 @@ import { GetterService } from '@/server/api/GetterService.js'; export const meta = { tags: ['federation'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index 6510100770..451dfa2df7 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['federation'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/fetch-external-resources.ts b/packages/backend/src/server/api/endpoints/fetch-external-resources.ts index bf56866382..50ea09b3bd 100644 --- a/packages/backend/src/server/api/endpoints/fetch-external-resources.ts +++ b/packages/backend/src/server/api/endpoints/fetch-external-resources.ts @@ -13,7 +13,8 @@ import { ApiError } from '../error.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, limit: { diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index 40a05cabad..f8b8774df5 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -13,7 +13,8 @@ const rssParser = new Parser(); export const meta = { tags: ['meta'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, allowGet: true, cacheSec: 60 * 3, diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts index cc61a87fe5..34b8121801 100644 --- a/packages/backend/src/server/api/endpoints/flash/create.ts +++ b/packages/backend/src/server/api/endpoints/flash/create.ts @@ -14,7 +14,8 @@ import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; export const meta = { tags: ['flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/flash/delete.ts b/packages/backend/src/server/api/endpoints/flash/delete.ts index 695c9ac944..4c03a9b2b8 100644 --- a/packages/backend/src/server/api/endpoints/flash/delete.ts +++ b/packages/backend/src/server/api/endpoints/flash/delete.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['flashs'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:flash', diff --git a/packages/backend/src/server/api/endpoints/flash/featured.ts b/packages/backend/src/server/api/endpoints/flash/featured.ts index 8db757ec5f..b40516f55f 100644 --- a/packages/backend/src/server/api/endpoints/flash/featured.ts +++ b/packages/backend/src/server/api/endpoints/flash/featured.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['flash'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/flash/like.ts b/packages/backend/src/server/api/endpoints/flash/like.ts index 2d622abc30..c6a3997ec9 100644 --- a/packages/backend/src/server/api/endpoints/flash/like.ts +++ b/packages/backend/src/server/api/endpoints/flash/like.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/flash/my-likes.ts b/packages/backend/src/server/api/endpoints/flash/my-likes.ts index 240c637d67..578c9dbfec 100644 --- a/packages/backend/src/server/api/endpoints/flash/my-likes.ts +++ b/packages/backend/src/server/api/endpoints/flash/my-likes.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:flash-likes', diff --git a/packages/backend/src/server/api/endpoints/flash/my.ts b/packages/backend/src/server/api/endpoints/flash/my.ts index f13b7b5508..7856a857b2 100644 --- a/packages/backend/src/server/api/endpoints/flash/my.ts +++ b/packages/backend/src/server/api/endpoints/flash/my.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:flash', diff --git a/packages/backend/src/server/api/endpoints/flash/show.ts b/packages/backend/src/server/api/endpoints/flash/show.ts index 29f18c3193..c26c564564 100644 --- a/packages/backend/src/server/api/endpoints/flash/show.ts +++ b/packages/backend/src/server/api/endpoints/flash/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['flashs'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/flash/unlike.ts b/packages/backend/src/server/api/endpoints/flash/unlike.ts index b008506318..e91413bd9f 100644 --- a/packages/backend/src/server/api/endpoints/flash/unlike.ts +++ b/packages/backend/src/server/api/endpoints/flash/unlike.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/flash/update.ts b/packages/backend/src/server/api/endpoints/flash/update.ts index 8615795335..f14fdc72a2 100644 --- a/packages/backend/src/server/api/endpoints/flash/update.ts +++ b/packages/backend/src/server/api/endpoints/flash/update.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['flash'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index 56214bd1e6..d1342615e7 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -22,7 +22,8 @@ export const meta = { max: 100, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index 8c3973f077..42057347a4 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -21,7 +21,8 @@ export const meta = { max: 100, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index 98d06c118f..43fd2ab62a 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -21,7 +21,8 @@ export const meta = { max: 100, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/following/requests/accept.ts b/packages/backend/src/server/api/endpoints/following/requests/accept.ts index 508cd9c9a6..108cd69e79 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['following', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts index 8512dd054d..788fd15d24 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['following', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/following/requests/list.ts b/packages/backend/src/server/api/endpoints/following/requests/list.ts index 7a237240fb..8a2d726821 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['following', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:following', diff --git a/packages/backend/src/server/api/endpoints/following/requests/reject.ts b/packages/backend/src/server/api/endpoints/following/requests/reject.ts index fe561a8e84..a6d6b47cd1 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['following', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/following/update-all.ts b/packages/backend/src/server/api/endpoints/following/update-all.ts index 04a6bf4a46..a354feecfc 100644 --- a/packages/backend/src/server/api/endpoints/following/update-all.ts +++ b/packages/backend/src/server/api/endpoints/following/update-all.ts @@ -21,7 +21,8 @@ export const meta = { max: 10, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', } as const; diff --git a/packages/backend/src/server/api/endpoints/following/update.ts b/packages/backend/src/server/api/endpoints/following/update.ts index 391fc5574b..a32c425a1f 100644 --- a/packages/backend/src/server/api/endpoints/following/update.ts +++ b/packages/backend/src/server/api/endpoints/following/update.ts @@ -21,7 +21,8 @@ export const meta = { max: 100, }, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:following', diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index 2063cda282..e7221ee09c 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -13,7 +13,8 @@ import { FeaturedService } from '@/core/FeaturedService.js'; export const meta = { tags: ['gallery'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 3f6f4503f4..29ded589b7 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['gallery'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index ade54451d3..cf681785b4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['gallery'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index 9a13f0bc57..8a8aa81d96 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -17,7 +17,8 @@ import { isNotNull } from '@/misc/is-not-null.js'; export const meta = { tags: ['gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts index 79d8514e83..a5ba81f42f 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:gallery', diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index e68f50b254..8faecce43e 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts index 87894b8351..3e4828642d 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['gallery'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, errors: { noSuchPost: { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts index 04c536f3f4..bd05955c74 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index ddc9415f4d..e9deac20e9 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -15,7 +15,8 @@ import { isNotNull } from '@/misc/is-not-null.js'; export const meta = { tags: ['gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts b/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts index b068a85008..22e184791d 100644 --- a/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts +++ b/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts @@ -13,7 +13,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/get-online-users-count.ts b/packages/backend/src/server/api/endpoints/get-online-users-count.ts index 72290e6e20..977044a496 100644 --- a/packages/backend/src/server/api/endpoints/get-online-users-count.ts +++ b/packages/backend/src/server/api/endpoints/get-online-users-count.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['meta'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 60 * 1, res: { diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index 02b72c1c0f..5d22f20708 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['hashtags'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index 9208ab4ae8..57ad55d96d 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -12,7 +12,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['hashtags'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 11c57c080a..5911b85f2b 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['hashtags'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index aac6cb12ff..fddd4407b0 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -12,7 +12,8 @@ import { HashtagService } from '@/core/HashtagService.js'; export const meta = { tags: ['hashtags'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 60 * 1, diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index dc95d41c5a..562ff49bab 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -12,7 +12,8 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, tags: ['hashtags', 'users'], diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index 89646bfafd..faf6019fe3 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -13,7 +13,8 @@ import { ApiError } from '../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: "read:account", res: { 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 81a9804486..64d0d2d6c5 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -12,7 +12,8 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 d85dcdb1ea..53beb1ab5b 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 @@ -16,7 +16,8 @@ import { ApiError } from '@/server/api/error.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts index cb86d25a7b..59204880a7 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 daacddd775..2ba9111f44 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 @@ -14,7 +14,8 @@ import { ApiError } from '@/server/api/error.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 a48791e993..72744ccf86 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -16,7 +16,8 @@ import { ApiError } from '@/server/api/error.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 3d2300775f..52ac777b6f 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 @@ -15,7 +15,8 @@ import { ApiError } from '@/server/api/error.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 746916a7ec..2c8d31df38 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -15,7 +15,8 @@ import { ApiError } from '@/server/api/error.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts index b2fb6679a1..ec7b30c41f 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index 85cc65f3c5..933c851ae7 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -10,7 +10,8 @@ import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts index a8d0f202cd..869d5efc2c 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -11,7 +11,8 @@ import { AppEntityService } from '@/core/entities/AppEntityService.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, 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 129abcc3a6..1fb3c0c601 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, } as const; diff --git a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts index 74f1c60185..0bfc47fef4 100644 --- a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts +++ b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts @@ -9,7 +9,8 @@ import { AchievementService, ACHIEVEMENT_TYPES } from '@/core/AchievementService import { MetaService } from '@/core/MetaService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:account', } as const; 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 ca9c2faae8..676d5f870c 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, } as const; diff --git a/packages/backend/src/server/api/endpoints/i/export-antennas.ts b/packages/backend/src/server/api/endpoints/i/export-antennas.ts index fa9504ba9d..5cfa4260f9 100644 --- a/packages/backend/src/server/api/endpoints/i/export-antennas.ts +++ b/packages/backend/src/server/api/endpoints/i/export-antennas.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1hour'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-blocking.ts b/packages/backend/src/server/api/endpoints/i/export-blocking.ts index a318a38c56..2e321d37ef 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1hour'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-clips.ts b/packages/backend/src/server/api/endpoints/i/export-clips.ts index 10d1fdac73..2b22e284a7 100644 --- a/packages/backend/src/server/api/endpoints/i/export-clips.ts +++ b/packages/backend/src/server/api/endpoints/i/export-clips.ts @@ -11,6 +11,7 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1day'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-data.ts b/packages/backend/src/server/api/endpoints/i/export-data.ts index dbf7a970e5..25250a9362 100644 --- a/packages/backend/src/server/api/endpoints/i/export-data.ts +++ b/packages/backend/src/server/api/endpoints/i/export-data.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('3days'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-favorites.ts b/packages/backend/src/server/api/endpoints/i/export-favorites.ts index f2a31e488e..72ffa7db93 100644 --- a/packages/backend/src/server/api/endpoints/i/export-favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/export-favorites.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1day'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index 8d094784f6..bf3fcc02f8 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1hour'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-mute.ts b/packages/backend/src/server/api/endpoints/i/export-mute.ts index 0274270495..751205612c 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1hour'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-notes.ts b/packages/backend/src/server/api/endpoints/i/export-notes.ts index be2707e582..82e32ce0c3 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1day'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts index 2d0a5c9ea8..535343eb5b 100644 --- a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts @@ -10,7 +10,8 @@ import { QueueService } from '@/core/QueueService.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: ms('1min'), max: 1, diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index 47751e6d0b..eb56c74965 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'notes', 'favorites'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:favorites', diff --git a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts index 30b666c955..8966c72245 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:gallery-likes', diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index b57bd4d326..899dd91b91 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'gallery'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:gallery', diff --git a/packages/backend/src/server/api/endpoints/i/import-antennas.ts b/packages/backend/src/server/api/endpoints/i/import-antennas.ts index 5b58fecf7f..1682e6187b 100644 --- a/packages/backend/src/server/api/endpoints/i/import-antennas.ts +++ b/packages/backend/src/server/api/endpoints/i/import-antennas.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index b8da8f181a..cdc6682426 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index 6e803fc210..02b397854c 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { duration: ms('1hour'), diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index c60d492d44..abb328b176 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { diff --git a/packages/backend/src/server/api/endpoints/i/import-notes.ts b/packages/backend/src/server/api/endpoints/i/import-notes.ts index 1b242b2791..3d91a7febf 100644 --- a/packages/backend/src/server/api/endpoints/i/import-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/import-notes.ts @@ -9,7 +9,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { duration: ms('1hour'), diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index b9a0771ea9..9374f81c12 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { duration: ms('1hour'), diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index 77da836e80..778dd59ce8 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -24,7 +24,8 @@ export const meta = { tags: ['users'], secure: true, - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, limit: { duration: ms('1day'), diff --git a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts index bbd533eb04..1fe641b42a 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts @@ -19,7 +19,8 @@ import { MiGroupedNotification, MiNotification } from '@/models/Notification.js' export const meta = { tags: ['account', 'notifications'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: 30000, diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 89aefe799e..b94712ba4a 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -19,7 +19,8 @@ import { MiNotification } from '@/models/Notification.js'; export const meta = { tags: ['account', 'notifications'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, limit: { duration: 30000, diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index da6add48f5..3016df9c2f 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:page-likes', diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index fd3ef8a53e..94ea8d430b 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:pages', diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index a463d3d3fc..aefb45223a 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts index 30f06ef1ec..fbccb692d0 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', } as const; diff --git a/packages/backend/src/server/api/endpoints/i/read-announcement.ts b/packages/backend/src/server/api/endpoints/i/read-announcement.ts index 08ad5e2560..a3c8f3c8b0 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -10,7 +10,8 @@ import { AnnouncementService } from '@/core/AnnouncementService.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts index 1fe2e20bef..40b07b7db7 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -13,7 +13,8 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, } as const; diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index c66d9a08bc..3b37984ecc 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 2c776f4189..9e78b62227 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -9,7 +9,8 @@ import { RegistryApiService } from '@/core/RegistryApiService.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', errors: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index ac9f90bc0d..2ffe504e20 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -5,7 +5,8 @@ import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', secure: false, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index 1dad67ce1f..9a984edf3d 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -9,7 +9,8 @@ import { RegistryApiService } from '@/core/RegistryApiService.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', errors: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index b425694408..a701d8a5c8 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index aba5bc4841..33e4c87206 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index 2c79f73d69..d786761a49 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -11,7 +11,8 @@ import { RegistryApiService } from '@/core/RegistryApiService.js'; import { ApiError } from '../../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', errors: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts index 0425321888..e9322656f9 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, res: { diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index 1557eb1f50..c22b5778f5 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -8,7 +8,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', } as const; diff --git a/packages/backend/src/server/api/endpoints/i/revoke-token.ts b/packages/backend/src/server/api/endpoints/i/revoke-token.ts index 5933b6e329..c96b48ea6d 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -9,7 +9,8 @@ import type { AccessTokensRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, } as const; diff --git a/packages/backend/src/server/api/endpoints/i/signin-history.ts b/packages/backend/src/server/api/endpoints/i/signin-history.ts index 8c78d52773..f596cce24b 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -11,7 +11,8 @@ import { SigninEntityService } from '@/core/entities/SigninEntityService.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, res: { diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index 4f1f76c073..de5de16cd8 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', 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 b359716d7c..a02ee9dacd 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -19,7 +19,8 @@ import { UserAuthService } from '@/core/UserAuthService.js'; import { ApiError } from '../../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index f34d1e0c88..cb413de9ee 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -40,7 +40,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts index 6c8d4aeee2..a43b99ead1 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '@/server/api/error.js'; export const meta = { tags: ['webhooks'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts index 3292f3719e..51d8687d8c 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['webhooks'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts index bab03b4dcf..1e463eea5b 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['webhooks', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts index 1b5f3eb877..7d5228ae21 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['webhooks'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts index 71c4e8e5fd..f5a33c3cfc 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['webhooks'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/invite/create.ts b/packages/backend/src/server/api/endpoints/invite/create.ts index 6505370c4a..28566c2364 100644 --- a/packages/backend/src/server/api/endpoints/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/invite/create.ts @@ -17,7 +17,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canInvite', kind: 'write:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/invite/delete.ts b/packages/backend/src/server/api/endpoints/invite/delete.ts index c5ac60cdd3..f597e7676e 100644 --- a/packages/backend/src/server/api/endpoints/invite/delete.ts +++ b/packages/backend/src/server/api/endpoints/invite/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canInvite', kind: 'write:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/invite/limit.ts b/packages/backend/src/server/api/endpoints/invite/limit.ts index 1aaa27c838..986cf7e1cc 100644 --- a/packages/backend/src/server/api/endpoints/invite/limit.ts +++ b/packages/backend/src/server/api/endpoints/invite/limit.ts @@ -14,7 +14,8 @@ import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canInvite', kind: 'read:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/invite/list.ts b/packages/backend/src/server/api/endpoints/invite/list.ts index 22e181930e..2bf3037a81 100644 --- a/packages/backend/src/server/api/endpoints/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/invite/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['meta'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, requireRolePolicy: 'canInvite', kind: 'read:invite-codes', diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index e03208b192..55f3c70b3d 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -10,7 +10,8 @@ import { MetaEntityService } from '@/core/entities/MetaEntityService.js'; export const meta = { tags: ['meta'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts index e3d017464d..502ece8edb 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['auth'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 6519b4eb10..a6e584045a 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:mutes', diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index 04e7d06888..02fb09a628 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:mutes', diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index d4ff338f2c..015c963e5d 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:mutes', diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index 93e573050f..ae0a29fc06 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account', 'app'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index 86674840a0..d753b392e3 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts index ca9eaf2cfa..806b421758 100644 --- a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts @@ -14,7 +14,8 @@ import { MetaService } from '@/core/MetaService.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index 2db37c2e80..08bf36df07 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -14,7 +14,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index 5a71c15ca0..adba744a3d 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['clips', 'notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index a0f8b7c201..94fd79d059 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index cff0c38255..8dec6c7475 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -25,7 +25,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index b00694e05c..852369f5d7 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notes', diff --git a/packages/backend/src/server/api/endpoints/notes/edit.ts b/packages/backend/src/server/api/endpoints/notes/edit.ts index 7f94c0ac4f..807f58a95f 100644 --- a/packages/backend/src/server/api/endpoints/notes/edit.ts +++ b/packages/backend/src/server/api/endpoints/notes/edit.ts @@ -18,7 +18,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts index d551d77682..152a106158 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes', 'favorites'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:favorites', diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts index a7d2cdf922..54b52c79dc 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes', 'favorites'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:favorites', diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index e65d089741..6b220082ea 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -15,7 +15,8 @@ import { CacheService } from '@/core/CacheService.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, allowGet: true, cacheSec: 3600, diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 276cb600fc..6bdb149590 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -18,7 +18,8 @@ import { CacheService } from '@/core/CacheService.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 0ba2f85ae9..7f27ac89e3 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -24,7 +24,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/like.ts b/packages/backend/src/server/api/endpoints/notes/like.ts index a660cf0f0f..793237abe8 100644 --- a/packages/backend/src/server/api/endpoints/notes/like.ts +++ b/packages/backend/src/server/api/endpoints/notes/like.ts @@ -8,7 +8,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 80a7e0b313..f19880c371 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -22,7 +22,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 62c043059b..182b7521a0 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -15,7 +15,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index 6c55d2a46c..7e07261664 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts index c7abd2b9f3..aefff6a0bf 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -20,7 +20,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 220e592e02..032128a012 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -15,7 +15,8 @@ import { QueryService } from '@/core/QueryService.js'; export const meta = { tags: ['notes', 'reactions'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, allowGet: true, cacheSec: 60, diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index de58f178ef..985d4277b3 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['reactions', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index 3010dc3889..492269f494 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['reactions', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:reactions', diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index a0ee51f796..d63886ce08 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index f1f81c399b..3e7fdfb15c 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 2fa6790282..c4293bdb83 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -19,7 +19,8 @@ import { UtilityService } from '@/core/UtilityService.js'; export const meta = { tags: ['notes', 'hashtags'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index daeb774e96..bdec0f4dfc 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 23db9d5f2b..6a6cfade96 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index 6a079ffed7..5eeb6826ed 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -11,7 +11,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index d33fa895ba..3375835213 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts index 9f65439d18..52b885ff6b 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 29763d53e1..96fc67fd95 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -21,7 +21,8 @@ import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointServ export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index 10a39eb23d..7fb0a6d423 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index 13113ba925..b7613ada9d 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notes', diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index b1b845f1b5..d63324d87a 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -21,7 +21,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes', 'lists'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/notes/versions.ts b/packages/backend/src/server/api/endpoints/notes/versions.ts index b567f72d9c..efae59f36d 100644 --- a/packages/backend/src/server/api/endpoints/notes/versions.ts +++ b/packages/backend/src/server/api/endpoints/notes/versions.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index 14202c3bca..a31fe5e586 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -10,7 +10,8 @@ import { NotificationService } from '@/core/NotificationService.js'; export const meta = { tags: ['notifications'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notifications', diff --git a/packages/backend/src/server/api/endpoints/notifications/flush.ts b/packages/backend/src/server/api/endpoints/notifications/flush.ts index 47c0642fd1..5724e93078 100644 --- a/packages/backend/src/server/api/endpoints/notifications/flush.ts +++ b/packages/backend/src/server/api/endpoints/notifications/flush.ts @@ -11,6 +11,7 @@ export const meta = { tags: ['notifications', 'account'], requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notifications', } as const; diff --git a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts index e25ce88b39..c1b66c4582 100644 --- a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -10,7 +10,8 @@ import { NotificationService } from '@/core/NotificationService.js'; export const meta = { tags: ['notifications', 'account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notifications', } as const; diff --git a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts index c36ba5378b..10b6cf3e19 100644 --- a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts +++ b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts @@ -10,7 +10,8 @@ import { NotificationService } from '@/core/NotificationService.js'; export const meta = { tags: ['notifications'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:notifications', diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index c3f071e9fb..8301d71eba 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; import { ApiError } from '../error.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, errors: { diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index 58e9972760..4fcce1bba7 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index 7116524755..b57d6ccabc 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:pages', diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index 8239a162dd..478b342c63 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -12,7 +12,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['pages'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index a0812507ee..d58bcf6feb 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index a216ee2051..933570098e 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index 14715fb4c8..955c1d3dcc 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index e9936ec41d..068b12fb8b 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['pages'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index 67376f1193..496803bdc5 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -7,7 +7,8 @@ import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; export const meta = { - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, tags: ['meta'], diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 1c6bf4aad9..7882062a71 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -17,7 +17,8 @@ import { isNotNull } from '@/misc/is-not-null.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index 92a4253254..048e907564 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', errors: { diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index 61eb5ba236..e9ee668319 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:mutes', diff --git a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts index 2794d73968..2a45ee7c52 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:mutes', diff --git a/packages/backend/src/server/api/endpoints/renote-mute/list.ts b/packages/backend/src/server/api/endpoints/renote-mute/list.ts index 7c7a91117d..ef03c6c03e 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/list.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:mutes', diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index a4b9c32232..fee7ff1dd3 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -17,7 +17,8 @@ import { L_CHARS, secureRndstr } from '@/misc/secure-rndstr.js'; export const meta = { tags: ['reset password'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, description: 'Request a users password to be reset.', diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index c0685002d9..f6150aa4a7 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -13,7 +13,8 @@ import { resetDb } from '@/misc/reset-db.js'; export const meta = { tags: ['non-productive'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, description: 'Only available when running with NODE_ENV=testing. Reset the database and flush Redis.', diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index 79b16b149f..83c3f89622 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -14,7 +14,8 @@ import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['reset password'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, description: 'Complete the password reset that was previously requested.', diff --git a/packages/backend/src/server/api/endpoints/retention.ts b/packages/backend/src/server/api/endpoints/retention.ts index 61264aa274..eac243138a 100644 --- a/packages/backend/src/server/api/endpoints/retention.ts +++ b/packages/backend/src/server/api/endpoints/retention.ts @@ -11,7 +11,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts b/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts index dd6f273e01..d595a71af5 100644 --- a/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts +++ b/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts @@ -9,6 +9,7 @@ import { ReversiService } from '@/core/ReversiService.js'; export const meta = { requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/reversi/games.ts b/packages/backend/src/server/api/endpoints/reversi/games.ts index 6b06068727..ef566beb20 100644 --- a/packages/backend/src/server/api/endpoints/reversi/games.ts +++ b/packages/backend/src/server/api/endpoints/reversi/games.ts @@ -13,6 +13,7 @@ import { QueryService } from '@/core/QueryService.js'; export const meta = { requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/reversi/invitations.ts b/packages/backend/src/server/api/endpoints/reversi/invitations.ts index 5b3b9da75b..93355c85d6 100644 --- a/packages/backend/src/server/api/endpoints/reversi/invitations.ts +++ b/packages/backend/src/server/api/endpoints/reversi/invitations.ts @@ -11,6 +11,7 @@ import { ReversiService } from '@/core/ReversiService.js'; export const meta = { requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/reversi/match.ts b/packages/backend/src/server/api/endpoints/reversi/match.ts index aa8b8a7d72..c6089990ed 100644 --- a/packages/backend/src/server/api/endpoints/reversi/match.ts +++ b/packages/backend/src/server/api/endpoints/reversi/match.ts @@ -12,6 +12,7 @@ import { GetterService } from '../../GetterService.js'; export const meta = { requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/reversi/show-game.ts b/packages/backend/src/server/api/endpoints/reversi/show-game.ts index fc3b96eb51..f8148c0a1a 100644 --- a/packages/backend/src/server/api/endpoints/reversi/show-game.ts +++ b/packages/backend/src/server/api/endpoints/reversi/show-game.ts @@ -11,6 +11,7 @@ import { ApiError } from '../../error.js'; export const meta = { requireCredential: false, + requireCredentialSecureMode: true, errors: { noSuchGame: { diff --git a/packages/backend/src/server/api/endpoints/reversi/surrender.ts b/packages/backend/src/server/api/endpoints/reversi/surrender.ts index 75e5372862..b07c0e550a 100644 --- a/packages/backend/src/server/api/endpoints/reversi/surrender.ts +++ b/packages/backend/src/server/api/endpoints/reversi/surrender.ts @@ -10,6 +10,7 @@ import { ApiError } from '../../error.js'; export const meta = { requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/reversi/verify.ts b/packages/backend/src/server/api/endpoints/reversi/verify.ts index 981735a3d7..802f0b00f9 100644 --- a/packages/backend/src/server/api/endpoints/reversi/verify.ts +++ b/packages/backend/src/server/api/endpoints/reversi/verify.ts @@ -10,6 +10,9 @@ import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityServi import { ApiError } from '../../error.js'; export const meta = { + requireCredential: false, + requireCredentialSecureMode: true, + errors: { noSuchGame: { message: 'No such game.', diff --git a/packages/backend/src/server/api/endpoints/roles/list.ts b/packages/backend/src/server/api/endpoints/roles/list.ts index 96a65e256d..3d35de25ce 100644 --- a/packages/backend/src/server/api/endpoints/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/roles/list.ts @@ -12,7 +12,8 @@ import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; export const meta = { tags: ['role'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', res: { diff --git a/packages/backend/src/server/api/endpoints/roles/notes.ts b/packages/backend/src/server/api/endpoints/roles/notes.ts index 78a8d1cef0..141d46c340 100644 --- a/packages/backend/src/server/api/endpoints/roles/notes.ts +++ b/packages/backend/src/server/api/endpoints/roles/notes.ts @@ -17,7 +17,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['role', 'notes'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', errors: { diff --git a/packages/backend/src/server/api/endpoints/roles/show.ts b/packages/backend/src/server/api/endpoints/roles/show.ts index 20e63c7102..fdc8bb050a 100644 --- a/packages/backend/src/server/api/endpoints/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/roles/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['role', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, errors: { noSuchRole: { diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts index 661d5a4336..561aba421e 100644 --- a/packages/backend/src/server/api/endpoints/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/roles/users.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['role', 'users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, errors: { noSuchRole: { diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index b079c7ee61..4ded7d79a1 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -10,7 +10,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { MetaService } from '@/core/MetaService.js'; export const meta = { - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, allowGet: true, cacheSec: 60 * 1, diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index 33e5823826..f71f9ac74d 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -7,7 +7,8 @@ export const meta = { tags: ['meta'], description: 'Get Sharkey GH Sponsors', - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, requireCredentialPrivateMode: false, } as const; diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index f77b4b1682..33b2f4cf38 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -11,7 +11,8 @@ import NotesChart from '@/core/chart/charts/notes.js'; import UsersChart from '@/core/chart/charts/users.js'; export const meta = { - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, tags: ['meta'], diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 7a9476ca9f..5f2c8141ef 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -14,7 +14,8 @@ import { PushNotificationService } from '@/core/PushNotificationService.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, description: 'Register to receive push notifications.', diff --git a/packages/backend/src/server/api/endpoints/sw/show-registration.ts b/packages/backend/src/server/api/endpoints/sw/show-registration.ts index 8ed31df6da..8db9a7face 100644 --- a/packages/backend/src/server/api/endpoints/sw/show-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -11,7 +11,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, description: 'Check push notification registration exists.', diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index 4e2a4acef8..4a28ff57ef 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -12,7 +12,8 @@ import { PushNotificationService } from '@/core/PushNotificationService.js'; export const meta = { tags: ['account'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, description: 'Unregister from receiving push notifications.', } as const; diff --git a/packages/backend/src/server/api/endpoints/sw/update-registration.ts b/packages/backend/src/server/api/endpoints/sw/update-registration.ts index 08ba5f8b79..99d64150cf 100644 --- a/packages/backend/src/server/api/endpoints/sw/update-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, secure: true, description: 'Update push notification registration.', diff --git a/packages/backend/src/server/api/endpoints/test.ts b/packages/backend/src/server/api/endpoints/test.ts index 89f12684cd..fb2cb67a83 100644 --- a/packages/backend/src/server/api/endpoints/test.ts +++ b/packages/backend/src/server/api/endpoints/test.ts @@ -11,7 +11,8 @@ export const meta = { description: 'Endpoint for testing input validation.', - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 13768c5732..bf7f7a9932 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -14,7 +14,8 @@ import { MetaService } from '@/core/MetaService.js'; export const meta = { tags: ['users'], - requireCredential: 'never', + requireCredential: false, + requireCredentialSecureMode: false, res: { type: 'object', diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index 43bd037f6f..885838a508 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/users/achievements.ts b/packages/backend/src/server/api/endpoints/users/achievements.ts index 25063b2328..4b0e70d6e0 100644 --- a/packages/backend/src/server/api/endpoints/users/achievements.ts +++ b/packages/backend/src/server/api/endpoints/users/achievements.ts @@ -9,7 +9,8 @@ import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index d7abe3dcd3..2da72149e9 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users', 'clips'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show all clips this user owns.', diff --git a/packages/backend/src/server/api/endpoints/users/featured-notes.ts b/packages/backend/src/server/api/endpoints/users/featured-notes.ts index e8a5a1b6c2..0e2eddbb65 100644 --- a/packages/backend/src/server/api/endpoints/users/featured-notes.ts +++ b/packages/backend/src/server/api/endpoints/users/featured-notes.ts @@ -15,7 +15,8 @@ import { isUserRelated } from '@/misc/is-user-related.js'; export const meta = { tags: ['notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, allowGet: true, cacheSec: 3600, diff --git a/packages/backend/src/server/api/endpoints/users/flashs.ts b/packages/backend/src/server/api/endpoints/users/flashs.ts index 992bf4fe36..1de18a4fc8 100644 --- a/packages/backend/src/server/api/endpoints/users/flashs.ts +++ b/packages/backend/src/server/api/endpoints/users/flashs.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users', 'flashs'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show all flashs this user created.', diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 909a8911a1..64171562a6 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show everyone that follows this user.', diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index ff7c17551d..f9944d71d5 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show everyone that this user is following.', diff --git a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts index 5f75cf0365..6095413298 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users', 'gallery'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show all gallery posts by the given user.', diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts index be136e8de9..2415836ccf 100644 --- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -16,7 +16,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Get a list of other users that the specified user frequently replies to.', diff --git a/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts b/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts index 385573c0c0..76b3d25989 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts @@ -16,7 +16,8 @@ import { RoleService } from '@/core/RoleService.js'; import { UserListService } from '@/core/UserListService.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, kind: 'write:account', res: { diff --git a/packages/backend/src/server/api/endpoints/users/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index ec9c758b2b..934ebee1c4 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -16,7 +16,8 @@ import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['lists'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 3ffd35eead..a71bda1584 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -12,7 +12,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/users/lists/favorite.ts b/packages/backend/src/server/api/endpoints/users/lists/favorite.ts index 9fb647c224..9dbe780ddd 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/favorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/favorite.ts @@ -11,7 +11,8 @@ import { ApiError } from '@/server/api/error.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', errors: { noSuchList: { diff --git a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts index a976921ad2..d82c72b44e 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists', 'account'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/users/lists/list.ts b/packages/backend/src/server/api/endpoints/users/lists/list.ts index 9c4d97598b..f61eaa0ce8 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['lists', 'account'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/users/lists/pull.ts b/packages/backend/src/server/api/endpoints/users/lists/pull.ts index 997df33533..2a06e552e4 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists', 'users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/users/lists/push.ts b/packages/backend/src/server/api/endpoints/users/lists/push.ts index 54bb54ad25..650ed48ee5 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -15,7 +15,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists', 'users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/users/lists/show.ts b/packages/backend/src/server/api/endpoints/users/lists/show.ts index a8336a0980..29c76c4f13 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists', 'account'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts b/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts index 3bb6256949..44609e93aa 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts @@ -10,7 +10,8 @@ import { ApiError } from '@/server/api/error.js'; import { DI } from '@/di-symbols.js'; export const meta = { - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', errors: { noSuchList: { diff --git a/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts b/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts index 4c37cb8107..d018e4beab 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists', 'users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, prohibitMoved: true, diff --git a/packages/backend/src/server/api/endpoints/users/lists/update.ts b/packages/backend/src/server/api/endpoints/users/lists/update.ts index 698313f1d6..e11efdd0ef 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -13,7 +13,8 @@ import { ApiError } from '../../../error.js'; export const meta = { tags: ['lists'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account', diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index a27f3896a5..6d21f274d2 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -21,7 +21,8 @@ import { ApiError } from '@/server/api/error.js'; export const meta = { tags: ['users', 'notes'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, res: { type: 'array', diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index 037f957087..711e166c03 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -13,7 +13,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users', 'pages'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show all pages this user created.', diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index e9883c7aab..89f34b60e3 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -17,7 +17,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['users', 'reactions'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show all reactions this user made.', diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 00b248a6c4..75eade416f 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -14,7 +14,8 @@ import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 64e18152d4..50270bb85f 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -10,7 +10,8 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; export const meta = { tags: ['users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'read:account', description: 'Show the different kinds of relations between the authenticated user and the specified user(s).', diff --git a/packages/backend/src/server/api/endpoints/users/report-abuse.ts b/packages/backend/src/server/api/endpoints/users/report-abuse.ts index 109bb3ea9c..8a0ff3d85c 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -19,7 +19,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['users'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:report-abuse', description: 'File a report.', diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index 0a105f2916..b52f6fc393 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -16,7 +16,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Search for a user by username and/or host.', diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index cf18a375dd..d094cf0363 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -15,7 +15,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Search for users.', diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index 9dd45e9e05..1f6906b443 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -20,7 +20,8 @@ import type { FindOptionsWhere } from 'typeorm'; export const meta = { tags: ['users'], - requireCredential: 'conditional', + requireCredential: false, + requireCredentialSecureMode: true, description: 'Show the properties of a user.', diff --git a/packages/backend/src/server/api/endpoints/users/update-memo.ts b/packages/backend/src/server/api/endpoints/users/update-memo.ts index f5e3350086..1e3a24c25f 100644 --- a/packages/backend/src/server/api/endpoints/users/update-memo.ts +++ b/packages/backend/src/server/api/endpoints/users/update-memo.ts @@ -14,7 +14,8 @@ import { ApiError } from '../../error.js'; export const meta = { tags: ['account'], - requireCredential: 'always', + requireCredential: true, + requireCredentialSecureMode: true, kind: 'write:account',