MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions28,840 in github.com/PerpetualSoftware/pad

FunctionTestNormalizeAgentNameTrimParity
BUG-4092 / TASK-4044: the web client re-applies this normalizer to agent names (web/src/lib/chat/presence.ts, its test "trims exactly what Go TrimSpac
internal/server/handlers_chat_test.go:998
FunctionTestNormalizeAudience
TestNormalizeAudience pins the boundaries of the slash-trim helper. An over-broad earlier version (#386) trimmed every trailing "/", which would have
internal/oauth/server_test.go:264
FunctionTestNormalizeBaseURL
(t *testing.T)
cmd/pad/configure_test.go:130
FunctionTestNormalizeFilename
(t *testing.T)
internal/attachments/filename_test.go:14
FunctionTestNormalizeFilenameWithSource
BUG-2819: the stored name cannot say where it came from, so the normaliser reports which branch decided it. Every case also checks that the name is No
internal/attachments/filename_source_test.go:9
FunctionTestNormalizeGitRemoteSlug
(t *testing.T)
internal/cli/workspace_context_detect_test.go:97
FunctionTestNormalizeItemLinkType
(t *testing.T)
internal/models/item_links_test.go:5
FunctionTestNormalizeMIME
(t *testing.T)
internal/attachments/mime_test.go:8
FunctionTestNormalizeOrigin
(t *testing.T)
internal/appmanifest/manifest_test.go:155
FunctionTestNormalizeRecoveryCode
(t *testing.T)
internal/server/handlers_2fa_recovery_test.go:8
FunctionTestNormalizeRuleCanonicalOrder
(t *testing.T)
internal/schedule/shorthand_test.go:45
FunctionTestNormalizeRuleMalformedTyped
(t *testing.T)
internal/schedule/shorthand_test.go:52
FunctionTestNormalizeRuleStripsPrefix
(t *testing.T)
internal/schedule/shorthand_test.go:37
FunctionTestNormalizeStringEncodedJSONFields_ItemArray
TestNormalizeStringEncodedJSONFields_ItemArray covers list-style responses where every entry has stringified fields/tags. Each item gets normalized in
internal/mcp/bug991_test.go:46
FunctionTestNormalizeStringEncodedJSONFields_LeavesUnrelatedStringsAlone
TestNormalizeStringEncodedJSONFields_LeavesUnrelatedStringsAlone is the safety net: free-form `tags` / `fields` keys outside item contexts (e.g. `meta
internal/mcp/bug991_test.go:122
FunctionTestNormalizeStringEncodedJSONFields_NestedItem
TestNormalizeStringEncodedJSONFields_NestedItem covers shapes with items embedded inside a wrapping envelope (e.g. dashboard's active_items, recent_ac
internal/mcp/bug991_test.go:81
FunctionTestNormalizeStringEncodedJSONFields_PrimitivesPassThrough
TestNormalizeStringEncodedJSONFields_PrimitivesPassThrough confirms the walk doesn't bomb on primitive values at any depth. Any non- (map|slice) input
internal/mcp/bug991_test.go:151
FunctionTestNormalizeStringEncodedJSONFields_SingleItem
TestNormalizeStringEncodedJSONFields_SingleItem covers the most common shape — a single-item response with stringified `fields` and `tags`. After the
internal/mcp/bug991_test.go:13
FunctionTestNormalizeWebhookEvents_HandlesArrayInput
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:651
FunctionTestNormalizeWebhookEvents_OmitsEmpty
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:668
FunctionTestNormalizeWebhookEvents_PassesThroughValidJSONArray
(t *testing.T)
internal/mcp/dispatch_http_routes_extras_test.go:639
FunctionTestNormalizeWorkspaceSettingsRejectsInvalidJSON
(t *testing.T)
internal/models/workspace_settings_test.go:92
FunctionTestNormalizedAttackNamesAreRefusedByTheBlocklist
The adversarial property, per attack name. The raw name PASSES the blocklist (the counterfactual: this is the bypass, measured rather than asserted),
internal/attachments/filename_test.go:109
FunctionTestNotFoundPreservesDetails
TestNotFoundPreservesDetails confirms the enriched *APIError carries the server's original Details verbatim, so structured consumers (JSON envelopes,
internal/cli/item_notfound_test.go:76
FunctionTestNote_NewServer_OnePatchCarryingOnlyTheAppend
(t *testing.T)
cmd/pad/notes_append_gate_test.go:99
FunctionTestNote_OldServer_LegacyPathExactlyOnce
TestNote_OldServer_LegacyPathExactlyOnce is a required leg: a server that does not advertise the flag and ignores append_* gets today's full-fields wr
cmd/pad/notes_append_gate_test.go:128
FunctionTestNote_ServerRefusalCarriesTheStructuredMarker
TestNote_ServerRefusalCarriesTheStructuredMarker: on the append path the unreadable-state refusal comes from the server as a 409; the CLI must still e
cmd/pad/notes_append_gate_test.go:167
FunctionTestNote_UnconfirmedAppendIsReportedNotRetried
TestNote_UnconfirmedAppendIsReportedNotRetried: the post-write check is an assertion. When it fails the command errors and sends nothing more.
cmd/pad/notes_append_gate_test.go:150
FunctionTestNotificationEnrichment_ActorGetUserErrorReturns500
TASK-4051: an unreadable actor is an operational error after the recipient passes the access gate, so enrichment returns 500. Kills: M4b.
internal/server/task3939b2b_notification_test.go:429
FunctionTestNotificationEnrichment_AppTokenGetsOneAnswerForEveryId
An installed app authenticates with a padapp_ token, which opens the api/app/v1 router only. Presented to this account-level route the token is not a
internal/server/task3939b2b_notification_test.go:400
FunctionTestNotificationEnrichment_DisabledUserGetsOneRefusalForEveryId
A disabled account is refused by RequireAuth before the handler, for every id. Through the real router, with the user's own live session, a REAL notif
internal/server/task3939b2b_notification_test.go:376
FunctionTestNotificationEnrichment_ExcerptCollapsesWhitespaceAndKeeps140Runes
(t *testing.T)
internal/server/task3939b2b_notification_test.go:214
FunctionTestNotificationEnrichment_GateDenialsAreOneIndistinguishable404
Every denial of the shared gate answers the bytes a missing id answers, and every other row (settings off, no device, the controls) resolves: a settin
internal/server/task3939b2b_notification_test.go:50
FunctionTestNotificationEnrichment_OtherUsersGetTheMissingIdBytes
Another user's row and a missing id are the same bytes.
internal/server/task3939b2b_notification_test.go:113
FunctionTestNotificationEnrichment_OwnerGetUserErrorReturns500
TASK-4051: an unreadable owner must produce 500 in the name fallback. internal/store/workspaces.go:308 uses COALESCE on the owner username, so an exis
internal/server/task3939b2b_notification_test.go:421
FunctionTestNotificationEnrichment_PathMatchesTheWebRouteTree
The path is a route of the web app: one leading slash and the four segments of web/src/routes/[username]/[workspace]/[collection]/[slug].
internal/server/task3939b2b_notification_test.go:190
FunctionTestNotificationEnrichment_PinnedTokenRefused
A token pinned to one workspace is refused: this is an account-level route.
internal/server/task3939b2b_notification_test.go:244
FunctionTestNotificationEnrichment_SettingsNeverGovernRead
A notification setting that is off governs the push only. The endpoint must not consult it: an already delivered push still resolves.
internal/server/task3939b2b_notification_test.go:94
FunctionTestNotificationEnrichment_ShapeForEachKind
(t *testing.T)
internal/server/task3939b2b_notification_test.go:156
FunctionTestNotificationEnrichment_TombstonedCommentTextNeverLeaks
A tombstoned comment's text never reaches the response, in any form.
internal/server/task3939b2b_notification_test.go:132
FunctionTestNotificationEnrichment_Unauthenticated401
(t *testing.T)
internal/server/task3939b2b_notification_test.go:235
FunctionTestNotificationEnrichment_UnpinnedBearerTokenReadsItsOwnRow
An unpinned personal API token resolves its own user's notification through the router, as docs/api.md promises (TASK-3939).
internal/server/task3939b2b_notification_test.go:253
FunctionTestNotificationEnrichment_UnresolvableOwnerHasNoDeepLink
BUG-4050: a live workspace whose owner_id names no users row has no owner to put in the route. The notification is still legitimate, so it reads 200 w
internal/server/task3939b2b_notification_test.go:474
FunctionTestNotificationIDChunkHoldsAGatewayBatch
TASK-4051 r1 D2: a dispatcher tick claims at most notify.MaxBatch rows, so RecordNotificationsSent sees them in one chunk and the tick's recordedPrefi
internal/store/task3939_push_dispatch_test.go:857
FunctionTestNotificationSettings_Auth
Any authenticated user may use the settings, a PAT included; an app principal and a workspace-pinned PAT may not, the latter refused by the BUG-3982 g
internal/server/handlers_push_devices_test.go:545
FunctionTestNotificationSettings_DefaultsAndPut
Kills: wrong defaults; a partial update on put; losing a zeroed field.
internal/store/notification_settings_test.go:71
FunctionTestNotificationSettings_DefaultsAndUnknownKey400
(t *testing.T)
internal/server/handlers_push_devices_test.go:497
FunctionTestNotificationSettles_CoverMoreIDsThanOneChunk
Kills: RecordNotificationsSent or HeldNotifications handling only the first notificationIDChunk ids of a longer list.
internal/store/task3939b_settle_test.go:139
FunctionTestNotificationSubject
Kills: dropping `i.deleted_at IS NULL`; dropping `c.deleted_at IS NULL`; turning the join into one that ignores the collection.
internal/store/task3939_push_dispatch_test.go:562
FunctionTestNotifications_EmptyClaimTokenRefused
Kills: dropping the empty-token guard (an empty token matches every unclaimed row).
internal/store/task3939_push_dispatch_test.go:258
FunctionTestNotify_AssignByOtherEnqueues_SelfAssignDoesNot
Assigning to someone else enqueues for them; assigning yourself does not. Kills: dropping the UpdateItem hook (no row); dropping the `!= actor` check
internal/store/notifications_test.go:44
FunctionTestNotify_ClaimEmptiesDevicesQueueAndSettings
A claim keeps the user row for a new person, so the old holder's devices, queued pushes and settings must not follow. The devices also die with the se
internal/store/notifications_test.go:278
FunctionTestNotify_CommentRecipients
(t *testing.T)
internal/store/notifications_test.go:132
FunctionTestNotify_CreateWithAssigneeEnqueues
Kills: dropping the createItemTxWithID hook.
internal/store/notifications_test.go:72
FunctionTestNotify_DedupeKeyIdempotent
Kills: removing ON CONFLICT (an error) or the unique index.
internal/store/notifications_test.go:251
FunctionTestNotify_FencedCommentEnqueues
The fenced (app) comment path enqueues too. Kills: dropping the fenced hook.
internal/store/notifications_test.go:177
FunctionTestNotify_MentionNotOnBackfillOrCopy
Kills: enqueueing inside reindexCommentMentionsTx (the backfill would notify); dropping the visibility gate (dave, a non-member, gets a row).
internal/store/task3946_mention_notify_test.go:130
FunctionTestNotify_MentionOnCreateAndEditAdd
Kills: dropping the create hook or either edit hook (no row); dropping the author skip (A's self-mention writes a row); notifying kept mentions on edi
internal/store/task3946_mention_notify_test.go:47
FunctionTestNotify_MentionSupersedesComment
Kills: adding mentions after the item's people on create (bob gets a comment row); dropping the supersede DELETE (pending: two rows); dropping its pus
internal/store/task3946_mention_notify_test.go:216
FunctionTestNotify_NoDeviceNoRow
A user with no device accumulates nothing. Kills: removing the WHERE EXISTS (push_devices) gate.
internal/store/notifications_test.go:96
FunctionTestNotify_ReminderRecipient
Kills: firing without the hook; inverting assignee-else-creator; dropping fired_at from the key.
internal/store/notifications_test.go:215
FunctionTestNotify_RollbackDropsRow
The row commits with the write or not at all. Kills: writing the row on a connection outside the caller's transaction.
internal/store/notifications_test.go:111
FunctionTestNulRefusalRemedyNeverCarriesDocumentText
The manifest keep-path remedy is fixed text only. The repair's Declined reason is built from the document and can name a member from the payload; it m
internal/server/task4278_keep_path_message_test.go:169
FunctionTestNumericSecretsAreMasked
(t *testing.T)
internal/logging/redaction_followups_test.go:1061
FunctionTestOAuthClientPublicInfo_HappyPath
===================================================================== api/v1/oauth/clients/{id}/public-info (sub-PR E, TASK-1027) ====================
internal/server/handlers_mcp_test.go:859
FunctionTestOAuthClientPublicInfo_NotMountedOutsideCloudMode
TestOAuthClientPublicInfo_NotMountedOutsideCloudMode confirms the cloud-mode gate covers the endpoint — self-hosted deployments without the OAuth surf
internal/server/handlers_mcp_test.go:956
FunctionTestOAuthClientPublicInfo_Unauthenticated_401
TestOAuthClientPublicInfo_Unauthenticated_401 confirms the auth gate works — reading client metadata requires a session, so an attacker can't enumerat
internal/server/handlers_mcp_test.go:937
FunctionTestOAuthClientPublicInfo_UnknownClient_404
TestOAuthClientPublicInfo_UnknownClient_404 confirms an unknown client ID gets 404, not 401 (caller IS authenticated; the resource just doesn't exist)
internal/server/handlers_mcp_test.go:917
FunctionTestOAuthConnectionAccess_ExplicitListReturnsSortedSlugs
(t *testing.T)
internal/store/oauth_connections_test.go:158
FunctionTestOAuthConnectionAccess_NoRowFallsBack
(t *testing.T)
internal/store/oauth_connections_test.go:110
FunctionTestOAuthConnectionAccess_WildcardSkipsJoin
(t *testing.T)
internal/store/oauth_connections_test.go:125
FunctionTestOAuthConnections_AddWorkspaceIdempotent
(t *testing.T)
internal/store/oauth_connections_test.go:195
FunctionTestOAuthConnections_CreateGetRoundTrip
(t *testing.T)
internal/store/oauth_connections_test.go:65
FunctionTestOAuthConnections_DeleteCascadesJoinTable
(t *testing.T)
internal/store/oauth_connections_test.go:290
FunctionTestOAuthConnections_GetMissingReturnsSentinel
(t *testing.T)
internal/store/oauth_connections_test.go:101
FunctionTestOAuthConnections_RemoveWorkspaceIdempotent
(t *testing.T)
internal/store/oauth_connections_test.go:222
FunctionTestOAuthConnections_RenameAndScopeFlagsRequireExistingRow
(t *testing.T)
internal/store/oauth_connections_test.go:250
FunctionTestOAuthConnections_RenameAndScopeFlagsTouchUpdatedAt
(t *testing.T)
internal/store/oauth_connections_test.go:261
FunctionTestOAuthFormBodyRefusesUnbindableText
TestOAuthFormBodyRefusesUnbindableText drives the three sinks measured to answer 500 (BUG-2811 checkpoint 1) through the real router. The control leg
internal/server/middleware_form_body_test.go:54
FunctionTestOAuthLink_AppleProvider_Links
TestOAuthLink_AppleProvider_Links exercises the second allowlist site (handleOAuthLink) through the real handler, proving the shared helper was wired
internal/server/handlers_oauth_provider_test.go:149
FunctionTestOAuthLogin_AppleProvider_CreatesAndLinksUser
(t *testing.T)
internal/server/handlers_oauth_provider_test.go:33
FunctionTestOAuthLogin_AppleProvider_StillRequiresVerifiedEmail
(t *testing.T)
internal/server/handlers_oauth_provider_test.go:88
FunctionTestOAuthLogin_NonTOTPUser_StillGetsSession
The control: the same door for the same kind of account WITHOUT TOTP still mints the session, so the refusal above is the TOTP check and not some othe
internal/server/handlers_bug3322_totp_doors_test.go:129
FunctionTestOAuthLogin_SessionTTLMatchesWebSession
TestOAuthLogin_SessionTTLMatchesWebSession guards B9 (TASK-1932): OAuth sessions used to mint a 30-day cookie while every other web login (and the und
internal/server/handlers_oauth_provider_test.go:112
FunctionTestOAuthLogin_TOTPChallenge_BindsForwardedIPOnlyFromTrustedPeer
The challenge binds to clientIP. The sidecar calls pad server-side, so the browser's address arrives only as a forwarded header, which pad must honour
internal/server/handlers_bug3322_totp_doors_test.go:150
FunctionTestOAuthLogin_TOTPUser_GetsChallengeNotSession
(t *testing.T)
internal/server/handlers_bug3322_totp_doors_test.go:79
FunctionTestOAuthLogin_UnknownProvider_Rejected
(t *testing.T)
internal/server/handlers_oauth_provider_test.go:186
FunctionTestOAuthMetrics_IncrementsAndHistogramBuckets
TestOAuthMetrics_IncrementsAndHistogramBuckets mirrors the MCP test for the OAuth-flow surface. Same shape, different metric set.
internal/metrics/metrics_test.go:182
FunctionTestOAuthRegisterRefusesNULBody
TestOAuthRegisterRefusesNULBody is the last of three unwired-call-site checks. Reverting handlers_oauth.go to a bare json.NewDecoder — losing both the
internal/server/decode_json_nul_test.go:946
FunctionTestOAuthScopesToJSON_FailClosedOnEmpty
TestOAuthScopesToJSON_FailClosedOnEmpty pins the following: OAuth's `scope` parameter is optional per RFC 6749 §3.3, so fosite can hand back a token w
internal/server/handlers_mcp_test.go:823
FunctionTestOAuthSweepCutoffs
The cutoffs follow the running server's lifespans, each padded by the grace; codes add the code lifespan to the refresh lifespan, since the first refr
internal/server/oauth_sweep_test.go:176
FunctionTestOAuthSweep_LiveChainAndReplay
(t *testing.T)
internal/server/oauth_sweep_test.go:55
FunctionTestOAuth_AccessToken_CRUDAndDelete
------------------------------------------------------------ Access tokens ------------------------------------------------------------
internal/store/oauth_test.go:298
FunctionTestOAuth_AuthorizationCode_CRUDAndInvalidate
------------------------------------------------------------ Authorization codes ------------------------------------------------------------
internal/store/oauth_test.go:235
FunctionTestOAuth_AuthorizationServerMetadata_404WhenOAuthDisabled
TestOAuth_AuthorizationServerMetadata_404WhenOAuthDisabled pins With MCP available but no OAuth server, the doc must not 200 with /oauth/{register,aut
internal/server/handlers_oauth_test.go:904
FunctionTestOAuth_AuthorizationServerMetadata_AdvertisesRFC9207IssFlag
TestOAuth_AuthorizationServerMetadata_AdvertisesRFC9207IssFlag: the flag is advertised now that every authorize redirect carries iss (TASK-3321 U0a, o
internal/server/handlers_oauth_test.go:830
FunctionTestOAuth_AuthorizationServerMetadata_AdvertisesRevokeIntrospect
TestOAuth_AuthorizationServerMetadata_AdvertisesRevokeIntrospect asserts sub-PR D's discovery doc additions: revocation_endpoint, introspection_endpoi
internal/server/handlers_oauth_test.go:863
FunctionTestOAuth_AuthorizationServerMetadata_PopulatedShape
===================================================================== Discovery doc — replaces TASK-950's 501 stub ===================================
internal/server/handlers_oauth_test.go:89
FunctionTestOAuth_AuthorizeDecide_DenyRedirectsAccessDenied
(t *testing.T)
internal/server/handlers_oauth_test.go:537
FunctionTestOAuth_AuthorizeDecide_RejectsMissingCSRFToken
===================================================================== oauth/authorize/decide — consent processing ====================================
internal/server/handlers_oauth_test.go:505
← previousnext →21,901–22,000 of 28,840, ranked by callers