MCPcopy Create free account

hub / github.com/Prejudice-Studio/Twilight / functions

Functions2,686 in github.com/Prejudice-Studio/Twilight

FunctionTestPutEmailVerificationReplacesSamePurposeEmail
(t *testing.T)
internal/store/email_verification_test.go:69
FunctionTestRefreshTelegramUsername
TestRefreshTelegramUsername 覆盖被动刷新的三种情形:用户名变化写库、空用户名 保留旧值、未绑定 telegram id 安全 no-op。
internal/api/telegram_username_refresh_test.go:11
FunctionTestRegCodeRandomAlgorithmsAndFormatFallback
(t *testing.T)
internal/api/app_test.go:3796
FunctionTestRegCodesPersistAcrossStoreReopen
(t *testing.T)
internal/store/store_test.go:186
FunctionTestRegcodeDTOAndUsersExposeLegacyUsedBy
(t *testing.T)
internal/api/app_test.go:4786
FunctionTestRegcodeFormatsAreSeparatedWithLegacyFallback
(t *testing.T)
internal/api/app_test.go:3822
FunctionTestRegcodeGrantHistoryBlocksSelfUnbindAndRepeatRegistrationGrant
(t *testing.T)
internal/api/app_test.go:4147
FunctionTestRegcodeInviteMediaAndSecurityFlows
(t *testing.T)
internal/api/app_test.go:845
FunctionTestRegcodeUsageRecordsDoNotBlockSelfUnbindWithoutUserGrantLock
(t *testing.T)
internal/api/app_test.go:4192
FunctionTestRegcodeWritesBlockedWhenRuntimeDatabaseMismatchesConfig
(t *testing.T)
internal/api/app_test.go:119
FunctionTestRegcodesPersistAcrossAppRestartButBindCodesDoNot
(t *testing.T)
internal/api/app_test.go:251
FunctionTestRegisterCodeCapacityExcludesCodeBeingConsumedAndRejectsBoundUser
(t *testing.T)
internal/api/app_test.go:4858
FunctionTestRegisterCodeLimitConsumesRegcodeAtomically
(t *testing.T)
internal/api/app_test.go:4097
FunctionTestRegisterCodeLimitHonorsTelegramTarget
(t *testing.T)
internal/api/app_test.go:4059
FunctionTestRegisterConsumesConfirmedTelegramBindCode
(t *testing.T)
internal/api/app_test.go:2139
FunctionTestRegisterRejectsMalformedTelegramBindCodeBeforeLookup
(t *testing.T)
internal/api/app_test.go:2233
FunctionTestRegisterRejectsUserSceneTelegramBindCode
(t *testing.T)
internal/api/app_test.go:2217
FunctionTestRegisterWithTelegramBindCodeAllowsBootstrapAdminUIDOnlyConfig
(t *testing.T)
internal/api/app_test.go:2180
FunctionTestReloadConfigSurfacesLiveAppliedFields
TestReloadConfigSurfacesLiveAppliedFields 锁定 reload 响应里的 `live_applied` 列表必须列出本次实际生效的 cookie 配置(session_cookie / cookie_secure / cookie_samesite / coo
internal/api/app_test.go:1479
FunctionTestRenewEndpointHonorsPermanentRegcode
(t *testing.T)
internal/api/app_test.go:4620
FunctionTestRenewReactivatesDisabledNonInvitedUser
TestRenewReactivatesDisabledNonInvitedUser 锁定 R62-2 不变量: check_expired 把"非邀请"过期账号设成 Active=false 后,任何续费路径都 必须把 Active 同步复位到 true,否则用户续完照样登不上,admin 续完看
internal/api/app_test.go:5655
FunctionTestRepoURLCannotBeChangedViaWebConfig
TestRepoURLCannotBeChangedViaWebConfig 防回归:[SystemUpdate].repo_url 不得经 网页配置接口改写。被盗管理员会话若能把 origin 指向攻击者 fork,再触发 git 自动 更新即可在服务器上 RCE。saveConfigConten
internal/api/security_fixes_test.go:243
FunctionTestResolveLeafFile
(t *testing.T)
internal/api/safepath_test.go:39
FunctionTestResolveWithinRoot
(t *testing.T)
internal/api/safepath_test.go:11
FunctionTestRevokeAllRebindApprovalsClearsExistingPermissions
TestRevokeAllRebindApprovalsClearsExistingPermissions 锁定一键撤销换绑权限: 把所有 approved 申请置为 revoked,持有者立即失去解绑权限(解绑 403),但仍可 重新提交申请;不影响 pending / used。
internal/api/app_test.go:6243
FunctionTestRewritePostgresDatabaseInKeywordDSN
(t *testing.T)
internal/store/postgres_test.go:21
FunctionTestRewritePostgresDatabaseInURLDSN
(t *testing.T)
internal/store/postgres_test.go:11
FunctionTestRuntimeConfigPathFixedToWorkingDirectory
(t *testing.T)
cmd/twilight/main_test.go:9
FunctionTestRuntimeLogBufferSnapshotCursorOrdering
(t *testing.T)
internal/api/runtime_logs_test.go:5
FunctionTestRuntimeLoggerAppliesLevelAndCapturesStdLog
(t *testing.T)
internal/api/app_test.go:1391
FunctionTestRuntimeLogsJSONBackendCursorAndPrune
(t *testing.T)
internal/store/runtime_log_test.go:8
FunctionTestRuntimeLogsRequireAdminAndRedactSecrets
(t *testing.T)
internal/api/app_test.go:1344
FunctionTestSaveLockedBackupCopyDoesNotLeaveBakTmp
TestSaveLockedBackupCopyDoesNotLeaveBakTmp 锁定 saveLocked 写 .bak 影子副 本时复用 writeFileAtomicSync:tmp 文件必须在 rename 后消失(O_EXCL 保证下 一次写入会因为残留 tmp 直接失败),且 .ba
internal/store/store_test.go:298
FunctionTestSchedulerAutoRunRecordVisibleBeforeReturn
TestSchedulerAutoRunRecordVisibleBeforeReturn 复现 R56-1:之前 daemon 用 `go a.runScheduledJob` 异步起动,AddSchedulerRunReturning 还没落库 daemon 主循环就推进到下一轮 tick,sc
internal/api/app_test.go:3055
FunctionTestSchedulerCleanupBindCodesJobRemoved
(t *testing.T)
internal/api/app_test.go:1767
FunctionTestSchedulerCleanupNoEmbySkipsPendingEntitlements
(t *testing.T)
internal/api/app_test.go:1775
FunctionTestSchedulerCleanupPendingEmbyEntitlementsKeepsWebAccount
(t *testing.T)
internal/api/app_test.go:1813
FunctionTestSchedulerEmbySyncRepairsPlaceholderAndMissingIDs
(t *testing.T)
internal/api/app_test.go:1849
FunctionTestSchedulerEmbySyncRetriesTransient5xx
TestSchedulerEmbySyncRetriesTransient5xx 验证 R61-5 的核心承诺:emby 反代偶发 502 不应让 emby_sync 把用户记成 failed_sync。第一次拉 /Users 返回 502,第二次 才返回正常 JSON——重试 helper 必须把
internal/api/app_test.go:1920
FunctionTestSchedulerEmbySyncSkipsPolicyUpdateWhenRemoteStateMatches
(t *testing.T)
internal/api/app_test.go:1991
FunctionTestSchedulerFinishedRunRedactsPersistentFields
(t *testing.T)
internal/api/app_test.go:3159
FunctionTestSchedulerJobsPreservesFreshExternalRunningHistory
(t *testing.T)
internal/api/app_test.go:3121
FunctionTestSchedulerJobsReconcileStaleRunningHistory
(t *testing.T)
internal/api/app_test.go:3100
FunctionTestSchedulerManualRunUpdatesSingleHistoryEntry
(t *testing.T)
internal/api/app_test.go:3027
FunctionTestSchedulerManualTriggerSpecDisablesAutoRun
(t *testing.T)
internal/api/app_test.go:3083
FunctionTestSchedulerRunSnapshotAndInterruptedMarking
(t *testing.T)
internal/store/scheduler_test.go:102
FunctionTestSchedulerRuntimeParamsPersistInStoreAndDriveRunner
(t *testing.T)
internal/api/app_test.go:3258
FunctionTestSchedulerTerminateIsIdempotentWhenJobAlreadyStopped
(t *testing.T)
internal/api/app_test.go:3187
FunctionTestSchedulerTerminateMarksRunningRunImmediately
(t *testing.T)
internal/api/app_test.go:3200
FunctionTestSchedulerTerminatedRunNotOverwrittenByLateCompletion
(t *testing.T)
internal/api/app_test.go:3232
FunctionTestSelfUnbindDisablesRemoteEmbyBeforeClearingLocalBinding
(t *testing.T)
internal/api/app_test.go:4276
FunctionTestSelfUnbindKeepsLocalBindingWhenRemoteDisableFails
(t *testing.T)
internal/api/app_test.go:4316
FunctionTestSendExpiryRemindersAbortsOnConsecutiveRateLimits
TestSendExpiryRemindersAbortsOnConsecutiveRateLimits 锁定 R61-4 不变量: 提醒批触发连续 5 次 429 后必须 break、把已发送条数 commit 到 result,并在 summary 中暴露 aborted=rate_limite
internal/api/app_test.go:2447
FunctionTestSessionCookieOmitsDomainWhenUnset
TestSessionCookieOmitsDomainWhenUnset 守住单 origin 部署的旧行为:未配置 CookieDomain 时 Set-Cookie 不应写出 Domain= 属性,让浏览器把 cookie 锁回 设置时的精确 host —— 这是单 origin 部署里更窄的
internal/api/app_test.go:6015
FunctionTestSessionCookieRespectsConfiguredDomain
TestSessionCookieRespectsConfiguredDomain 锁住 R62-cookie-domain 修复: 双子域部署(webui = twilight.example.com / API = twilightapi.example.com) 必须把 session coo
internal/api/app_test.go:5967
FunctionTestSetSchedulerScheduleDeletesCustomWhenDefault
(t *testing.T)
internal/store/scheduler_test.go:31
FunctionTestSetUserEmailVerifiedConflictAndForce
(t *testing.T)
internal/store/email_verification_test.go:97
FunctionTestSetupCompleteCreatesAdminWritesConfigAndCloses
(t *testing.T)
internal/api/setup_handlers_test.go:105
FunctionTestSetupCompleteRequiresWebIntent
(t *testing.T)
internal/api/setup_handlers_test.go:93
FunctionTestSetupStatusAvailableOnEmptySystem
(t *testing.T)
internal/api/setup_handlers_test.go:73
FunctionTestSetupUnavailableWithoutSetupMode
(t *testing.T)
internal/api/setup_handlers_test.go:157
FunctionTestSharedHTTPClientFollowsSameHostRedirect
TestSharedHTTPClientFollowsSameHostRedirect 锁定同主机 302 仍然能正常 follow, 避免 CheckRedirect 把合理的 trailing-slash / index 重定向也禁掉。
internal/api/app_test.go:5543
FunctionTestSharedHTTPClientRefusesCrossHostRedirect
TestSharedHTTPClientRefusesCrossHostRedirect 锁定 sharedHTTPClient 的 CheckRedirect 策略:跨主机 302 必须被拒绝,调用方拿到 redirect 错误而非 让 token / api_key 等自定义凭据被 Go 默认
internal/api/app_test.go:5502
FunctionTestSigninRenewalSpendsPointsWhenEnabled
(t *testing.T)
internal/api/app_test.go:1008
FunctionTestSigninResponsesMatchFrontendContract
(t *testing.T)
internal/api/app_test.go:965
FunctionTestStaleStoreWriteDoesNotDropRegCodes
(t *testing.T)
internal/store/store_test.go:208
FunctionTestStatusResponseWriterForwardsFlush
(t *testing.T)
internal/api/app_test.go:615
FunctionTestSystemUpdateRejectsUnsafeRepoURL
(t *testing.T)
internal/api/app_test.go:1333
FunctionTestSystemUpdateValidationHelpers
(t *testing.T)
internal/api/app_test.go:1691
FunctionTestTargetedRegcodesAreCreatedListedAndEnforced
(t *testing.T)
internal/api/app_test.go:3906
FunctionTestTelegramAnonymousGroupUserAuthDeletesCommandMessageAfterPanel
(t *testing.T)
internal/api/app_test.go:2714
FunctionTestTelegramAnonymousGroupUserRequiresInlineAuth
(t *testing.T)
internal/api/app_test.go:2622
FunctionTestTelegramBindConfirmLoopbackOnly
TestTelegramBindConfirmLoopbackOnly 锁定 bind-confirm 的新鉴权模型:不再校验 共享密钥,改为“同机回环直连 + 无反代转发头”才放行,外部一律拒绝。覆盖三种来源: - 外部 IP(默认 RemoteAddr)→ 拒; - 回环直连、无代理头(= 独立
internal/api/app_test.go:2252
FunctionTestTelegramBindRequirementSplitsGroupAndChannel
(t *testing.T)
internal/api/app_test.go:2523
FunctionTestTelegramCustomCommandsParseReplies
(t *testing.T)
internal/config/config_test.go:332
FunctionTestTelegramEndpointAcceptsCommonBaseURLs
(t *testing.T)
internal/api/app_test.go:2353
FunctionTestTelegramEndpointRejectsUnsafeBaseURLs
TestTelegramEndpointRejectsUnsafeBaseURLs 验证 telegramEndpoint 现在会 否决 link-local / 元数据 IP / 非 http(s) scheme 的 base URL,避免 bot token 在拼出 /bot<TOKEN>/me
internal/api/app_test.go:2377
FunctionTestTelegramErrorRedactsBotToken
(t *testing.T)
internal/api/app_test.go:2395
FunctionTestTelegramForceBindGroupAndChannelConfig
(t *testing.T)
internal/config/config_test.go:158
FunctionTestTelegramGetUpdatesAllowsCallbacks
(t *testing.T)
internal/api/app_test.go:2492
FunctionTestTelegramGrantRegisterActionSetsPendingEntitlement
(t *testing.T)
internal/api/app_test.go:5192
FunctionTestTelegramGroupUserPanelCustomTemplatePlaceholders
(t *testing.T)
internal/api/app_test.go:2828
FunctionTestTelegramGroupUserPanelDeletesCommandMessageAfterSend
(t *testing.T)
internal/api/app_test.go:2667
FunctionTestTelegramGroupUserPanelShowsEmbyInfoAndActions
(t *testing.T)
internal/api/app_test.go:2793
FunctionTestTelegramMembershipEnforcementUsesConfiguredConcurrency
(t *testing.T)
internal/api/app_test.go:2092
FunctionTestTelegramMembershipRejoinManualReviewAndAutoEnable
(t *testing.T)
internal/api/app_test.go:2045
FunctionTestTelegramPanelCloseRequiresAdminAndDeletesPanel
(t *testing.T)
internal/api/app_test.go:2855
FunctionTestTelegramPanelEmbyDeleteRequiresConfirmAndClearsLocalBinding
(t *testing.T)
internal/api/app_test.go:2919
FunctionTestTelegramProtectedTargetUsesUnifiedProtectedUsers
(t *testing.T)
internal/api/app_test.go:2988
FunctionTestTelegramRetryAfterFromError
TestTelegramRetryAfterFromError 锁定 R61-3 不变量:telegramPost 在 OK=false + parameters.retry_after>0 时必须把秒数编进错误字符串, telegramRetryAfterFromError 反解出来后调用方才能
internal/api/app_test.go:2415
FunctionTestTelegramRosterStatsUsesObservedMembers
(t *testing.T)
internal/api/app_test.go:5220
FunctionTestTelegramTargetedRegcodesAreCreatedListedAndEnforced
(t *testing.T)
internal/api/app_test.go:3979
FunctionTestTelegramTouchPanelReusesSingleTimer
TestTelegramTouchPanelReusesSingleTimer 锁定 R52-2:多次 touch 同一个 panel 不应累积 *time.Timer 实例。历史实现每次 touch 调 AfterFunc 新建 一个 closure,旧定时器从不取消,admin 高频按钮场景下单
internal/api/app_test.go:2588
FunctionTestTicketGlobalOpenLimitEnforced
TestTicketGlobalOpenLimitEnforced 验证「管理员全局工单数量上限」服务端硬门 (子需求 B)。
internal/api/ticket_handlers_test.go:113
FunctionTestTicketImageTooLarge
TestTicketImageTooLarge 验证单张图片大小上限 (子需求 C)。
internal/api/ticket_handlers_test.go:196
FunctionTestTicketImageUploadAndValidation
TestTicketImageUploadAndValidation 验证图片上传成功 + 类型校验 + 数量上限 (子需求 C/D)。
internal/api/ticket_handlers_test.go:137
FunctionTestTicketTypeAddPersistsToConfigFile
TestTicketTypeAddPersistsToConfigFile 通过 HTTP 入口新增工单类型,断言它真正 落盘到 config.toml(这是重启 / 热重载后仍保留的唯一持久化来源)。
internal/api/ticket_type_repro_test.go:45
FunctionTestTicketUserOpenLimitEnforced
TestTicketUserOpenLimitEnforced 验证「每人同时处理中/待处理工单上限」服务端硬门 (子需求 A)。
internal/api/ticket_handlers_test.go:89
FunctionTestUnbindAlwaysRequiresApprovalEvenWithoutForceBind
TestUnbindAlwaysRequiresApprovalEvenWithoutForceBind 锁定用户反馈:关闭 force_bind_telegram 时,非管理员解绑同样必须先拿到 approved 换绑申请(用过即 作废),杜绝"自助无限解绑/重绑"。每次更换都需管理员批准一次。
internal/api/app_test.go:6316
FunctionTestUpdateDevicePreservesFlagsOnRelogin
TestUpdateDevicePreservesFlagsOnRelogin 锁定登录改用 UpdateDevice 后的不变量: 再次「登录」(更新 UA/IP/LastSeen)不得清掉 FirstSeen / Trusted / Blocked。
internal/store/device_limit_test.go:55
← previousnext →2,101–2,200 of 2,686, ranked by callers