Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,856 in github.com/PerpetualSoftware/pad
⨍
Functions
7,856
◇
Types & classes
959
↓ 10 callers
Method
runOrphanGCSweep
runOrphanGCSweep walks the orphaned-attachments query and reclaims rows past the grace period. Two reclamation paths: - DB row only. content_hash is
internal/server/orphan_gc.go:47
↓ 10 callers
Function
scanCount
(t *testing.T, s *Store, query string, args ...any)
internal/store/items_create_tx_test.go:52
↓ 10 callers
Function
sha256Hex
(b []byte)
internal/attachments/fs_store_test.go:17
↓ 10 callers
Function
slugify
slugify converts a string to a URL-friendly slug.
internal/store/store.go:877
↓ 10 callers
Function
uploadAttachment
( fixture: SuiteFixture, request: APIRequestContext, itemId: string, filename: string, mimeType = 'image/
web/e2e/lib/attachment-viewer.ts:436
↓ 10 callers
Function
uploadHelper
uploadHelper does a fresh upload and returns the parsed response.
internal/server/handlers_attachments_download_test.go:19
↓ 10 callers
Method
variant
variant creates a derived thumbnail row for parent, in ws.
internal/store/attachments_copy_plan_test.go:63
↓ 10 callers
Function
waitForEvent
waitForEvent reads from the event channel with a timeout.
internal/server/handlers_events_test.go:76
↓ 10 callers
Function
withTempHome
withTempHome chroots ~/.pad to a fresh tempdir for the test. CredentialsPath resolves via os.UserHomeDir → $HOME, so a t.Setenv("HOME", ...) is enough
internal/cli/credentials_test.go:14
↓ 9 callers
Method
CreateComment
CreateComment adds a new comment to an item. userID is the authenticated user authoring the comment (empty for agent/system comments); it's stored as
internal/store/comments.go:16
↓ 9 callers
Method
CreateInvitation
--- Invitations --- CreateInvitation creates a pending workspace invitation. Generates a 128-bit (16-byte) random code and stores only its SHA-256 has
internal/store/workspace_members.go:626
↓ 9 callers
Method
EnsureEncryptionKey
EnsureEncryptionKey makes sure the server has a usable encryption key without requiring the operator to set one explicitly. Resolution order: 1. If c
internal/config/config.go:449
↓ 9 callers
Function
FormatForTool
FormatForTool takes the raw embedded skill content and formats it for a specific tool. Returns the appropriately formatted content with tool-specific
internal/cli/agents.go:202
↓ 9 callers
Method
IsCloud
IsCloud reports whether the server is running in cloud mode.
internal/server/server.go:537
↓ 9 callers
Method
ListDocuments
(workspaceID string, params models.DocumentListParams)
internal/store/documents.go:13
↓ 9 callers
Function
NewFSStore
NewFSStore returns a store rooted at baseDir, creating the directory if it does not exist. baseDir is typically <DataDir>/attachments.
internal/attachments/fs_store.go:42
↓ 9 callers
Function
ParseTrustedProxyCIDRs
ParseTrustedProxyCIDRs parses a comma-separated list of CIDRs or bare IPs from the PAD_TRUSTED_PROXIES setting. Bare IPs get /32 (IPv4) or 128 (IPv6).
internal/server/middleware_realip.go:90
↓ 9 callers
Method
Publish
Publish assigns the Notification a monotonic ID, stores it in the replay buffer, and fans it out to every live Subscribe channel. ID assignment and bu
internal/watchevents/watchevents.go:97
↓ 9 callers
Function
RenderItemMarkdown
RenderItemMarkdown is the writer-taking core of PrintItemMarkdown. Columns mirror the table renderer's — Ref · Title · Status · Priority · Collection
internal/cli/format_markdown.go:79
↓ 9 callers
Method
RestoreBoundary
RestoreBoundary returns the restore boundary recorded for itemID, or (0, false) when none has been set. The collab-snapshot PATCH handler consults it
internal/collab/manager.go:168
↓ 9 callers
Method
Send
Send sends an email using the default from address/name.
internal/email/sender.go:122
↓ 9 callers
Method
SetBypassSetupToken
SetBypassSetupToken wires the operator's PAD_BYPASS_SETUP_TOKEN choice into the Server. When true, handleBootstrap accepts a self-host first-admin POS
internal/server/bootstrap.go:191
↓ 9 callers
Method
SetIPChangeEnforce
SetIPChangeEnforce controls how the auth middleware reacts when a session's binding (client IP OR User-Agent hash) changes mid-lifetime: - mode == "st
internal/server/server.go:974
↓ 9 callers
Method
SetMCPTransport
MCP transport state. Set at startup by cmd/pad/main.go via SetMCPTransport when the deployment is in cloud mode (PAD_MODE=cloud). Self-hosted deployme
internal/server/handlers_mcp.go:66
↓ 9 callers
Method
SetUserPlanOverrides
SetUserPlanOverrides updates per-user limit overrides (JSON string).
internal/store/limits.go:325
↓ 9 callers
Function
TerminalValuesForDoneField
TerminalValuesForDoneField returns the resolved done-field key and the list of terminal values for that field. If the resolved field has no terminal_o
internal/models/terminal.go:74
↓ 9 callers
Function
ValidateExamples
ValidateExamples is the contractual mechanism by which cmdhelp v0.1 prevents documentation drift (spec §6, §11 Q5). For every example in every command
internal/cmdhelp/example_validation.go:28
↓ 9 callers
Function
addPadEntryTOML
--- TOML config path (Codex) -------------------------------------------- Codex nests its MCP servers in a TOML `[mcp_servers.pad]` table, so the JSO
internal/mcp/install.go:405
↓ 9 callers
Method
append
append adds an event to the ring buffer, evicting the oldest if full.
internal/events/bus.go:174
↓ 9 callers
Function
audienceMatchingStrategy
audienceMatchingStrategy returns a fosite.AudienceMatchingStrategy that enforces "every requested audience must equal the configured canonical audienc
internal/oauth/audience.go:115
↓ 9 callers
Method
callCopy
Tests for the mutating cross-workspace copy (PLAN-2357 / TASK-2365). The fixture is the PREFLIGHT's, deliberately and not for convenience: the headli
internal/server/handlers_items_copy_test.go:50
↓ 9 callers
Function
countItemsIn
(t *testing.T, s *Store, workspaceID string)
internal/store/items_cross_workspace_copy_test.go:104
↓ 9 callers
Function
createTaskWithFields
createTaskWithFields is a small helper for the field-patch/OCC tests: POST a task with the given fields JSON and return the created item.
internal/server/handlers_items_fieldpatch_test.go:13
↓ 9 callers
Function
csrfCookieName
csrfCookieName returns the CSRF cookie name. Uses the same __Host- prefix strategy as the session cookie.
internal/server/handlers_auth.go:54
↓ 9 callers
Function
doJSONReq
doJSONReq drives a JSON request through srv and returns the recorder. Mirrors the local pattern in internal/server/server_test.go::doRequest, kept pac
internal/mcp/dispatch_http_routes_test.go:45
↓ 9 callers
Function
doRequestWithHeadersFromAddr
doRequestWithHeadersFromAddr lets us combine arbitrary headers with a non-loopback remote-addr. Existing helpers cover one or the other but not both.
internal/server/handlers_auth_bootstrap_token_test.go:56
↓ 9 callers
Function
docWith
docWith constructs a minimal Document with two commands sharing a `collection` arg (caching test) and one `role` flag.
internal/cmdhelp/dynamic_test.go:49
↓ 9 callers
Function
fakeSessionServer
fakeSessionServer returns an httptest.Server whose /api/v1/auth/session handler responds with the SessionResponse produced by `gen` (called once per r
internal/cli/bootstrap_test.go:23
↓ 9 callers
Function
findFieldOptions
findFieldOptions returns the Options slice for the named field on a collection's schema, or nil if the field is missing.
internal/collections/templates_test.go:11
↓ 9 callers
Method
isItemVisibleToGuest
isItemVisibleToGuest checks if an item is visible given grant-based access, considering both full-collection grants and individual item grants. When f
internal/server/server.go:2244
↓ 9 callers
Method
logActivity
logActivity is a helper that logs activity, ignoring errors (best-effort).
internal/server/handlers_documents.go:295
↓ 9 callers
Function
makeIntegrationPNG
makeIntegrationPNG returns a real PNG large enough that both thumb-sm (256px) and thumb-md (1024px) variants must scale down. Filled with a stripe pat
internal/server/handlers_attachments_thumbnails_test.go:42
↓ 9 callers
Function
mapCollectionUpdate
mapCollectionUpdate dispatches `pad collection update <slug> [--name ...] [--icon ...] [--description ...] [--prefix ...] [--schema ...] [--fields ...
internal/mcp/dispatch_http_routes.go:700
↓ 9 callers
Function
newMCPSessionTracker
newMCPSessionTracker constructs a tracker with the given TTL and optional onChange callback. ttl <= 0 falls back to the default; onChange may be nil (
internal/server/middleware_mcp_session.go:79
↓ 9 callers
Function
newRefResolverFixture
(t *testing.T)
internal/server/handlers_ref_resolver_test.go:51
↓ 9 callers
Function
newStub
newStub starts a test HTTP server and returns a CloudClient pointed at it. Callers supply the handler to control the response.
internal/billing/cloud_client_test.go:16
↓ 9 callers
Function
newTestSender
(ts *httptest.Server)
internal/email/sender_test.go:12
↓ 9 callers
Function
readBinaryWithin
readBinaryWithin reads a single binary frame within d. Returns the payload bytes or fails the test on timeout.
internal/collab/manager_test.go:405
↓ 9 callers
Function
readControlWithin
readControlWithin reads frames off the conn within d, drains payload (binary) frames, and returns the FIRST TextMessage parsed as a ControlMessage. Te
internal/collab/manager_test.go:1774
↓ 9 callers
Method
requireNoPointer
(rr *httptest.ResponseRecorder, label string)
internal/server/item_moved_to_test.go:202
↓ 9 callers
Method
run
(ctx: AttachmentActionContext)
web/src/lib/attachments/actions.ts:139
↓ 9 callers
Function
seedBackfillClient
seedBackfillClient mirrors seedClient in connected_apps_test.go but stays internal to this file so the backfill suite can run in isolation when other
internal/store/oauth_connections_backfill_test.go:64
↓ 9 callers
Function
seedBackfillUser
(t *testing.T, s *Store, email string)
internal/store/oauth_connections_backfill_test.go:40
↓ 9 callers
Function
seedConnectedAppForMutations
seedConnectedAppForMutations creates a user + workspace + an oauth_connections row directly so the mutation handlers have something to mutate. Returns
internal/server/handlers_connected_apps_mutations_test.go:64
↓ 9 callers
Function
sessionUserPayload
(user *models.User)
internal/server/handlers_auth.go:61
↓ 9 callers
Function
setupPermissionTest
Phase 2 permission test suite (TASK-488). Tests collection-level visibility, system collection exemptions, and the VisibleCollectionIDs resolution log
internal/store/permissions_test.go:13
↓ 9 callers
Function
str
* Read a string param. Absent (undefined/null) returns undefined — not an * error, matching strArray's absent-vs-malformed line. A present value of a
web/src/lib/webmcp/dispatch.ts:50
↓ 9 callers
Function
validatePasswordStrength
validatePasswordStrength enforces length + strength. It rejects weak passwords at registration / rotation / reset so top-of-breach-list entries like "
internal/server/password_strength.go:34
↓ 8 callers
Method
AllowedWorkspaces
AllowedWorkspaces returns the workspace allow-list stored in session.Extra at consent time (TASK-952). Three return shapes matter to callers: - nil —
internal/oauth/session.go:100
↓ 8 callers
Function
CopyOutcomeUnknown
CopyOutcomeUnknown reports whether err leaves it genuinely unknown whether the copy committed. True for the server's 500 `copy_failed` and for any tra
internal/cli/client_items_copy.go:313
↓ 8 callers
Method
CreateAttachmentForLiveItem
CreateAttachmentForLiveItem inserts an attachment row, refusing when its item_id does not name a LIVE item of the same workspace — re-checked and pinn
internal/store/attachments.go:144
↓ 8 callers
Method
CreateRefreshToken
============================================================ Refresh tokens (handler/oauth2/storage.go RefreshTokenStorage) ==========================
internal/store/oauth.go:348
↓ 8 callers
Method
CreateWatch
CreateWatch creates a durable watch, or replaces the predicate on an existing one for the same (user, item) pair (TASK-2533). Re-running `pad watch <r
internal/store/watches.go:17
↓ 8 callers
Function
DoneFieldKey
DoneFieldKey resolves which field on a collection's schema represents "is this item done?". The resolution is: 1. If CollectionSettings.BoardGroupBy
internal/models/terminal.go:49
↓ 8 callers
Method
EncryptionKeyFile
EncryptionKeyFile returns the on-disk path where an auto-generated encryption key is persisted. Operator-provided keys (PAD_ENCRYPTION_KEY env, encryp
internal/config/config.go:423
↓ 8 callers
Function
ExtractItemCodeContext
(fieldsJSON string)
internal/models/item.go:250
↓ 8 callers
Function
ExtractItemConventionMetadata
(fieldsJSON string)
internal/models/item.go:292
↓ 8 callers
Method
Fetch
Fetch performs a GET against rawURL, re-validating every redirect hop and aborting if the response exceeds the size cap. Returns a wrapped error suita
internal/urlimport/fetch.go:115
↓ 8 callers
Method
GetComment
GetComment returns a single comment by ID.
internal/store/comments.go:64
↓ 8 callers
Method
GetParentForItem
GetParentForItem returns the parent link for an item, or nil if it has no parent. A parent link pointing to a soft-deleted item is treated as no paren
internal/store/items.go:3490
↓ 8 callers
Method
HydrateDerivedFields
()
internal/models/workspace_settings.go:141
↓ 8 callers
Method
Install
Install adds (or refreshes) the pad entry in the named agent's config. Returns the resolved path + whether the file was actually modified (false on a
internal/mcp/install.go:639
↓ 8 callers
Method
IsDisabled
IsDisabled returns true if the user account has been disabled.
internal/models/user.go:35
↓ 8 callers
Function
NewServer
NewServer constructs an OAuth 2.1 authorization server backed by fosite v0.49.0. Compliance posture (PLAN-943 TASK-951): - PKCE required (S256 only)
internal/oauth/server.go:96
↓ 8 callers
Function
RelativeTime
RelativeTime returns a human-readable relative time string.
internal/cli/format.go:108
↓ 8 callers
Method
RemoveWorkspaceMember
RemoveWorkspaceMember removes a user from a workspace.
internal/store/workspace_members.go:35
↓ 8 callers
Function
ResolveAttachmentReferences
ResolveAttachmentReferences scans `markdown` for `pad-attachment:UUID` references in standard markdown image/link syntax and replaces each with render
internal/server/render/attachments.go:291
↓ 8 callers
Method
RoomCount
RoomCount is a test/debug accessor. Production code shouldn't make decisions based on this — the count is racy with grace-timer expirations.
internal/collab/manager.go:864
↓ 8 callers
Method
SetAttachments
SetAttachments wires the attachment storage Registry that the upload and download handlers use. Pass maxBytes = 0 to keep the defaultAttachmentMaxByte
internal/server/server.go:784
↓ 8 callers
Method
SubscriberCount
SubscriberCount returns the number of active subscribers for the given item. Useful for room-manager TTL accounting (TASK-1255 — when the count hits 0
internal/collab/bus.go:113
↓ 8 callers
Function
TrustedProxyRealIP
TrustedProxyRealIP returns middleware that rewrites r.RemoteAddr from X-Real-IP / X-Forwarded-For ONLY when the direct TCP peer is within one of the s
internal/server/middleware_realip.go:50
↓ 8 callers
Function
applySQLiteMigration
applySQLiteMigration applies a single migration file atomically. Behavior (IDEA-1485): 1. PRAGMA statements are lifted out of the migration body (se
internal/store/store.go:595
↓ 8 callers
Function
assertBlocked
assertBlocked asserts the response is a 403 email_not_verified.
internal/server/middleware_verified_email_test.go:154
↓ 8 callers
Function
auditUser
auditUser creates a user that subsequent audit rows can FK-reference. The schema requires user_id REFERENCES users(id), so we can't insert audit rows
internal/store/mcp_audit_test.go:39
↓ 8 callers
Method
build
(workspace string)
internal/cmdhelp/dynamic_test.go:22
↓ 8 callers
Function
buildFositeRequest
buildFositeRequest produces a fully-populated *fosite.Request so adapter tests can drive Create*Session methods without depending on fosite's HTTP ent
internal/oauth/server_test.go:934
↓ 8 callers
Function
buildHTMLShell
buildHTMLShell wraps body HTML in the standard transactional-email chrome — header (Pad wordmark) + body + footer note + (Cloud only) marketing footer
internal/email/shell.go:29
↓ 8 callers
Method
countRows
(t *testing.T, query string, args ...interface{})
internal/store/workspace_purge_test.go:47
↓ 8 callers
Method
createItemTx
createItemTx is the tx-taking form of item creation (PLAN-2357 / DR-9a) and the single implementation behind BOTH CreateItem and the cross-workspace c
internal/store/items.go:412
↓ 8 callers
Function
deleteAsUser
Delete-authorization tests for PLAN-2382 / TASK-2384. The item-detail attachment strip offers a delete affordance gated on the UI's grant-aware `canE
internal/server/handlers_storage_delete_authz_test.go:28
↓ 8 callers
Function
dialWSBracket
dialWSBracket joins as a bracket-capable participant (`?applier_bracket=1`) so the conn can be durably confirmed by a restore's finalization (BUG-2276
internal/collab/manager_test.go:362
↓ 8 callers
Function
doRequestWithCookieFrom
doRequestWithCookieFrom is like doRequestWithCookie but lets the caller set the request RemoteAddr so tests can simulate a session jumping to a differ
internal/server/middleware_session_ip_test.go:18
↓ 8 callers
Function
expandPath
expandPath substitutes {key} placeholders in template using input. Each placeholder must appear as a non-empty string in input; otherwise expandPath r
internal/mcp/dispatch_http_routes.go:85
↓ 8 callers
Function
fetchAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder, options?: MetadataFetchOption
web/src/lib/components/editor/attachment-metadata.ts:91
↓ 8 callers
Method
getOrCreate
getOrCreate returns the existing Room for itemID or, atomically under m.mu, mints a new one. Holding m.mu across the lookup + insertion keeps the grac
internal/collab/manager.go:824
↓ 8 callers
Function
mapCollectionCreate
mapCollectionCreate dispatches `pad collection create <name> [--fields key:type[:opts]; ...] [--icon ...] [--description ...] [--layout ...] [--defaul
internal/mcp/dispatch_http_routes.go:460
↓ 8 callers
Method
maybeInjectWorkspace
maybeInjectWorkspace defaults the `workspace` input from the dispatcher's WorkspaceLister when the caller didn't pass one explicitly (TASK-1076). The
internal/mcp/dispatch_http_advanced.go:462
↓ 8 callers
Function
newAuditTestStore
Store-layer tests for the MCP audit log (PLAN-943 TASK-960). What's covered: - InsertMCPAuditEntry validates required fields and round-trips correct
internal/store/mcp_audit_test.go:25
↓ 8 callers
Function
newClaimTestEnv
(t *testing.T)
internal/server/handlers_oauth_claim_test.go:57
↓ 8 callers
Function
newDeleteAuthzFixture
(t *testing.T, srv *Server)
internal/server/handlers_storage_delete_authz_test.go:57
← previous
next →
401–500 of 7,856, ranked by callers