Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
8,091 in github.com/PerpetualSoftware/pad
⨍
Functions
8,091
◇
Types & classes
983
↓ 5 callers
Method
WorkspaceStorageInfo
WorkspaceStorageInfo returns the consolidated quota summary for a workspace (used + limit + plan + override flag) in a single call. Used by the storag
internal/store/attachments.go:1119
↓ 5 callers
Method
WriteHidden
WriteHidden writes the non-disclosing denial: an identical 404 for every failure mode, so absence and forbidden-ness are indistinguishable. This is th
internal/server/authz_cross_workspace.go:201
↓ 5 callers
Function
WritePlanLimitError
WritePlanLimitError formats a plan-limit rejection to w in the canonical two-track shape (TASK-788): 1. A single `pad-structured-error/v1: {json}\n`
internal/cli/client.go:1407
↓ 5 callers
Function
actionItemLink
actionItemLink dispatches pad_item.action=link to the appropriate CLI cmdPath based on link_type. Renames the schema's uniform `ref` and `target` to t
internal/mcp/catalog_item.go:447
↓ 5 callers
Function
actionItemList
actionItemList handles pad_item.action=list. It forwards to `item list` but first applies a default limit (when the agent didn't ask for one) and clam
internal/mcp/catalog_item.go:671
↓ 5 callers
Function
applyConfigureValues
(cfg *config.Config, values *configureValues)
cmd/pad/configure.go:127
↓ 5 callers
Function
assertNotEmailBlocked
assertNotEmailBlocked asserts the response is NOT a verified-email 403 (it may legitimately be a 2xx, or a 4xx for an unrelated reason).
internal/server/middleware_verified_email_test.go:166
↓ 5 callers
Method
attachIn
attachIn creates an original attachment in the given workspace.
internal/store/items_cross_workspace_copy_test.go:64
↓ 5 callers
Method
attachTo
attachTo writes a real 2000x1500 PNG — big enough that BOTH specs must scale down, so a skip is unambiguous — and returns the new row's id. Width/Heig
internal/server/handlers_attachments_thumbnails_parent_test.go:62
↓ 5 callers
Method
authorizeCollabAccess
authorizeCollabAccess mirrors RequireWorkspaceAccess but keyed on the item's workspace ID (the WS URL path doesn't carry a workspace slug). It checks:
internal/server/handlers_collab.go:620
↓ 5 callers
Function
backdateItem
(t *testing.T, s *Store, itemID string, hoursAgo float64)
internal/store/reports_test.go:274
↓ 5 callers
Function
captureStdout
captureStdout runs fn with os.Stdout redirected and returns what it wrote. The list commands print through fmt/os.Stdout rather than cmd.OutOrStdout,
cmd/pad/format_markdown_routing_test.go:48
↓ 5 callers
Function
classifyHTTPStatusKind
classifyHTTPStatusKind turns an HTTP error response into a structured envelope, using the dispatcher's known resource context to emit the right error
internal/mcp/errors.go:753
↓ 5 callers
Function
collectionAccessPath
This file pins BUG-1925: handleSetMemberCollectionAccess gated only on requireRole(r, "owner"), with zero validation of the CALLER's own visibility. A
internal/server/handlers_member_collection_access_escalation_test.go:20
↓ 5 callers
Function
consentScopedRequest
These tests cover BUG-2102: the OAuth consent allow-list was enforced only by RequireWorkspaceAccess, which fires solely for /{slug} path-param routes
internal/server/token_workspace_consent_scope_test.go:29
↓ 5 callers
Function
countAttachmentsIn
(t *testing.T, s *Store, workspaceID string)
internal/store/items_cross_workspace_copy_test.go:113
↓ 5 callers
Method
createAuthSession
(w http.ResponseWriter, r *http.Request, user *models.User, ttl time.Duration)
internal/server/handlers_auth.go:331
↓ 5 callers
Function
createUnverifiedUser
createUnverifiedUser makes a user whose email starts UNVERIFIED, so a consume can be observed flipping it verified. CreateUser's safe default is verif
internal/store/email_verification_test.go:16
↓ 5 callers
Function
decodeBillingStats
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_admin_billing_test.go:101
↓ 5 callers
Function
decodeFields
decodeFields is a small test helper: parse an item's fields JSON into a map.
internal/store/items_fieldpatch_test.go:12
↓ 5 callers
Function
detachLoadListeners
()
web/src/lib/components/editor/attachment-image.ts:537
↓ 5 callers
Function
extractPRFromItem
(item *models.Item)
cmd/pad/cmd_github.go:390
↓ 5 callers
Function
fakeYjsRow
fakeYjsRow constructs a single row for the fakeOpLog seeding helpers. The store assigns ids in production; tests don't depend on them.
internal/collab/manager_test.go:1759
↓ 5 callers
Method
fetchAsResource
fetchAsResource is the shared shell-out + wrap path. padArgs is the leading argument list (without root flags); rootArgs are appended so --url etc. su
internal/mcp/resources.go:558
↓ 5 callers
Function
fieldsPatchOf
(t *testing.T, body map[string]any)
cmd/pad/item_column_fields_test.go:70
↓ 5 callers
Function
fixtureDoc
fixtureDoc returns a small cmdhelp.Document with the items the catalog tests need most often. Catalog actions only require their own cmdPath to be pre
internal/mcp/registry_test.go:51
↓ 5 callers
Function
formatBytes
(bytes: number)
web/src/lib/attachments/display.ts:46
↓ 5 callers
Function
formatItemAsMarkdown
formatItemAsMarkdown turns the JSON body returned by `pad item show --format json` into a self-contained markdown document: heading with ref + title,
internal/mcp/resources.go:348
↓ 5 callers
Function
fullVersion
()
cmd/pad/main.go:35
↓ 5 callers
Function
gaugeValueOrZero
gaugeValueOrZero pulls the gauge value or returns 0 when the underlying metric hasn't been touched yet.
internal/server/middleware_mcp_metrics_test.go:218
↓ 5 callers
Method
getLimiter
(key string)
internal/server/middleware_ratelimit.go:87
↓ 5 callers
Function
goto
(_url: string | URL, _opts?: unknown)
web/src/test/mocks/app-navigation.ts:15
↓ 5 callers
Method
grantHiddenItemToOwner
grantHiddenItemToOwner gives the fixture's restricted owner an item-level grant on the hidden item, independent of their collection_access restriction
internal/server/handlers_grant_visibility_test.go:115
↓ 5 callers
Method
handleControlMessage
handleControlMessage dispatches a TextMessage frame received from a peer: applier_apply_start / applier_ack (the designated-applier bracket, TASK-1257
internal/collab/room.go:606
↓ 5 callers
Method
handleCopyItemPreflight
handleCopyItemPreflight answers "what would this cross-workspace copy do?" without doing any of it. See the file header for the full contract.
internal/server/handlers_items_copy_preflight.go:471
↓ 5 callers
Function
hideHandle
()
web/src/lib/components/editor/block-drag-handle.ts:426
↓ 5 callers
Function
hideMenu
()
web/src/lib/components/editor/block-drag-handle.ts:488
↓ 5 callers
Function
imageRect
(page: Page, selector = VIEWER_IMAGE)
web/e2e/lib/attachment-viewer.ts:267
↓ 5 callers
Function
intPtr
(n int)
internal/cli/item_summary_test.go:11
↓ 5 callers
Function
isItemDone
isItemDone reports whether an item is in a terminal state for its collection's configured done field. Falls back to the default-terminal list against
internal/server/handlers_dashboard.go:245
↓ 5 callers
Function
isPublicAPIPath
isPublicAPIPath reports whether the given request path is an API endpoint that bypasses authentication entirely. These handlers must work even when th
internal/server/middleware_auth.go:341
↓ 5 callers
Function
itemCopyLine
itemCopyLine makes a server-supplied string safe to drop into a table row. Schema keys, labels, option values, link types and validator messages are a
cmd/pad/cmd_item.go:2269
↓ 5 callers
Method
itemLock
itemLock returns the lazily-allocated mutex guarding setup-phase operations on itemID. Locks live in the manager for the lifetime of the process — for
internal/collab/manager.go:233
↓ 5 callers
Function
itemOpenCmdWithOpener
(opener func(string) error)
cmd/pad/cmd_item.go:881
↓ 5 callers
Method
itemsPath
()
internal/server/middleware_verified_email_test.go:115
↓ 5 callers
Function
latchMissing
* Latch the permanent placeholder for a row the server says is * gone. Same end state as the deletion broadcast, reached by a * different rout
web/src/lib/components/editor/attachment-image.ts:549
↓ 5 callers
Function
liftColumnFields
liftColumnFields removes columnFieldKeys entries from `fields` and returns them as column writes. Mutates `fields`. Without this, `--field assigned_u
cmd/pad/cmd_item.go:76
↓ 5 callers
Function
maskAPIKey
maskAPIKey returns the display form of a sensitive setting value. Keys longer than 8 chars show their first and last 4 chars (abcd...wxyz); shorter no
internal/server/handlers_admin.go:93
↓ 5 callers
Function
mintOAuthTokenForTest
mintOAuthTokenForTest drives the consent → token exchange and returns the access token. Lightly customizable via the form arg so callers can vary the
internal/server/handlers_mcp_test.go:1741
↓ 5 callers
Function
mkAdminBearerReq
BUG-1616 extended coverage — admin-via-bearer gate at the SSE and WebSocket-collab entry points that sit OUTSIDE RequireWorkspaceAccess. These endpoin
internal/server/handlers_admin_bearer_gate_test.go:37
↓ 5 callers
Function
mustCreateUser
(t *testing.T, srv *Server, email, name, role string)
internal/server/token_workspace_consent_scope_test.go:45
↓ 5 callers
Function
needsValueByKey
(resp ItemCopyPreflight, key string)
internal/server/handlers_items_copy_preflight_test.go:249
↓ 5 callers
Function
newBearerGateItemFixture
(t *testing.T)
internal/server/handlers_items_test.go:2560
↓ 5 callers
Function
newCopyAttachmentFixture
(t *testing.T)
internal/server/handlers_items_copy_attachment_authz_test.go:56
↓ 5 callers
Function
newCopyFanoutObserver
(t *testing.T, f *copyPreflightFixture)
internal/server/handlers_items_copy_test.go:557
↓ 5 callers
Function
newDerivationFixture
(t *testing.T)
internal/server/handlers_attachments_thumbnails_parent_test.go:35
↓ 5 callers
Function
newWebhookTestWorkspace
newWebhookTestWorkspace creates a user + workspace so webhook FK constraints are satisfied, and returns the workspace ID.
internal/store/webhooks_test.go:16
↓ 5 callers
Function
normalizeCollectionSlug
normalizeCollectionSlug maps common singular/short forms to actual collection slugs. Thin wrapper around the shared collections.NormalizeSlug so the C
cmd/pad/cmd_collection.go:498
↓ 5 callers
Method
observeOAuthFlowDuration
observeOAuthFlowDuration records the elapsed time since `start` for the given stage. Designed to be `defer`'d at the top of each OAuth flow handler so
internal/server/handlers_oauth.go:135
↓ 5 callers
Function
open
* Open the workspace's IDB database for the given user, creating * object stores on first run. Cached so subsequent calls reuse the * connection. Re
web/src/lib/stores/localIndexPersistence.ts:98
↓ 5 callers
Function
paneFocusables
( container: HTMLElement, isVisible: (el: HTMLElement) => boolean = isFocusableVisible, )
web/src/lib/collections/paneFocus.ts:37
↓ 5 callers
Function
parseFieldKVP
parseFieldKVP normalizes the --field flag's various wire shapes (single string, []string, []any) into a `key→value` map. Empty / invalid entries are s
internal/mcp/dispatch_http.go:922
↓ 5 callers
Method
patch
(path string, body interface{}, result interface{})
internal/cli/client.go:1705
↓ 5 callers
Method
pathFor
pathFor returns the full on-disk path for a given hash. Callers MUST have already validated the hash via validHash — this function does not re-check,
internal/attachments/fs_store.go:61
↓ 5 callers
Function
percentile
percentile returns the linearly-interpolated p-quantile (p in [0,1]) of vals, rounded to 1 decimal. 0 for an empty sample. Computed in Go so the same
internal/store/reports.go:944
↓ 5 callers
Function
pollAndSaveCLIAuth
pollAndSaveCLIAuth polls a pending CLI auth session until it is approved, then persists the issued token as credentials for cfg.BaseURL(). It is the s
cmd/pad/cmd_auth.go:468
↓ 5 callers
Function
postOAuthLogin
postOAuthLogin fires a cloud-secret-authenticated oauth-login request and returns the recorder. The cloud secret rides the JSON body (the same channel
internal/server/handlers_oauth_provider_test.go:21
↓ 5 callers
Method
publishEventWithName
publishEventWithName publishes a real-time event with actor name.
internal/server/handlers_documents.go:223
↓ 5 callers
Function
readConfig
(t *testing.T, path string)
internal/mcp/install_test.go:819
↓ 5 callers
Function
reconcile
* Recompute and apply the desired inert set from scratch. This is the ONLY * mutator: release doesn't undo its own writes, it re-derives the truth fr
web/src/lib/a11y/viewerBackdrop.ts:96
↓ 5 callers
Method
recordMCPAuthzDenial
recordMCPAuthzDenial bumps the pad_mcp_authz_denials_total counter when the request originated from the MCP surface. The discriminator is the presence
internal/server/middleware_auth.go:760
↓ 5 callers
Function
remoteCfg
remoteCfg builds a Config wired to point at the given test server URL.
cmd/pad/init_test.go:37
↓ 5 callers
Function
renderItemsGroupedByCollectionMarkdown
renderItemsGroupedByCollectionMarkdown is the markdown counterpart of printItemsGroupedByCollection (#898): one `## Icon Name (N)` heading per collect
cmd/pad/cmd_item.go:564
↓ 5 callers
Method
requireCommentVisible
requireCommentVisible checks that a comment's underlying item is in a visible collection. Writes a 404 and returns false if not.
internal/server/handlers_comments.go:484
↓ 5 callers
Method
resolveAttachmentParentItem
resolveAttachmentParentItem loads and validates the parent item of an attachment row that has ALREADY been established as live and belonging to the re
internal/server/attachments_authz.go:73
↓ 5 callers
Method
resolveRoleSlug
resolveRoleSlug rewrites a `--role <slug>` input into `agent_role_id <uuid>` by hitting the agent-roles endpoint and finding a matching role. Mirrors
internal/mcp/dispatch_http_advanced.go:114
↓ 5 callers
Method
restore
(t *testing.T)
internal/server/handlers_items_collab_versions_test.go:625
↓ 5 callers
Function
retryOnParentSetChanged
retryOnParentSetChanged runs fn, retrying (up to maxParentLockRetries) while it returns errParentSetChanged. fn MUST open and own its own transaction
internal/store/items.go:4060
↓ 5 callers
Function
revalidateAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder, options?: MetadataFetchOption
web/src/lib/components/editor/attachment-metadata.ts:202
↓ 5 callers
Function
sampleConvention
()
internal/artifact/encode_test.go:38
↓ 5 callers
Function
scanActivitiesWithUser
(rows interface { Next() bool Scan(dest ...interface{}) error Err() error })
internal/store/activities.go:480
↓ 5 callers
Function
scanItems
(rows *sql.Rows)
internal/store/items.go:4755
↓ 5 callers
Function
scanUser
scanUser scans a user row into a User struct. Note: does NOT decrypt the TOTP secret — call store.decryptUserTOTP() after scanning if you need the pla
internal/store/users.go:35
↓ 5 callers
Function
seedAccess
seedAccess inserts an access-token row in the chain identified by requestID. ts is the requested_at timestamp; sessionData + scopes land on the row. R
internal/store/connected_apps_test.go:77
↓ 5 callers
Function
seedClient
seedClient creates an oauth_clients row so chains have something to FK against. Returns the client ID.
internal/store/connected_apps_test.go:42
↓ 5 callers
Function
seedGrantChain
seedGrantChain inserts one access-token row in a chain. Returns the request_id so tests can revoke / list / audit by it.
internal/server/handlers_connected_apps_test.go:71
↓ 5 callers
Function
seedWorkspaceForConn
seedWorkspaceForConn creates a workspace and returns its ID — the join table stores workspace IDs, so tests need a real row.
internal/store/oauth_connections_test.go:48
↓ 5 callers
Method
setSourceContent
setSourceContent rewrites the source item's body — the attacker's own legitimate edit of an item they hold, which is the whole vector.
internal/server/handlers_items_copy_attachment_authz_test.go:94
↓ 5 callers
Function
setupEnsureWorkspaceTest
setupEnsureWorkspaceTest produces a clean tempdir, points HOME at a tempdir (so credential/config writes don't leak), chdirs into the project so cli.D
cmd/pad/init_test.go:20
↓ 5 callers
Method
snapshot
()
internal/server/handlers_items_copy_preflight_test.go:846
↓ 5 callers
Function
softDeleteWorkspaceAt
softDeleteWorkspaceAt stamps a workspace's deleted_at to a specific time so the sweep's age cutoff can be exercised deterministically — there's no API
internal/server/workspace_purge_test.go:36
↓ 5 callers
Method
sseSubscriberStillHasAccess
sseSubscriberStillHasAccess re-runs the workspace access check for an already-subscribed SSE client. Returns false when the caller can no longer see t
internal/server/handlers_events.go:609
↓ 5 callers
Function
tokenScopeAllows
tokenScopeAllows checks if the token's scopes permit the given HTTP method and path. Scopes are stored as a JSON array of strings. Supported scopes (
internal/server/middleware_auth.go:1181
↓ 5 callers
Function
tp
A touch pointer event, dispatched on the IMAGE by default (the painted-image hit).
web/src/lib/components/common/Lightbox.svelte.test.ts:2719
↓ 5 callers
Function
variantRow
variantRow looks up a derived variant of parentID. GetAttachmentVariant is workspace-scoped (PLAN-2391 DR-16), so the scope is read back off the paren
internal/server/handlers_attachments_thumbnails_test.go:26
↓ 5 callers
Method
waitForUpdate
()
internal/webhooks/dispatcher_test.go:55
↓ 5 callers
Function
withAuthorizer
(req AttachmentCopyRequest, auth AttachmentAuthorizer)
internal/store/attachments_copy_plan_test.go:1087
↓ 5 callers
Function
withClosedStdin
withClosedStdin replaces os.Stdin with a pipe whose write end is already closed, so term.IsTerminal(stdin) is false and any read hits EOF immediately
cmd/pad/workspace_init_noninteractive_test.go:46
↓ 5 callers
Function
withLocalFetcher
withLocalFetcher replaces the package-level fetcher with one that allows loopback dials so httptest.NewServer addresses (127.0.0.1) can be reached. Re
internal/server/handlers_import_test.go:17
↓ 4 callers
Method
Add
Add implements SessionPresence.
internal/server/session_presence.go:190
← previous
next →
801–900 of 8,091, ranked by callers