MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions7,856 in github.com/PerpetualSoftware/pad

↓ 18 callersFunctionEncode
Encode serializes an Artifact to its portable on-disk form: --- <yaml frontmatter> --- <body> Output is deterministic: two Encode calls on the
internal/artifact/encode.go:23
↓ 18 callersFunctionassertAllowed
(t *testing.T, got CrossWorkspaceAccess, label string)
internal/server/authz_cross_workspace_test.go:186
↓ 18 callersFunctionclientIP
clientIP extracts the client IP from RemoteAddr. This is safe because TrustedProxyRealIP runs earlier in the chain and — when a trusted proxy is confi
internal/server/middleware_ratelimit.go:532
↓ 18 callersFunctionconnectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 18 callersFunctioncreateViaTx
Tests for createItemTx — the tx-taking counterpart of CreateItem (PLAN-2357 / DR-9a). Each test below pins one line of the DR-9a parity checklist: slu
internal/store/items_create_tx_test.go:22
↓ 18 callersMethodlogAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:340
↓ 18 callersFunctionrequireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callersFunctionsessionCookieName
sessionCookieName returns the session cookie name. When running over TLS (secureCookies=true), the __Host- prefix is used to prevent subdomain cookie
internal/server/handlers_auth.go:45
↓ 18 callersFunctionsetupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 18 callersFunctionstrPtr
(s string)
internal/store/timeline_pagination_test.go:186
↓ 17 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:232
↓ 17 callersMethodApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on success; one of the sen
internal/collab/applier.go:242
↓ 17 callersMethodGetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 17 callersMethodGetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:197
↓ 17 callersMethodPublish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: full subscriber channels drop the event with a warnin
internal/collab/bus.go:108
↓ 17 callersMethodSetCloudSidecar
SetCloudSidecar installs the reverse pad → pad-cloud client. Called from cmd/pad/main.go when PAD_CLOUD_SIDECAR_URL + PAD_CLOUD_SECRET are set. When u
internal/server/server.go:524
↓ 17 callersFunction__resetViewerBackdropForTests
()
web/src/lib/a11y/viewerBackdrop.ts:496
↓ 17 callersFunctiondispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1248
↓ 17 callersFunctionerrCode
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_copy_preflight_test.go:216
↓ 17 callersFunctionmustItem
(t *testing.T, srv *Server, wsID, collID, title string)
internal/server/authz_cross_workspace_test.go:114
↓ 17 callersFunctiontestServerWithCollab
testServerWithCollab wires a RoomManager onto a fresh test server so the collab handler answers 200/101 on the happy path. Tests that only assert on a
internal/server/handlers_collab_test.go:21
↓ 17 callersFunctiontestStoreOAuth
Tests for the OAuth server constructor + audience strategy + storage adapter (PLAN-943 TASK-951 sub-PR B). Each layer is covered: - NewServer: requir
internal/oauth/server_test.go:40
↓ 16 callersMethodCreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 callersMethodGetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:853
↓ 16 callersMethodGetOAuthConnection
GetOAuthConnection fetches the connection row by request_id. Returns ErrOAuthConnectionNotFound if no row exists; any other error is a real I/O failur
internal/store/oauth_connections.go:106
↓ 16 callersFunctionNewProcessor
NewProcessor returns the Processor compiled into this binary. Pure-Go build → pureGoProcessor. libvips build → vipsProcessor (Phase 2). Constructed o
internal/attachments/processor_purego.go:43
↓ 16 callersMethodPublish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:139
↓ 16 callersMethodPut
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:40
↓ 16 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel. Safe to call with an already-removed channel — no-op in that case.
internal/collab/bus.go:102
↓ 16 callersFunctionWithTokenAllowedWorkspaces
WithTokenAllowedWorkspaces returns ctx decorated with the OAuth token's workspace allow-list set at consent time (TASK-952). The list is either a set
internal/server/context.go:140
↓ 16 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:240
↓ 16 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2626
↓ 16 callersFunctionclassifyExecError
classifyExecError turns an exec.Cmd failure (err + stderr) into a structured envelope. lookup is optional — when supplied, no_workspace errors get ava
internal/mcp/errors.go:435
↓ 16 callersFunctioncreateTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:257
↓ 16 callersFunctionnewMovedToFixture
(t *testing.T)
internal/server/item_moved_to_test.go:49
↓ 16 callersMethodnewRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1554
↓ 16 callersFunctionrender
()
web/src/lib/components/timeline/ItemTimeline.svelte.test.ts:218
↓ 16 callersFunctiontick
()
web/src/lib/components/editor/block-drag-handle.ts:709
↓ 15 callersFunctionDefaultConfig
()
internal/config/config.go:89
↓ 15 callersMethodDeleteWorkspace
(slug string)
internal/store/workspaces.go:255
↓ 15 callersMethodJSONExtractText
JSONExtractText returns SQL to extract a text value from a JSON column. SQLite: json_extract(col, '$.key') PostgreSQL: col->>'key'
internal/store/dialect.go:33
↓ 15 callersFunctionNewDispatcher
NewDispatcher creates a Dispatcher with the given store. The delivery client enforces the SSRF guard at connect time, not just at parse time: its dia
internal/webhooks/dispatcher.go:115
↓ 15 callersMethodSeedDefaultCollections
SeedDefaultCollections rescues a workspace that ended up with zero collections by seeding it with the standard Software-shape Defaults(). It is intent
internal/store/collections.go:699
↓ 15 callersMethodSetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:315
↓ 15 callersMethodarchiveSource
()
internal/server/item_moved_to_test.go:108
↓ 15 callersFunctionbearerCall
(t *testing.T, srv *Server, method, path, token string, body []byte)
internal/server/handlers_watches_test.go:62
↓ 15 callersMethodbearerHeaders
()
internal/server/handlers_grant_visibility_test.go:104
↓ 15 callersFunctionpostOAuthForm
postOAuthForm POSTs an x-www-form-urlencoded body without any auth (used for /oauth/revoke + /oauth/token, where client_id rides in the form for publi
internal/server/handlers_oauth_test.go:2537
↓ 15 callersFunctionrunAuthCodeFlow
runAuthCodeFlow drives a full /oauth/authorize/decide → /oauth/token exchange and returns the parsed token JSON. Each invocation needs a unique verifi
internal/server/handlers_oauth_test.go:2473
↓ 15 callersFunctionseedParentAndChildren
seedParentAndChildren creates a plan + N child tasks with the given statuses (one per child), returning the parent and the slice of child refs in crea
internal/server/handlers_items_open_children_guard_test.go:24
↓ 15 callersFunctiontestServerWithWatchEvents
(t *testing.T)
internal/server/handlers_watch_events_test.go:17
↓ 15 callersFunctionwaitElectable
waitElectable polls until the room for itemID has at least n conns that pickApplier would actually elect — writable, anchored (replayDone), not frozen
internal/collab/manager_test.go:306
↓ 14 callersMethodApply
Apply walks doc and stamps EnumSource + resolved Enum values on matching args and flags. Resolution failures are silent: the document continues to adv
internal/cmdhelp/dynamic.go:113
↓ 14 callersMethodCreateShareLink
CreateShareLink creates a new share link and returns it with the raw token. The raw token is only available in this response — it is not stored.
internal/store/share_links.go:47
↓ 14 callersFunctionCrossWorkspaceWorkspaceOnlyScope
CrossWorkspaceWorkspaceOnlyScope requests a WORKSPACE-LEVEL CHECK ONLY, which is almost never sufficient on its own. It answers "does this caller hav
internal/server/authz_cross_workspace.go:374
↓ 14 callersMethodD
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:72
↓ 14 callersMethodFetch
(ctx context.Context, args []string)
internal/mcp/resources.go:47
↓ 14 callersMethodGetItemLinks
GetItemLinks returns links where the given item is either source or target. Links pointing to or from soft-deleted items are filtered out so callers (
internal/store/items.go:3029
↓ 14 callersMethodGetMemberCollectionAccess
GetMemberCollectionAccess returns the collection IDs a member has been explicitly granted access to (only meaningful when collection_access = "specifi
internal/store/workspace_members.go:310
↓ 14 callersMethodIsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:277
↓ 14 callersFunctionLoad
()
internal/config/config.go:105
↓ 14 callersFunctionNewStorage
NewStorage wraps a *store.Store as a fosite-compatible adapter. The store must be a fully-initialized pad store (migrations applied); no validation he
internal/oauth/storage.go:129
↓ 14 callersMethodSeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:735
↓ 14 callersMethodSubscribe
Subscribe registers a subscriber for the given item and returns a buffered channel of OpEvents. Caller is responsible for calling Unsubscribe (typical
internal/collab/bus.go:98
↓ 14 callersFunctionassertSourceSet
(t *testing.T, p *AttachmentCopyPlan, want ...string)
internal/store/attachments_copy_plan_test.go:115
↓ 14 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:543
↓ 14 callersFunctionconnectWatchStream
connectWatchStream connects to GET /api/v1/events/stream with a Bearer token and returns a channel of parsed SSE events.
internal/server/handlers_watch_events_test.go:33
↓ 14 callersMethodcopy
(t *testing.T, req CrossWorkspaceCopyRequest)
internal/store/items_cross_workspace_copy_test.go:54
↓ 14 callersFunctiondialCollab
dialCollab opens a WebSocket against the test server's collab endpoint with the given itemID. Returns the connection and the HTTP response. The respon
internal/server/handlers_collab_test.go:40
↓ 14 callersFunctiondoRequestWithBearer
doRequestWithBearer dispatches a request with an Authorization: Bearer header set. The existing test helpers in server_test.go don't take a token para
internal/server/middleware_auth_public_paths_test.go:25
↓ 14 callersFunctiondoTransform
(srv *Server, slug, attachmentID string, body transformRequestBody)
internal/server/handlers_attachments_transform_test.go:29
↓ 14 callersMethodgetSource
getSource performs GET on the source item exactly as the router would and requires a 200. Use rawGetSource when the status is what is under test.
internal/server/item_moved_to_test.go:124
↓ 14 callersFunctionmcpAndOAuthEnabledTestServer
===================================================================== mcp ↔ OAuth integration (sub-PR E, TASK-1027) ==================================
internal/server/handlers_mcp_test.go:405
↓ 14 callersFunctionpostFormWithCookie
postFormWithCookie POSTs an x-www-form-urlencoded body with both a session cookie and the matching CSRF cookie set, plus the session-bound User-Agent.
internal/server/handlers_oauth_test.go:2403
↓ 14 callersMethodrelease
* Drop the lease. `released` is false on a repeat call (no-op). `stackEmpty` * reports whether any lease remains AFTER this release — the caller use
web/src/lib/a11y/viewerBackdrop.ts:37
↓ 14 callersFunctionrequireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:746
↓ 14 callersFunctionwaitForWatchEvent
(t *testing.T, ch <-chan watchSSEEvent, timeout time.Duration)
internal/server/handlers_watch_events_test.go:74
↓ 14 callersFunctionworkspaceRole
workspaceRole returns the user's role in the current workspace, as set by RequireWorkspaceAccess. Returns empty string if not set.
internal/server/middleware_auth.go:690
↓ 13 callersMethodBackfillOAuthConnections
BackfillOAuthConnections walks every distinct grant chain found in oauth_access_tokens and oauth_refresh_tokens, parses the newest chain row's session
internal/store/oauth_connections_backfill.go:93
↓ 13 callersMethodClose
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:147
↓ 13 callersMethodDispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 13 callersMethodGetCrossWorkspaceBacklinks
GetCrossWorkspaceBacklinks returns inbound `[[ws::REF]]` backlinks pointing at the queried target (`targetWorkspaceID`, `targetRef`) from EVERY OTHER
internal/store/wiki_links.go:1191
↓ 13 callersMethodInsertMCPAuditEntry
InsertMCPAuditEntry persists one audit row. Called from the audit middleware's async writer; the caller owns the buffered channel + the ordering, so t
internal/store/mcp_audit.go:53
↓ 13 callersMethodListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:407
↓ 13 callersMethodListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:297
↓ 13 callersFunctionNormalizeItemLinkType
NormalizeItemLinkType canonicalizes supported link types and returns an error for unknown values.
internal/models/item_links.go:33
↓ 13 callersMethodValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 13 callersMethodVisibleCollectionIDs
VisibleCollectionIDs returns the set of collection IDs a member can see. Returns nil if the member has "all" access (meaning no filtering needed). Sys
internal/store/workspace_members.go:139
↓ 13 callersMethodacquireWorkspaceSeqLock
acquireWorkspaceSeqLock takes a Postgres advisory transaction lock keyed on the workspace ID so concurrent seq-bumping mutations serialize. The lock a
internal/store/items.go:120
↓ 13 callersFunctionbearerJSON
bearerJSON marshals body and issues a Bearer-authenticated request. Needed for any mutation issued AFTER a real user has been created in the test's st
internal/server/handlers_watches_test.go:53
↓ 13 callersFunctionbootstrapAccountDeleteUser
bootstrapAccountDeleteUser creates the first admin user, sets a Stripe customer ID on them, and returns (userID, sessionToken). Used by the handleDele
internal/server/handlers_account_test.go:70
↓ 13 callersMethodcopyOK
copyOK issues the copy as the owner and requires a 201.
internal/server/handlers_items_copy_test.go:94
↓ 13 callersFunctiondeleteAccountReq
deleteAccountReq issues the delete-account request from a client IP that differs from the loopback address bootstrap ran on. The session-IP-change mid
internal/server/handlers_account_test.go:93
↓ 13 callersFunctiondownloadAs
downloadAs issues GET or HEAD on the blob endpoint as a specific user + workspace role, bypassing the auth middleware the same way deleteAsUser does.
internal/server/handlers_attachments_download_authz_test.go:158
↓ 13 callersMethodexecuteRequest
executeRequest builds + serves + packages a single HTTP request against the wrapped handler. Pulled out of Dispatch so the special-case methods (dispa
internal/mcp/dispatch_http.go:445
↓ 13 callersMethodgoAsync
goAsync spawns fn in a goroutine that's tracked by s.bg, so Stop() can wait for in-flight background work to finish. Use this for any fire-and-forget
internal/server/server.go:308
↓ 13 callersFunctionmustSeedWorkspaceWithRole
mustSeedWorkspaceWithRole is a test helper that creates a workspace + adds the user as a member with the given role. Centralized here because TASK-952
internal/server/handlers_oauth_test.go:1821
↓ 13 callersFunctionnewTestClient
Tests for the OAuth 2.1 storage layer (PLAN-943 TASK-951 sub-PR A). The store layer is fosite-agnostic by design — sub-PR B introduces the fosite impo
internal/store/oauth_test.go:22
↓ 13 callersFunctionpassThrough
passThrough returns an ActionFn that forwards the input verbatim to the given cmdPath via env.Dispatch. The vast majority of catalog actions use this
internal/mcp/catalog.go:178
↓ 13 callersMethodrestrictedEditor
--- authorization: the four checks, in order -------------------------- restrictedEditor returns an editor in both workspaces whose membership in each
internal/server/handlers_items_copy_preflight_test.go:652
← previousnext →201–300 of 7,856, ranked by callers