Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,005 in github.com/PerpetualSoftware/pad
⨍
Functions
6,005
◇
Types & classes
763
↓ 10 callers
Function
slugify
slugify converts a string to a URL-friendly slug.
internal/store/store.go:864
↓ 10 callers
Function
uploadHelper
uploadHelper does a fresh upload and returns the parsed response.
internal/server/handlers_attachments_download_test.go:19
↓ 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
↓ 10 callers
Method
writeItemResolveError
writeItemResolveError distinguishes a soft-deleted (archived) item from a genuinely-missing one for mutation handlers. An archived item still appears
internal/server/handlers_items.go:728
↓ 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
Method
EventsSince
EventsSince returns events for a workspace with IDs greater than sinceID. Used to replay missed events on SSE reconnect (Last-Event-ID). Returns nil i
internal/events/bus.go:117
↓ 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
GetWorkspaceByID
(id string)
internal/store/workspaces.go:151
↓ 9 callers
Method
IsCloud
IsCloud reports whether the server is running in cloud mode.
internal/server/server.go:485
↓ 9 callers
Method
ListDocuments
(workspaceID string, params models.DocumentListParams)
internal/store/documents.go:13
↓ 9 callers
Method
MoveItem
MoveItem moves an item to a different collection within the same workspace. It updates the collection_id and fields JSON. The item_number is preserved
internal/store/items.go:3985
↓ 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
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:914
↓ 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
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
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
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
Method
decrypt
decrypt decrypts a value that was encrypted with encrypt(). If the value doesn't have the "enc:" prefix, it's treated as plaintext (backward compatibi
internal/store/encryption.go:60
↓ 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
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:305
↓ 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
↓ 9 callers
Function
workspaceRole
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:682
↓ 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
Method
AppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/manager_test.go:51
↓ 8 callers
Method
ApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on successful ack; one of
internal/collab/applier.go:169
↓ 8 callers
Method
CreateRefreshToken
============================================================ Refresh tokens (handler/oauth2/storage.go RefreshTokenStorage) ==========================
internal/store/oauth.go:348
↓ 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:166
↓ 8 callers
Function
ExtractItemConventionMetadata
(fieldsJSON string)
internal/models/item.go:208
↓ 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:3092
↓ 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
LoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:135
↓ 8 callers
Function
MigrateFields
MigrateFields maps field values from a source schema to a target schema. Fields with matching keys and compatible types are transferred. Incompatible
internal/items/migrate.go:24
↓ 8 callers
Function
NewRegistry
NewRegistry returns an empty registry.
internal/attachments/registry.go:26
↓ 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
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
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
WithTokenAllowedWorkspaces
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
↓ 8 callers
Function
WithTokenScopes
WithTokenScopes returns ctx decorated with the API token's JSON-encoded scopes string (e.g. `["read"]`, `["*"]`). Stashed by the MCP Bearer middleware
internal/server/context.go:89
↓ 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
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
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:2159
↓ 8 callers
Method
logActivity
logActivity is a helper that logs activity, ignoring errors (best-effort).
internal/server/handlers_documents.go:295
↓ 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
newEmptyStore
()
internal/cli/credentials.go:163
↓ 8 callers
Function
packageJSONResult
packageJSONResult converts a CLI stdout string into an MCP tool result. JSON bodies surface as structuredContent; non-JSON falls back to text. Top-lev
internal/mcp/dispatch.go:166
↓ 8 callers
Function
packageStructuredResponse
packageStructuredResponse encodes payload to JSON, then decodes it back to a generic any so the StructuredContent surface matches the shape MCP client
internal/mcp/dispatch_http_links.go:475
↓ 8 callers
Function
parseExamplesFromLong
parseExamplesFromLong extracts the indented invocation lines that follow an "Examples:" header in a cobra Long string. Returns nil when no such sectio
internal/cmdhelp/json.go:200
↓ 8 callers
Function
pickTemplateInteractive
pickTemplateInteractive presents a numbered list of visible templates grouped by category and returns the chosen template's Name. Returns the default
cmd/pad/templates_picker.go:72
↓ 8 callers
Method
post
( url: string, options: { headers?: Record<string, string>; data?: unknown; multipart?: unknown } )
web/e2e/workspace-bundle-roundtrip.spec.ts:63
↓ 8 callers
Function
postOAuthFormBearer
postOAuthFormBearer POSTs an x-www-form-urlencoded body with a Bearer Authorization header (used for /oauth/introspect, where fosite v0.49 requires ei
internal/server/handlers_oauth_test.go:2550
↓ 8 callers
Method
requireCollectionFullyVisible
requireCollectionFullyVisible checks that the collection is visible to the requesting user under FULL-collection-access semantics (BUG-1920 — codex R2
internal/server/server.go:1947
↓ 8 callers
Method
resolveAssignName
resolveAssignName rewrites a `--assign <name|email>` input into `assigned_user_id <uuid>` by hitting the workspace-members endpoint and finding a matc
internal/mcp/dispatch_http_advanced.go:33
↓ 8 callers
Method
rowCount
()
internal/collab/manager_test.go:231
↓ 8 callers
Function
seedBackfillAccess
(t *testing.T, s *Store, requestID, clientID, subject string, ts time.Time, sessionData string)
internal/store/oauth_connections_backfill_test.go:81
↓ 8 callers
Method
size
size returns the current entry count. Used by tests and by startMCPSessionTracker's initial gauge prime.
internal/server/middleware_mcp_session.go:165
↓ 8 callers
Method
touch
touch inserts or refreshes an entry. No-op on empty id (defensive: callers pre-filter, but a missing header should never bump anything). Fires onChang
internal/server/middleware_mcp_session.go:112
↓ 8 callers
Method
validateCloudSecret
validateCloudSecret checks the cloud_secret field in a JSON request body against the server's configured cloud secret. Returns true if the secret matc
internal/server/handlers_cloud.go:45
↓ 7 callers
Method
BrowserURL
BrowserURL returns a URL suitable for displaying to humans in CLI prompts (e.g. "Or open the web UI at X"). It behaves like BaseURL except that when t
internal/config/config.go:403
↓ 7 callers
Function
BuildMetaPayload
BuildMetaPayload returns the meta payload for the given pad runtime version. An empty padVersion falls back to FallbackVersion for the same reason ser
internal/mcp/meta.go:54
↓ 7 callers
Method
CheckSession
CheckSession returns the current auth status.
internal/cli/client.go:1022
↓ 7 callers
Function
ConvertOpenAPI
ConvertOpenAPI converts an OpenAPI 3.x specification into a human-readable markdown document. The output is organized as: - H1 with the API title - I
internal/urlimport/openapi.go:30
↓ 7 callers
Method
CountBacklinks
CountBacklinks returns the total number of same-workspace backlinks the requester would see for a given target, applying the same visibility filter as
internal/store/wiki_links.go:1071
↓ 7 callers
Method
CreateEmailVerification
CreateEmailVerification generates an email-verification token for the given user. Returns the plaintext token (to embed in the verification URL). The
internal/store/email_verification.go:28
↓ 7 callers
Function
CurrentUserFromContext
CurrentUserFromContext returns the user attached by WithCurrentUser (or by the standard auth middleware), and a boolean signalling whether one was pre
internal/server/context.go:63
← previous
next →
301–400 of 6,005, ranked by callers