{"modulePath":"github.com/htcondor/golang-htcondor/webapi","version":"v0.26.1","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package httpserver\n\nPackage httpserver provides HTTP API handlers for HTCondor operations.\n\nPackage httpserver provides HTTP API handlers for HTCondor operations.\n\n## Constants\n\n```go\nconst (\n\tInteractiveWatchdogPollSec      = interactive.DefaultTerminalWatchdogPollSec\n\tInteractiveWatchdogFreshnessSec = interactive.DefaultTerminalWatchdogFreshnessSec\n)\n```\nWatchdog timing for browser terminals, and how often the bridge heartbeats them.\n\nThe watchdog polls every InteractiveWatchdogPollSec; if .heartbeat is older than InteractiveWatchdogFreshnessSec it exits. The bridge sends a heartbeat every interactiveHeartbeatIntervalSec for as long as the WebSocket is open, and gives up after interactiveMaxIdleSec without a keystroke.\n\nThat idle bound used to be 60s, which is where a bug lived: a user who read output or thought for two minutes with the tab open stopped being heartbeated and lost their shell to the watchdog. The socket being open is the real \"someone is there\" signal -- a closed tab closes it -- so the keystroke clock now only exists to reclaim a tab left open and forgotten, and is set at the scale that behaviour actually happens on.\n\n```go\nconst (\n\tDefaultJupyterStartGraceSec     = 4 * 60 * 60\n\tMaxJupyterStartGraceSec         = 7 * 24 * 60 * 60\n\tDefaultJupyterReconnectGraceSec = 5 * 60\n\tMaxJupyterReconnectGraceSec     = 60 * 60\n)\n```\nDefaults and ceilings for the two JupyterLab grace periods. The ceilings keep either from being effectively unbounded: the start grace is how long a token for an unstarted job stays live, and the reconnect grace how long a session nobody can reach stays listed.\n\n```go\nconst (\n\t// DefaultMCPMaxRequestDuration is how long an MCP request may run while\n\t// it keeps making progress. Deliberately generous -- the point is to let\n\t// a watch wait for a job rather than for a timeout -- but finite, so a\n\t// stuck tool is bounded by something.\n\tDefaultMCPMaxRequestDuration = 15 * time.Minute\n\n\t// DefaultDeliverableWatchWait is how long a block can be expected to\n\t// SURVIVE, as against how long this server is willing to run it.\n\t//\n\t// The two are different numbers and only one of them is ours. The\n\t// deadline extension above settles what this daemon will hold a request\n\t// open for -- 14m30s once the reply margin is taken off the default hard\n\t// stop -- and says nothing about the MCP client at the other end, which\n\t// abandons a tool call on a timer of its own that this server cannot\n\t// see, cannot extend and is not told about. Measured against a live\n\t// deployment: a 45s and a 50s block both came back with their answer,\n\t// while 120s and 600s returned nothing at all -- not a timeout result, no\n\t// payload, just the client giving up. Reports of that timer put it near\n\t// 60s, and it varies by client: the CLI honours a per-server override,\n\t// the desktop app reportedly ignores it, and a progress notification\n\t// does not reset it.\n\t//\n\t// So a cap derived from our own deadline is a number no one can deliver,\n\t// and advertising it is worse than advertising a small one. The tool\n\t// description is what an agent plans against; told it may wait 14m30s it\n\t// asks for minutes, and every such call returns nothing -- which an agent\n\t// cannot tell apart from a lost answer, where a wait that runs out and\n\t// says \"not yet\" is unambiguous and costs one more turn. 45s is the\n\t// longest block observed to arrive, with the rest of the minute left for\n\t// the evaluation pass and the reply.\n\t//\n\t// This bounds the DEFAULT only. HTTP_API_MCP_WATCH_MAX_WAIT still wins\n\t// outright, in both directions: an operator who knows their clients are\n\t// configured for longer, or who has a gateway tighter than this, is the\n\t// only one who knows, and setting it is how they say so.\n\tDefaultDeliverableWatchWait = 45 * time.Second\n)\n```\n\n```go\nconst (\n\t// OracleScheddUserRec honors `condor_qusers -disable`, treating a user\n\t// record with no Enabled statement as no opinion.\n\tOracleScheddUserRec = \"schedd-userrec\"\n\t// OracleScheddUserRecStrict is OracleScheddUserRec plus \"a user with no\n\t// record at all is revoked\". Only correct in a pool that provisions a\n\t// record for every user; see UserRecordOracle.Strict.\n\tOracleScheddUserRecStrict = \"schedd-userrec-strict\"\n\t// OracleScheddACL probes the schedd's ACLs with DC_SEC_QUERY.\n\tOracleScheddACL = \"schedd-acl\"\n\t// OracleNone disables every oracle. It exists because a config file\n\t// cannot express Go's nil-versus-empty-slice distinction: an unset\n\t// HTTP_API_OAUTH2_REVOCATION_ORACLES means \"use the defaults\", so\n\t// there has to be a spelling for \"I want none of them\". Setting it\n\t// alongside other names is a configuration error.\n\tOracleNone = \"none\"\n)\n```\nRecognized revocation oracle names. These are the values accepted by HandlerConfig.OAuth2RevocationOracles and by the HTTP\\_API\\_OAUTH2\\_REVOCATION\\_ORACLES config knob.\n\n```go\nconst AppTypeCodeServer = \"code-server\"\n```\nAppTypeCodeServer is the only app type implemented.\n\n```go\nconst DefaultMaxGrantLifetime = 30 * 24 * time.Hour\n```\nDefaultMaxGrantLifetime bounds how long a grant may go UNUSED before it must be consented again. It is measured from the grant's last use, so a grant refreshed inside the window keeps running indefinitely; see the idle cap in reauthorizeGrant and Handler.oauth2MaxGrantLifetime.\n\n```go\nconst DefaultTokenRetention = 90 * 24 * time.Hour\n```\nDefaultTokenRetention is how long a dead token row is kept.\n\nNinety days is chosen to outlast the question an operator asks of this page (\"what did that client do, and when did we cut it off?\") without keeping rows nobody will ever read. Rows still in use are never touched whatever this says: the cutoff applies to tokens that have expired or been revoked.\n\n```go\nconst DefaultUsageStatsFlushInterval = 5 * time.Minute\n```\nDefaultUsageStatsFlushInterval is how often the call counters are written to SQLite.\n\nFive minutes, because the flush exists to bound what a crash loses, not to keep the table current for a reader: /metrics is always exact, and the table is a durable backstop. A shorter interval would write the same rows more often for no extra fidelity anywhere a human looks; a longer one would lose more counting to a kill -9.\n\nA flush on an idle server does no writes at all -- each store tracks whether anything was recorded since the last one.\n\n```go\nconst IdempotencyKeyHeader = \"Idempotency-Key\"\n```\nIdempotencyKeyHeader is the request header carrying a submission's idempotency key.\n\nThis spelling, rather than a field in the JSON body: it is what the IETF draft and every API that has this feature use, so a client's existing retry middleware already sets it; it applies to the multipart and form-shaped submit surfaces that have no JSON body to put it in; and a proxy or gateway can see it without parsing a body.\n\n## Variables\n\n```go\nvar (\n\tErrAuthorizationPending = \u0026fosite.RFC6749Error{\n\t\tErrorField:       \"authorization_pending\",\n\t\tDescriptionField: \"The authorization request is still pending\",\n\t\tCodeField:        http.StatusBadRequest,\n\t}\n\tErrSlowDown = \u0026fosite.RFC6749Error{\n\t\tErrorField:       \"slow_down\",\n\t\tDescriptionField: \"Client is polling too frequently\",\n\t\tCodeField:        http.StatusBadRequest,\n\t}\n\tErrExpiredToken = \u0026fosite.RFC6749Error{\n\t\tErrorField:       \"expired_token\",\n\t\tDescriptionField: \"The device code has expired\",\n\t\tCodeField:        http.StatusBadRequest,\n\t}\n)\n```\nDevice flow error codes (RFC 8628)\n\n```go\nvar ErrTokenAmbiguous = errors.New(\"more than one token matches that fingerprint\")\n```\nErrTokenAmbiguous reports that a fingerprint matches more than one token. Refusing is the point: the fingerprint is a truncated signature, so acting on \"probably that one\" would revoke somebody else's access.\n\n```go\nvar ErrTokenNotFound = errors.New(\"no token matches that fingerprint\")\n```\nErrTokenNotFound reports that no token matches a fingerprint.\n\n## Functions\n\n```go\nfunc AuthenticatedViaAPIKey(ctx context.Context) bool\n```\nAuthenticatedViaAPIKey reports whether ctx was set up by the API-key auth path (rather than a JWT, OAuth2 token, or browser session). Some authorization decisions only make sense for API keys (e.g. \"API keys must have an explicit scope; sessions don't\").\n\n```go\nfunc ConfigureSecurityForCollectorPing(token, serverName string) (*security.SecurityConfig, error)\n```\nConfigureSecurityForCollectorPing builds a SecurityConfig used solely by the periodic collector ping. The ping is this daemon's own health check, so it starts from the configured CLIENT security settings -- SEC\\_CLIENT\\_AUTHENTICATION\\_METHODS and the credentials those methods need -- exactly as any other daemon-credential call to the collector does. A pool that authenticates with FS or IDTOKENS is pinged with FS or IDTOKENS.\n\nOn top of that base, two methods are always offered, because the ping is read-only and needs only \\*some\\* handshake the collector accepts:\n\n  - TOKEN, first, with token as the credential, when token is non-empty. Token auth gives the collector a real identity to log.\n  - SSL, last, when the configuration does not already offer it. That keeps /readyz green when the daemon's token does not match the collector's IssuerKeys (an issuer rotation, a misconfigured TrustDomain, etc.) but the collector accepts SSL. SSL is offered even with no client cert/key on disk because many collectors permit anonymous SSL: the client only verifies the server's cert and connects as ANONYMOUS@..., which is enough for a ping. Cedar handles empty CertFile/KeyFile as \"no client cert presented\", and trusts the system store alongside AUTH\\_SSL\\_CLIENT\\_CAFILE/CADIR unless AUTH\\_SSL\\_CLIENT\\_USE\\_DEFAULT\\_CAS is false -- see cedar/security/ssl\\_trust.go.\n\nserverName is used by cedar's SSL handshake for hostname/SAN verification. Without it, cedar falls back to the literal string \"unknown\" and verification fails (\"certificate is valid for host.example.com, ..., not unknown\"). Pass the bare hostname of the collector address -- see hostFromCondorAddress in handler.go.\n\n```go\nfunc ConfigureSecurityForToken(token string) (*security.SecurityConfig, error)\n```\nConfigureSecurityForToken configures security settings to use the provided token This is a helper function to set up cedar's security configuration for TOKEN authentication\n\n```go\nfunc ConfigureSecurityForTokenWithCache(token string, sessionCache *security.SessionCache) (*security.SecurityConfig, error)\n```\nConfigureSecurityForTokenWithCache configures security settings with an optional session cache If sessionCache is nil, the global cache will be used\n\n```go\nfunc ConfigureSecurityForTokenWithCacheAndFallback(token string, sessionCache *security.SessionCache, allowFSFallback bool) (*security.SecurityConfig, error)\n```\nConfigureSecurityForTokenWithCacheAndFallback configures security settings with optional session cache and optional FS authentication fallback.\n\nallowFSFallback semantics:\n\n  - true: APPEND FS to the offered methods. No production call site passes this any more. It was used for user-header mode, on the premise that such a token was \"generated locally per request and not signed with anything the schedd recognises\" -- which was not true. extractOrGenerateToken signs the header-mode token with the same s.signingKeyPath and s.trustDomain as the session-mode one, so the schedd validates both identically, and appending FS only let FS win the negotiation and hide the caller's identity behind the daemon's OS user. Retained for the tests that pin the append/strip behaviour itself.\n\n  - false (session/JWT mode): the token IS signed by us with the pool's signing key, the schedd validates it, and its \\`sub\\` claim is the user we want recorded as the job Owner. We therefore REMOVE FS from the offered methods, so the schedd can't pick it during negotiation. (Cedar's negotiation walks the server's preference order and selects the first method also offered by the client; HTCondor's default lists FS first, so leaving FS in the client's list lets FS win on a same-host schedd, and the schedd then records the OS user instead of the token's identity. We saw this in session\\_integration\\_test.go: jobs submitted via session cookie were owned by \\`vscode\\` — the test runner's UID — not by the JWT subject \\`testuser@trust.domain\\`.)\n\nAuthentication methods otherwise come from SEC\\_CLIENT\\_AUTHENTICATION\\_METHODS / SEC\\_DEFAULT\\_AUTHENTICATION\\_METHODS in the loaded HTCondor configuration. This was previously a hardcoded \\`\\[TOKEN]\\` list, which broke any pool that expects SSL alongside IDTOKENS.\n\nImplementation: delegates to htcondor.NewClientSecurityConfig for the configured-methods-aware base, then applies the FS rule above. Other call sites (file\\_transfer, schedd\\_ssh, mcpserver) use NewClientSecurityConfig directly; the httpserver-only allowFSFallback knob lives here so we don't drag it into the root package's API.\n\n```go\nfunc ContainsScope(ctx context.Context, scope string) bool\n```\nContainsScope reports whether the request's API key was minted with the named scope. Returns false when the request was NOT authenticated via an API key (or was authenticated via one with different scopes). Use this in handlers that want to opt into API-key access.\n\n```go\nfunc GenerateSigningKey() ([]byte, error)\n```\nGenerateSigningKey generates a new signing key for token generation Returns the key content as bytes\n\n```go\nfunc GetScheddWithToken(ctx context.Context, schedd *htcondor.Schedd) (*htcondor.Schedd, error)\n```\nGetScheddWithToken creates a schedd connection configured with token authentication This wraps the schedd to use token authentication from context\n\n```go\nfunc GetSecurityConfigFromToken(ctx context.Context) (*security.SecurityConfig, error)\n```\nGetSecurityConfigFromToken retrieves the token from context and creates a SecurityConfig This is a convenience function for HTTP handlers to convert context token to SecurityConfig\n\n```go\nfunc GetTokenFromContext(ctx context.Context) (string, bool)\n```\nGetTokenFromContext retrieves the token from the context\n\n```go\nfunc OAuth2CallbackPath(webUIEnabled, mcpOAuth2 bool) string\n```\nOAuth2CallbackPath is the path a server with this surface advertises as its redirect URI.\n\nWherever MCP is on, both callback paths are routed. A redirect URI is registered with the upstream identity provider, and an authorization already in flight across a restart or an upgrade comes back to whichever path it was started with; answering only the current one would strand it.\n\n```go\nfunc ParseGroupSources(raw string) ([]string, error)\n```\nParseGroupSources splits the comma-separated HTTP\\_API\\_GROUP\\_SOURCE.\n\nWhitespace around each entry is trimmed, so \"system, file:/etc/x\" reads the way an administrator would write it.\n\nMixing \"token\" with a local source is refused rather than merged. The two are different trust bases -- one is what the identity provider asserted, the other is what this machine's account database says -- and unioning them would mean a provider could add a caller to any group the local policy checks. Choosing between them has to be deliberate.\n\n```go\nfunc ParseTokenRetention(raw string) (time.Duration, error)\n```\nParseTokenRetention reads HTTP\\_API\\_TOKEN\\_RETENTION.\n\n\"0\" or \"off\" keeps rows forever, which is a defensible choice for a deployment whose audit policy says so -- and an explicit one, rather than something reached by leaving a knob unset.\n\n```go\nfunc WithCIMDSource(ctx context.Context, source string) context.Context\n```\nWithCIMDSource notes the source address of the request being handled, so a cache miss it causes is charged to that source's fetch budget. A context without one -- a lookup made for a token this server already issued, say -- is not limited.\n\n```go\nfunc WithRequestedRedirectURI(ctx context.Context, uri string) context.Context\n```\nWithRequestedRedirectURI notes the redirect\\_uri of the request being handled, for the loopback allowance described on withLoopbackRedirect.\n\n```go\nfunc WithToken(ctx context.Context, token string) context.Context\n```\nWithToken creates a context that includes authentication token information This sets up the security configuration for cedar to use TOKEN authentication\n\n## Types\n\n```go\ntype APAssignmentInfo struct {\n\t// Schedd is the home AP.\n\tSchedd string `json:\"schedd,omitempty\"`\n\t// Alternates are the other APs the caller may submit to by name.\n\tAlternates []string `json:\"alternates,omitempty\"`\n\t// Source names what decided it: a backend, or \"default\".\n\tSource string `json:\"source,omitempty\"`\n\t// Stale is set when the answer is a last known good one.\n\tStale bool `json:\"stale,omitempty\"`\n\t// Error and Reason say why there is no assignment.\n\tError  string `json:\"error,omitempty\"`\n\tReason string `json:\"reason,omitempty\"`\n}\n```\nAPAssignmentInfo is the caller's AP assignment as /api/v1/auth/me, /api/v1/whoami and /api/v1/aps report it: where new work goes, or why it cannot be submitted.\n\n```go\ntype APHubReach struct {\n\t// Name is the hub's collector ad Name, Address where it was found.\n\tName    string `json:\"name,omitempty\"`\n\tAddress string `json:\"address,omitempty\"`\n\t// Active is whether reads go to this hub now.\n\tActive      bool   `json:\"active\"`\n\tReachable   bool   `json:\"reachable\"`\n\tLastSuccess string `json:\"last_success,omitempty\"`\n\tLastError   string `json:\"last_error,omitempty\"`\n\t// FreshAPs is how many access points this hub holds fresh, which is\n\t// what hub selection ranks on.\n\tFreshAPs int `json:\"fresh_aps\"`\n}\n```\nAPHubReach is whether a federation hub is answering.\n\n```go\ntype APHubSwitch struct {\n\tFrom   string `json:\"from,omitempty\"`\n\tTo     string `json:\"to,omitempty\"`\n\tReason string `json:\"reason\"`\n\tAt     string `json:\"at\"`\n}\n```\nAPHubSwitch is the last change of active hub.\n\n```go\ntype APRegistryState struct {\n\tLastSuccess string `json:\"last_success,omitempty\"`\n\tLastError   string `json:\"last_error,omitempty\"`\n}\n```\nAPRegistryState is the AP registry's polling state.\n\n```go\ntype APsResponse struct {\n\tConstraint string           `json:\"constraint\"`\n\tAPs        []multiap.APInfo `json:\"aps\"`\n\tSources    multiap.Sources  `json:\"sources\"`\n\tRegistry   *APRegistryState `json:\"registry,omitempty\"`\n\t// Hub is the federation hub this answer comes from; Hubs every hub\n\t// this server knows, the one reads go to now marked active.\n\tHub       APHubReach   `json:\"hub\"`\n\tHubs      []APHubReach `json:\"hubs,omitempty\"`\n\tHubSwitch *APHubSwitch `json:\"hub_switch,omitempty\"`\n\t// Assignment is where the caller's new work goes; each AP's submit\n\t// says whether the caller may submit there.\n\tAssignment *APAssignmentInfo `json:\"assignment,omitempty\"`\n}\n```\nAPsResponse is GET /api/v1/aps.\n\n```go\ntype AdminClient struct {\n\tID            string    `json:\"id\"`\n\tRedirectURIs  []string  `json:\"redirect_uris,omitempty\"`\n\tGrantTypes    []string  `json:\"grant_types,omitempty\"`\n\tResponseTypes []string  `json:\"response_types,omitempty\"`\n\tScopes        []string  `json:\"scopes,omitempty\"`\n\tPublic        bool      `json:\"public\"`\n\tCreatedAt     time.Time `json:\"created_at\"`\n\n\t// ServiceSubject is the identity a client_credentials token from this\n\t// client asserts (the IDTOKEN subject the schedd authorizes). Empty unless\n\t// set by an admin; required before client_credentials will issue a token.\n\tServiceSubject string `json:\"service_subject,omitempty\"`\n\n\t// Name is what the client called itself at registration (RFC 7591\n\t// client_name). Empty for seeded clients and for anything registered\n\t// before we started keeping it.\n\tName string `json:\"name,omitempty\"`\n\t// Notes is the operator's own annotation, editable from the UI. It\n\t// is the only identifying field available for clients that predate\n\t// provenance tracking.\n\tNotes string `json:\"notes,omitempty\"`\n\t// Origin is \"dynamic\", \"seeded\", or empty for unknown. Empty is not\n\t// the same as \"not dynamic\" -- it means nobody recorded the answer.\n\tOrigin string `json:\"origin,omitempty\"`\n\t// LastUsedAt is when this client last obtained a token. Absent means\n\t// never, which for a dynamically registered client usually means an\n\t// app registered once and never came back.\n\t//\n\t// Written on a debounced background flush, so it can lag real usage\n\t// by up to a flush interval. It is a \"roughly when\", not an audit\n\t// record; oauth2_access_tokens has the per-token history.\n\tLastUsedAt *time.Time `json:\"last_used_at,omitempty\"`\n\t// RecentUsers is a rolling sample of the last few distinct subjects\n\t// to obtain a token through this client, newest first.\n\tRecentUsers []AdminClientUse `json:\"recent_users,omitempty\"`\n\t// RefreshBlockedBy names what stops this client from ever receiving\n\t// a refresh token, so its users re-authorize on every access-token\n\t// expiry. Empty means nothing does -- or that the client has no\n\t// interactive flow and so has no user to inconvenience.\n\tRefreshBlockedBy []string `json:\"refresh_blocked_by,omitempty\"`\n}\n```\nAdminClient is the SPA-facing shape for an OAuth2 client. We mirror only the fields useful for an \"audit + cleanup\" UI; secrets are never returned (they're hashed in storage anyway, but we still strip them out of the response shape on principle).\n\n```go\ntype AdminClientUse struct {\n\tSubject string    `json:\"subject\"`\n\tAt      time.Time `json:\"at\"`\n}\n```\nAdminClientUse is one entry of a client's recent-users sample.\n\n```go\ntype AdminCondorConfigEntry struct {\n\tKey      string `json:\"key\"`\n\tValue    string `json:\"value,omitempty\"`\n\tRedacted bool   `json:\"redacted,omitempty\"`\n\t// IsDefault reports that this key still holds HTCondor's compiled-in\n\t// value — nothing in this deployment's config files or environment\n\t// touched it. Roughly a thousand of the ~1085 keys in a stock config\n\t// are in this state, which is what makes an unfiltered dump tedious\n\t// to read, so the SPA offers to hide them.\n\tIsDefault bool `json:\"is_default,omitempty\"`\n}\n```\nAdminCondorConfigEntry is one (key, value) row from the HTCondor config that we surface to the admin info page. Sensitive values (matched by sensitiveCondorKeyPattern) come back with Redacted=true and an empty Value so the admin can SEE the key is set without the raw value rendering on screen — defense-in-depth even though HTCondor convention is that secrets are paths, not literals.\n\n```go\ntype AdminCondorConfigResponse struct {\n\tConfigured bool                     `json:\"configured\"`\n\tEntries    []AdminCondorConfigEntry `json:\"entries\"`\n\t// ModifiedCount is how many entries this deployment actually set,\n\t// so the SPA can label its filter without counting client-side.\n\tModifiedCount int `json:\"modified_count\"`\n}\n```\nAdminCondorConfigResponse is the full readout. Configured=false means no HTCondor config object was wired into this server; treat as \"feature unavailable on this deployment\" client-side.\n\n```go\ntype AdminConnector struct {\n\tID   string `json:\"id\"`\n\tKind string `json:\"kind\"`\n\t// Origin says which decision published it: a configuration\n\t// parameter, or that it is stored here.\n\tOrigin string `json:\"origin\"`\n\t// StoredHere is whether these values are this server's own record\n\t// rather than the HTCondor configuration. It is the difference\n\t// between a change that takes effect now and one that needs\n\t// condor_reconfig.\n\tStoredHere bool `json:\"stored_here\"`\n\t// Editable is whether a PUT will be accepted for it.\n\tEditable bool `json:\"editable\"`\n\t// Shadowed reports a STORED connector the configuration also\n\t// declares, and therefore overrides.\n\t//\n\t// Reported rather than hidden: a stored row that silently loses is\n\t// an operator editing a form to no effect and finding out from a\n\t// user.\n\tShadowed bool `json:\"shadowed,omitempty\"`\n\n\tEnabled bool `json:\"enabled\"`\n\t// Picker is whether this connector offers a browser file chooser.\n\t// It is reported because it is the only setting that widens the\n\t// page's Content-Security-Policy.\n\tPicker   bool     `json:\"picker\"`\n\tGroups   []string `json:\"groups\"`\n\tScopes   []string `json:\"scopes\"`\n\tTransfer string   `json:\"transfer\"`\n\n\tClientID string `json:\"client_id,omitempty\"`\n\t// SecretSet reports that a secret is held, without being one. The\n\t// secret itself is never rendered: not in full, not masked, not by\n\t// length.\n\tSecretSet       bool       `json:\"secret_set\"`\n\tSecretUpdatedAt *time.Time `json:\"secret_updated_at,omitempty\"`\n\t// SecretFile is the path the configuration names. The path is\n\t// configuration and public; the bytes are on disk and are not.\n\tSecretFile string `json:\"secret_file,omitempty\"`\n\n\t// Users and LastUsedAt answer the question an operator actually\n\t// has: is anyone using this?\n\tUsers      int        `json:\"users\"`\n\tLastUsedAt *time.Time `json:\"last_used_at,omitempty\"`\n\n\t// TransferMethod is the HTCondor plugin method that can use this\n\t// credential in direct mode, empty when none ships.\n\tTransferMethod string `json:\"transfer_method,omitempty\"`\n}\n```\nAdminConnector is one connector as the admin listing reports it.\n\n```go\ntype AdminConnectorRequest struct {\n\tID       string   `json:\"id\"`\n\tKind     string   `json:\"kind\"`\n\tClientID string   `json:\"client_id\"`\n\tSecret   *string  `json:\"client_secret,omitempty\"`\n\tAuthURL  string   `json:\"authorization_url\"`\n\tTokenURL string   `json:\"token_url\"`\n\tScopes   []string `json:\"scopes\"`\n\tGroups   []string `json:\"groups\"`\n\tTransfer string   `json:\"transfer\"`\n\tEnabled  *bool    `json:\"enabled,omitempty\"`\n}\n```\nAdminConnectorRequest creates or edits a stored connector.\n\nSecret is a POINTER so that absent and empty are different things: absent leaves the stored secret alone, and an explicit \"\" clears it. A form that round-tripped an absent field as \"\" would wipe a working connector's secret on an unrelated edit, and nobody would attribute that failure to the edit that caused it.\n\n```go\ntype AdminConnectorUser struct {\n\tSubject    string     `json:\"subject\"`\n\tObtainedAt time.Time  `json:\"obtained_at\"`\n\tLastUsedAt *time.Time `json:\"last_used_at,omitempty\"`\n}\n```\nAdminConnectorUser is one person's grant, for the per-connector view.\n\n```go\ntype AdminLogsResponse struct {\n\tEnabled bool                  `json:\"enabled\"`\n\tEntries []logging.BufferEntry `json:\"entries\"`\n}\n```\nAdminLogsResponse wraps the buffer entries with a hint when the buffer hasn't been initialized — the SPA shows a different empty state for \"no logs yet\" vs \"feature not wired up\".\n\n```go\ntype AdminRevokeRequest struct {\n\t// Subject is the user whose grants should be revoked. Matched exactly\n\t// against the subject recorded on each token row, which is the same\n\t// value the OAuth2 session carries (typically the username claim, not\n\t// the schedd's \"user@domain\" form).\n\tSubject string `json:\"subject\"`\n}\n```\nAdminRevokeRequest is the body of a token revocation request.\n\n```go\ntype AdminRevokeResponse struct {\n\tSubject string `json:\"subject\"`\n\t// Revoked counts token rows deactivated across both issuers.\n\tRevoked int64 `json:\"revoked\"`\n\t// OAuth2 and IDP break that count down by issuer, so an operator can\n\t// tell whether the user held MCP grants, IDP grants, or both.\n\tOAuth2 int64 `json:\"oauth2\"`\n\tIDP    int64 `json:\"idp\"`\n}\n```\nAdminRevokeResponse reports what was revoked.\n\n```go\ntype AdminRevokeTokenRequest struct {\n\t// Kind is \"access\" or \"refresh\" -- which table the fingerprint is in.\n\tKind string `json:\"kind\"`\n\t// Fingerprint is the redacted signature shown in the listing. The\n\t// trailing \"...\" may be included or not.\n\tFingerprint string `json:\"fingerprint\"`\n}\n```\nAdminRevokeTokenRequest names one token from the admin listing.\n\n```go\ntype AdminRevokeTokenResponse struct {\n\tRevoked  int64  `json:\"revoked\"`\n\tClientID string `json:\"client_id\"`\n\tSubject  string `json:\"subject,omitempty\"`\n}\n```\nAdminRevokeTokenResponse reports what the revocation actually hit.\n\n```go\ntype AdminSetTokenScopesRequest struct {\n\t// Kind is \"access\" or \"refresh\" -- which table the fingerprint is in.\n\tKind string `json:\"kind\"`\n\t// Fingerprint is the redacted signature shown in the listing.\n\tFingerprint string `json:\"fingerprint\"`\n\t// Scopes is the set to keep. Anything currently granted and absent\n\t// here is removed; anything here that is not currently granted is an\n\t// error rather than an addition.\n\tScopes []string `json:\"scopes\"`\n}\n```\nAdminSetTokenScopesRequest narrows one grant from the admin listing.\n\n```go\ntype AdminSetTokenScopesResponse struct {\n\tClientID string   `json:\"client_id\"`\n\tSubject  string   `json:\"subject,omitempty\"`\n\tScopes   []string `json:\"scopes\"`\n\tRemoved  []string `json:\"removed,omitempty\"`\n\tAdded    []string `json:\"added,omitempty\"`\n\tRows     int64    `json:\"rows\"`\n}\n```\nAdminSetTokenScopesResponse reports what the narrowing actually did.\n\n```go\ntype AdminSiteApp struct {\n\tID          string   `json:\"id\"`\n\tName        string   `json:\"name\"`\n\tDescription string   `json:\"description,omitempty\"`\n\tIcon        string   `json:\"icon,omitempty\"`\n\tGroups      []string `json:\"groups\"`\n\tHome        bool     `json:\"home\"`\n\tVersion     string   `json:\"version,omitempty\"`\n\tRevision    string   `json:\"revision,omitempty\"`\n\tDigest      string   `json:\"digest,omitempty\"`\n\t// Attested is whether a .sha256 accompanied the bundle and matched.\n\tAttested bool `json:\"attested\"`\n\t// Origin says who decided this app is published: a configuration\n\t// parameter name, or that it was uploaded.\n\tOrigin string `json:\"origin,omitempty\"`\n\t// Managed is whether this server can change it. An app the\n\t// configuration publishes is not editable here at all.\n\tManaged bool `json:\"managed\"`\n\t// URL is where it is served.\n\tURL string `json:\"url\"`\n\t// SizeBytes is the bundle file's size; 0 for a directory bundle.\n\tSizeBytes int64 `json:\"size_bytes,omitempty\"`\n\t// Source is where the bundle came from, for one this server\n\t// fetched. Absent for a bundle handed over as bytes: nothing about\n\t// a file picked from a laptop says where it was built.\n\tSource *AdminSiteAppSource `json:\"source,omitempty\"`\n\t// UploadedBy and UploadedAt are who published this bundle through\n\t// the web interface and when. Absent for an app the configuration\n\t// publishes: nothing records when a file was copied into the\n\t// directory, and the audit trail's first_seen is when a scan first\n\t// saw it rather than when it was put there.\n\tUploadedBy string     `json:\"uploaded_by,omitempty\"`\n\tUploadedAt *time.Time `json:\"uploaded_at,omitempty\"`\n}\n```\nAdminSiteApp is one app as the admin page shows it.\n\n```go\ntype AdminSiteAppConfigRequest struct {\n\tSettings map[string]string `json:\"settings\"`\n}\n```\nAdminSiteAppConfigRequest is PUT /api/v1/admin/site-apps/{id}/config.\n\nKeyed by the full parameter name, which is what the page shows. A key that is not one of this app's parameters is refused rather than ignored: a typo that silently changed nothing would read as a setting that does not work.\n\n```go\ntype AdminSiteAppConfigResponse struct {\n\tID string `json:\"id\"`\n\t// Origin is which decision published the app: a parameter name, or\n\t// that it was uploaded here.\n\tOrigin string `json:\"origin,omitempty\"`\n\t// StoredHere is whether these values are this server's own record\n\t// of an uploaded app rather than the HTCondor configuration. It is\n\t// the difference between a change that takes effect now and one\n\t// that needs condor_reconfig.\n\tStoredHere bool `json:\"stored_here\"`\n\t// Editable is whether this server will accept a PUT for this app.\n\tEditable bool                  `json:\"editable\"`\n\tSettings []AdminSiteAppSetting `json:\"settings\"`\n}\n```\nAdminSiteAppConfigResponse is GET /api/v1/admin/site-apps/{id}/config.\n\n```go\ntype AdminSiteAppHistoryEntry struct {\n\tDigest    string    `json:\"digest,omitempty\"`\n\tAttested  bool      `json:\"attested\"`\n\tVersion   string    `json:\"version,omitempty\"`\n\tRevision  string    `json:\"revision,omitempty\"`\n\tGroups    []string  `json:\"groups\"`\n\tHome      bool      `json:\"home\"`\n\tOrigin    string    `json:\"origin,omitempty\"`\n\tSizeBytes int64     `json:\"size_bytes,omitempty\"`\n\tFirstSeen time.Time `json:\"first_seen\"`\n\tLastSeen  time.Time `json:\"last_seen\"`\n}\n```\nAdminSiteAppHistoryEntry is one period an app was served.\n\n```go\ntype AdminSiteAppHistoryResponse struct {\n\tID      string                     `json:\"id\"`\n\tHistory []AdminSiteAppHistoryEntry `json:\"history\"`\n}\n```\nAdminSiteAppHistoryResponse is GET /api/v1/admin/site-apps/{id}/history.\n\n```go\ntype AdminSiteAppSetting struct {\n\t// Key is the full parameter name, e.g.\n\t// HTTP_API_SITE_APP_CRYOEM_GROUPS.\n\tKey string `json:\"key\"`\n\t// Setting is the part after the id: GROUPS, HOME, and so on.\n\tSetting string `json:\"setting\"`\n\t// Value is what is set, written the way a configuration file would\n\t// write it. Empty means nothing is set.\n\tValue string `json:\"value\"`\n\t// Effective is what is in force when that is not Value -- the\n\t// bundle's own label, or the default for a flag. Empty when Value\n\t// is what applies.\n\tEffective string `json:\"effective,omitempty\"`\n\t// EffectiveFrom says where Effective came from: \"bundle\" for a\n\t// label in the bundle's app.yaml, \"default\" for a flag nobody set.\n\tEffectiveFrom string `json:\"effective_from,omitempty\"`\n\t// Editable is whether a PUT to this endpoint may change it.\n\tEditable bool `json:\"editable\"`\n}\n```\nAdminSiteAppSetting is one configuration parameter of one app.\n\n```go\ntype AdminSiteAppSource struct {\n\t// Kind is how it was fetched. Only \"github\" today; present so a\n\t// second kind does not have to change the shape the page reads.\n\tKind  string `json:\"kind\"`\n\tRepo  string `json:\"repo\"`\n\tRef   string `json:\"ref,omitempty\"`\n\tAsset string `json:\"asset,omitempty\"`\n}\n```\nAdminSiteAppSource is the release an app was installed from.\n\nRef is the tag that was resolved at install time, never the word \"latest\": the admin page compares it against the repository's current release to decide whether an update exists, and a ref that meant \"whatever is newest\" would always compare equal.\n\n```go\ntype AdminSiteAppsResponse struct {\n\t// Enabled is whether site apps are configured at all.\n\tEnabled bool `json:\"enabled\"`\n\t// UploadAllowed is whether this server accepts uploaded bundles.\n\tUploadAllowed bool `json:\"upload_allowed\"`\n\t// GitHubAllowed is whether this server will fetch a bundle from a\n\t// GitHub release. False where the access point has no egress, so\n\t// the page can leave out an action that would only ever fail.\n\tGitHubAllowed bool `json:\"github_allowed\"`\n\t// Directory is where bundles live, so an administrator who cannot\n\t// upload knows where to put one.\n\tDirectory string         `json:\"directory,omitempty\"`\n\tApps      []AdminSiteApp `json:\"apps\"`\n}\n```\nAdminSiteAppsResponse is GET /api/v1/admin/site-apps.\n\n```go\ntype AdminToken struct {\n\tKind            string `json:\"kind\"` // \"access\" or \"refresh\"\n\tSignaturePrefix string `json:\"signature_prefix\"`\n\tClientID        string `json:\"client_id\"`\n\t// ClientName and Notes are the client's own label and the operator's\n\t// annotation, carried over from the clients page. A client id is a\n\t// generated string; \"OpenClaw MCP\" is what somebody reading this page\n\t// is actually looking for.\n\tClientName string   `json:\"client_name,omitempty\"`\n\tNotes      string   `json:\"notes,omitempty\"`\n\tSubject    string   `json:\"subject,omitempty\"`\n\tScopes     []string `json:\"scopes,omitempty\"`\n\t// AuthorizedScopes is everything this authorization ended with. Scopes\n\t// is the subset in force now, so the difference is what an operator\n\t// switched off and may switch back on.\n\tAuthorizedScopes []string  `json:\"authorized_scopes,omitempty\"`\n\tActive           bool      `json:\"active\"`\n\tRequestedAt      time.Time `json:\"requested_at\"`\n\tExpiresAt        time.Time `json:\"expires_at,omitempty\"`\n}\n```\nAdminToken is the SPA-facing shape for an OAuth2 access/refresh token row. We never expose the raw token signature — only its prefix as a fingerprint, so admins can correlate against logs without being able to use the token themselves.\n\n```go\ntype AdminUsageKind struct {\n\tKind    string `json:\"kind\"`\n\tLabel   string `json:\"label\"`\n\tEnabled bool   `json:\"enabled\"`\n}\n```\nAdminUsageKind is one tab: a kind and whether it is being counted.\n\n```go\ntype AdminUsageResponse struct {\n\tEnabled bool `json:\"enabled\"`\n\t// Kinds lists every kind this server can report on, so the page\n\t// can draw its tabs from the server rather than hard-coding them.\n\t// Present whether or not the requested kind is enabled.\n\tKinds []AdminUsageKind `json:\"kinds\"`\n\t*usagestats.Summary\n}\n```\nAdminUsageResponse is the admin usage page's data. Enabled=false means this server is not counting calls of the requested kind; the summary fields are then absent.\n\n```go\ntype AdvertiseRequest struct {\n\tAd      *classad.ClassAd `json:\"ad,omitempty\"`       // Single ad (JSON body)\n\tCommand string           `json:\"command,omitempty\"`  // Optional UPDATE command (e.g., \"UPDATE_STARTD_AD\")\n\tWithAck bool             `json:\"with_ack,omitempty\"` // Request acknowledgment\n}\n```\nAdvertiseRequest represents a request to advertise to the collector\n\n```go\ntype AdvertiseResponse struct {\n\tSuccess   bool     `json:\"success\"`\n\tMessage   string   `json:\"message,omitempty\"`\n\tSucceeded int      `json:\"succeeded\"`        // Number of ads successfully advertised\n\tFailed    int      `json:\"failed\"`           // Number of ads that failed\n\tErrors    []string `json:\"errors,omitempty\"` // Error messages for failed ads\n}\n```\nAdvertiseResponse represents the response from advertise\n\n```go\ntype AdviceDeclined struct {\n\tAdvice string `json:\"advice\"`\n\tReason string `json:\"reason\"`\n}\n```\nAdviceDeclined is advice that cannot be applied to queued jobs.\n\n```go\ntype AppCreateRequest struct {\n\tType        string `json:\"type,omitempty\"`\n\tCpus        int    `json:\"cpus,omitempty\"`\n\tMemoryMB    int    `json:\"memory_mb,omitempty\"`\n\tDiskMB      int    `json:\"disk_mb,omitempty\"`\n\tImage       string `json:\"image,omitempty\"`\n\tWorkdir     string `json:\"workdir,omitempty\"`\n\tSubmitLines string `json:\"submit_lines,omitempty\"`\n}\n```\nAppCreateRequest is the body of POST /api/v1/apps.\n\n```go\ntype AppListResponse struct {\n\tApps []AppSummary `json:\"apps\"`\n}\n```\nAppListResponse is the body of GET /api/v1/apps.\n\n```go\ntype AppSummary struct {\n\t// ID names the app in /api/v1/apps/{id}. In multi-AP mode it is\n\t// \"\u003cid\u003e@\u003cschedd\u003e\", naming the access point the app is on.\n\tID    string `json:\"id\"`\n\tType  string `json:\"type\"`\n\tJobID string `json:\"job_id\"`\n\t// Schedd is the access point the app is on, in multi-AP mode, where\n\t// JobID is the complete id.\n\tSchedd string `json:\"schedd,omitempty\"`\n\tOwner  string `json:\"owner,omitempty\"`\n\tState  string `json:\"state\"`\n\t// Detail says why, for a state a caller would otherwise have to\n\t// guess at: what it is waiting for, or why it is held.\n\tDetail string `json:\"detail,omitempty\"`\n\t// URL is where to open it, once there is something to open.\n\tURL string `json:\"url,omitempty\"`\n\t// Submitted is the queue date, so a caller can say how long a\n\t// wait has been going on.\n\tSubmitted int64 `json:\"submitted,omitempty\"`\n}\n```\nAppSummary is one app as reported to a caller.\n\n```go\ntype AuthMeResponse struct {\n\tAuthenticated bool     `json:\"authenticated\"`\n\tUsername      string   `json:\"username,omitempty\"`\n\tGroups        []string `json:\"groups,omitempty\"`\n\tIsAdmin       bool     `json:\"is_admin\"`\n\t// SiteApps are the operator-deployed web apps this session may see,\n\t// already filtered by group. This is the one place app visibility\n\t// is computed for the UI, so the sidebar, the switcher and the\n\t// app-only redirect cannot disagree with the gate on /site/ about\n\t// who sees what.\n\tSiteApps []SiteAppSummary `json:\"site_apps,omitempty\"`\n\t// AppOnly reports that this session is normally sent to its app\n\t// instead of the dashboard, so the SPA can collapse its navigation\n\t// and offer the way back. Presentation only: it restricts nothing,\n\t// and every page remains reachable.\n\tAppOnly bool `json:\"app_only,omitempty\"`\n\t// ExpertActive reports that the session has stepped through the\n\t// expert door and is seeing the full console on purpose. The SPA\n\t// shows the way back to the app on this.\n\tExpertActive bool `json:\"expert_active,omitempty\"`\n\t// SuperuserAllowed reports that this session MAY arm superuser mode --\n\t// the feature is configured and the session is in the superuser group.\n\t// It says nothing about whether the mode is currently on.\n\tSuperuserAllowed bool `json:\"superuser_allowed\"`\n\t// SuperuserActive reports that the mode is armed right now. The SPA\n\t// shows its warning banner on this, so every page can tell the user\n\t// that their next action may land on somebody else's job.\n\tSuperuserActive bool `json:\"superuser_active\"`\n\t// SuperuserExpiresAt is when the mode disarms itself. Surfaced so the\n\t// banner can say how long is left rather than have the mode silently\n\t// lapse mid-task.\n\tSuperuserExpiresAt *time.Time `json:\"superuser_expires_at,omitempty\"`\n\t// SuperuserIdentity is what actions will be attributed to on the schedd\n\t// while the mode is armed, and SuperuserNote explains it if that is not\n\t// the operator themselves.\n\tSuperuserIdentity string `json:\"superuser_identity,omitempty\"`\n\tSuperuserNote     string `json:\"superuser_note,omitempty\"`\n\t// SuperuserScope is \"global\" or \"project\" while the mode is armed, and\n\t// SuperuserProjects the projects a project-scoped session may act in,\n\t// so the banner can say which. Re-read on every request, as the\n\t// actions themselves are.\n\tSuperuserScope    string   `json:\"superuser_scope,omitempty\"`\n\tSuperuserProjects []string `json:\"superuser_projects,omitempty\"`\n\t// ProjectLeadOf lists the projects this session leads, armed or not.\n\t// Leads may list their projects' jobs without arming, the way admins\n\t// may list everyone's, so the UI offers them the same scope toggle.\n\tProjectLeadOf []string `json:\"project_lead_of,omitempty\"`\n\t// MultiAP reports that this server fronts several access points; the\n\t// SPA shows the AP column and offers only what that mode serves.\n\tMultiAP bool `json:\"multi_ap,omitempty\"`\n\t// Assignment is where this session's new work goes, in multi-AP mode.\n\tAssignment *APAssignmentInfo `json:\"assignment,omitempty\"`\n\t// PlacementOnly reports a session that maps to no local account and\n\t// reaches only the placement pages.\n\tPlacementOnly bool `json:\"placement_only,omitempty\"`\n\t// Placement is the session's placement identity, present when this\n\t// server issues placement tokens and the session has one.\n\tPlacement *PlacementSessionInfo `json:\"placement,omitempty\"`\n\t// PoolIdentityRestricted reports that this session may not read who\n\t// is running on a slot, so the pool pages can say so rather than\n\t// render an empty column that reads as \"nobody is running here\".\n\t//\n\t// Advisory, for rendering only. The restriction is enforced on every\n\t// collector read regardless of what the SPA does with this.\n\tPoolIdentityRestricted bool `json:\"pool_identity_restricted,omitempty\"`\n\t// Reservations reports that this server runs the reservation\n\t// subsystem, so the SPA offers the admin page for it. Advisory: the\n\t// endpoints refuse regardless when it is off.\n\tReservations bool `json:\"reservations,omitempty\"`\n\t// Interactive names the built-in interactive applications this\n\t// access point offers, in the order the Interactive page shows them:\n\t// some of \"jupyter\", \"vscode\", \"terminal\". Empty means none, and the\n\t// SPA then drops the Interactive item from its navigation -- an\n\t// entry leading to three explanations of why nothing can be started\n\t// is worse than no entry.\n\t//\n\t// NOT omitempty, and never nil: \"this access point offers none\" and\n\t// \"a server too old to say\" must not be the same answer on the\n\t// wire. They need opposite handling -- the first hides the\n\t// applications, the second has to show them, because every server\n\t// before this field offered all three. omitempty made an empty list\n\t// absent and so made an old server look like a site that offers\n\t// nothing, which hid the applications from every caller of one.\n\t//\n\t// Advisory, like the rest of this response: creating a session in an\n\t// app this does not list is refused regardless of what the SPA does\n\t// with it.\n\tInteractive []string `json:\"interactive\"`\n\t// SSHToJob reports whether anything may reach into a running job\n\t// here, so the job page can leave out its terminal rather than\n\t// offer one that cannot connect.\n\t//\n\t// Not omitempty either, and for the same reason as the field above:\n\t// this is normally TRUE, so omitting the false case would make \"not\n\t// allowed\" and \"a server too old to say\" the same answer, and the\n\t// SPA has to tell them apart -- one hides a working feature and the\n\t// other offers a broken one.\n\tSSHToJob bool `json:\"ssh_to_job\"`\n}\n```\nAuthMeResponse describes the currently-authenticated browser session.\n\nThe Web UI uses this as its single source of truth for \"is the user logged in\", who they are, and whether to render admin pages. It is intentionally looser than /api/v1/whoami: it always returns 200 (with Authenticated=false when there is no session) so the SPA can render a landing page without going through error-handling.\n\n```go\ntype BatchDag struct {\n\tAttributes map[string]any `json:\"attributes\"`\n\tStatus     *int64         `json:\"status\"`\n\tSource     string         `json:\"source\"`\n}\n```\nBatchDag is a DAG's root DAGMan job.\n\n```go\ntype BatchFinished struct {\n\tJobs        int            `json:\"jobs\"`\n\tTruncated   bool           `json:\"truncated\"`\n\tLimit       int            `json:\"limit\"`\n\tSucceeded   int            `json:\"succeeded\"`\n\tFailed      int            `json:\"failed\"`\n\tRemoved     int            `json:\"removed\"`\n\tOutcomes    []BatchOutcome `json:\"outcomes\"`\n\tRuntime     *BatchRuntime  `json:\"runtime,omitempty\"`\n\tWallHours   float64        `json:\"wall_hours\"`\n\tBadputHours float64        `json:\"badput_hours\"`\n\tCoreHours   float64        `json:\"core_hours\"`\n\tMemory      *BatchMemory   `json:\"memory,omitempty\"`\n}\n```\nBatchFinished is the batch's history records, summarized.\n\n```go\ntype BatchHoldExample struct {\n\tID      string `json:\"id\"`\n\tMessage string `json:\"message\"`\n}\n```\nBatchHoldExample is one job with a hold reason.\n\n```go\ntype BatchHoldReason struct {\n\tKind     string             `json:\"kind\"`\n\tTemplate string             `json:\"template\"`\n\tCount    int                `json:\"count\"`\n\tCodes    []issues.CodeCount `json:\"codes\"`\n\tExamples []BatchHoldExample `json:\"examples\"`\n}\n```\nBatchHoldReason is one kind of hold among the batch's jobs.\n\n```go\ntype BatchJobRow struct {\n\tID               string         `json:\"id\"`\n\tCluster          int64          `json:\"cluster\"`\n\tProc             int64          `json:\"proc\"`\n\tSource           string         `json:\"source\"`\n\tStatus           batches.Status `json:\"status\"`\n\tNode             string         `json:\"node,omitempty\"`\n\tDagman           bool           `json:\"dagman,omitempty\"`\n\tOutcome          string         `json:\"outcome,omitempty\"`\n\tExitCode         *int64         `json:\"exit_code,omitempty\"`\n\tExitSignal       *int64         `json:\"exit_signal,omitempty\"`\n\tSubmitted        *int64         `json:\"submitted,omitempty\"`\n\tStarted          *int64         `json:\"started,omitempty\"`\n\tFinished         *int64         `json:\"finished,omitempty\"`\n\tRuntimeSeconds   *float64       `json:\"runtime_seconds,omitempty\"`\n\tRequestMemoryMiB *float64       `json:\"request_memory_mib,omitempty\"`\n\tPeakMemoryMiB    *float64       `json:\"peak_memory_mib,omitempty\"`\n\tRequestCpus      *float64       `json:\"request_cpus,omitempty\"`\n\tCoresUsed        *float64       `json:\"cores_used,omitempty\"`\n\tHoldReason       string         `json:\"hold_reason,omitempty\"`\n\tHoldCode         *int64         `json:\"hold_code,omitempty\"`\n}\n```\nBatchJobRow is one job of the batch, queued or finished.\n\n```go\ntype BatchJobsResponse struct {\n\tID               int64         `json:\"id\"`\n\tTotal            int           `json:\"total\"`\n\tOffset           int           `json:\"offset\"`\n\tNextOffset       *int          `json:\"next_offset\"`\n\tLiveTruncated    bool          `json:\"live_truncated\"`\n\tHistoryTruncated bool          `json:\"history_truncated\"`\n\tJobs             []BatchJobRow `json:\"jobs\"`\n}\n```\nBatchJobsResponse is GET /api/v1/batches/{id}/jobs.\n\n```go\ntype BatchMemory struct {\n\tCount      int     `json:\"count\"`\n\tRequestP50 float64 `json:\"request_p50\"`\n\tPeakP50    float64 `json:\"peak_p50\"`\n\tPeakP95    float64 `json:\"peak_p95\"`\n\tPeakMax    float64 `json:\"peak_max\"`\n}\n```\nBatchMemory is the completed jobs' memory, MiB.\n\n```go\ntype BatchOutcome struct {\n\tOutcome string `json:\"outcome\"`\n\tCode    *int64 `json:\"code,omitempty\"`\n\tCount   int    `json:\"count\"`\n}\n```\nBatchOutcome is one way the batch's jobs ended.\n\n```go\ntype BatchResponse struct {\n\tKind             batches.Kind           `json:\"kind\"`\n\tID               int64                  `json:\"id\"`\n\tName             string                 `json:\"name\"`\n\tOwner            string                 `json:\"owner,omitempty\"`\n\tConstraint       string                 `json:\"constraint\"`\n\tRemoveConstraint string                 `json:\"remove_constraint\"`\n\tClusters         []int64                `json:\"clusters\"`\n\tDagmanJobID      string                 `json:\"dagman_job_id,omitempty\"`\n\tSubmitted        *int64                 `json:\"submitted,omitempty\"`\n\tFirstStart       *int64                 `json:\"first_start,omitempty\"`\n\tLastCompletion   *int64                 `json:\"last_completion,omitempty\"`\n\tProgress         batches.Progress       `json:\"progress\"`\n\tLive             map[batches.Status]int `json:\"live\"`\n\tLiveJobs         int                    `json:\"live_jobs\"`\n\tLiveTruncated    bool                   `json:\"live_truncated\"`\n\tFinished         BatchFinished          `json:\"finished\"`\n\tHoldReasons      []BatchHoldReason      `json:\"hold_reasons\"`\n\tDag              *BatchDag              `json:\"dag,omitempty\"`\n\tWorkflows        []BatchWorkflow        `json:\"workflows\"`\n\tHasHistory       bool                   `json:\"has_history\"`\n\tFetchedAt        int64                  `json:\"fetched_at\"`\n}\n```\nBatchResponse is GET /api/v1/batches/{id}. See BATCH\\_CONTRACT.md.\n\n```go\ntype BatchRuntime struct {\n\tCount int     `json:\"count\"`\n\tP10   float64 `json:\"p10\"`\n\tP50   float64 `json:\"p50\"`\n\tP90   float64 `json:\"p90\"`\n\tMax   float64 `json:\"max\"`\n\tMean  float64 `json:\"mean\"`\n}\n```\nBatchRuntime is the completed jobs' runtimes, seconds.\n\n```go\ntype BatchWorkflow struct {\n\tKey          string `json:\"key\"`\n\tName         string `json:\"name\"`\n\tExecutable   string `json:\"executable\"`\n\tJobs         int    `json:\"jobs\"`\n\tFinishedJobs int    `json:\"finished_jobs\"`\n}\n```\nBatchWorkflow is a Utilization workflow the batch's jobs fall in.\n\n```go\ntype CalendarBucketing struct {\n\tSubmitted string `json:\"submitted\"`\n\tCompleted string `json:\"completed\"`\n\tRemoved   string `json:\"removed\"`\n}\n```\nCalendarBucketing names the attribute each series was bucketed on.\n\nReported rather than left implicit because a drill-down has to ask the same question the figure answered, and the obvious guesses are wrong. The finished and removed series are bucketed on EnteredHistoryTime -- the stamp described in the file header -- NOT on CompletionDate, which a removed job does not have at all, and not on EnteredCurrentStatus, which EnteredHistoryTime only usually equals. The two normally agree to the second and occasionally do not: a job whose terminal transition and completion straddle midnight, or one stamped from the ingest clock after a backlog drain, lands on a different day here than a constraint on CompletionDate would put it, and the drill-down then shows a total that disagrees with the number it was reached from.\n\nThe submitted series is the one place the attribute is not the whole story: it is a union of the history archive and the live queue, both bucketed on QDate, so a drill-down must read BOTH or it undercounts by exactly the jobs that are still running. A QDate day-range alone is enough to reproduce it on each -- the archive half's window on EnteredHistoryTime is implied, since a job submitted inside the window cannot have entered history before it.\n\n```go\ntype CalendarDay struct {\n\t// Day is the bucket start, unix seconds, UTC midnight.\n\tDay       int64 `json:\"day\"`\n\tSubmitted int   `json:\"submitted\"`\n\tCompleted int   `json:\"completed\"`\n\tRemoved   int   `json:\"removed\"`\n\tInQueue   int   `json:\"in_queue\"`\n}\n```\nCalendarDay is one day's row. Every day in the window gets one, zeros included: a day with no jobs and a day the archive cannot answer for are different facts, and omitting the empty ones would leave the panel unable to tell them apart (that is what partial and note are for).\n\n```go\ntype CalendarQueueDepth struct {\n\tDerived bool `json:\"derived\"`\n\tAnchor  int  `json:\"anchor\"`\n}\n```\nCalendarQueueDepth describes where the in\\_queue series came from.\n\nBoth fields are reported rather than assumed, because the series is not measured. It is walked backwards from Anchor -- the live count -- through the flows, so every day's depth carries the accumulated error of every job that left the queue without entering history. Saying \"derived, from this anchor\" is what lets a reader distinguish a drift from a real backlog.\n\nAnchor and the LAST day's in\\_queue are guaranteed equal whenever this block is present: deriveQueueDepth assigns the anchor to that day and walks backwards from it, so they are one number reported twice rather than two that could drift. A panel may render either -- as the figure beside the chart or as the last plotted point -- without the two disagreeing. (When the live count could not be read this block is absent and every in\\_queue is zero; partial and note say so.)\n\n```go\ntype CalendarResponse struct {\n\t// Enabled is false where nothing can answer -- no mirror -- in which\n\t// case there are no days. Reported rather than errored, the same way\n\t// handlers_metrics.go reports an absent sampler: a page hides a\n\t// feature it cannot have, it does not show an error for one.\n\tEnabled    bool          `json:\"enabled\"`\n\tDays       []CalendarDay `json:\"days,omitempty\"`\n\tWindowDays int           `json:\"window_days,omitempty\"`\n\t// Step is the bucket width in seconds, which is also the spacing\n\t// between consecutive Day values. Reported rather than left at an\n\t// assumed 86400 so a reader laying out weeks or looking for gaps is\n\t// not silently wrong if a coarser bucket is ever offered.\n\tStep       int64               `json:\"step,omitempty\"`\n\tQueueDepth *CalendarQueueDepth `json:\"queue_depth,omitempty\"`\n\t// BucketedOn says which attribute each series was bucketed on, so a\n\t// drill-down can ask the same question the figure answered.\n\tBucketedOn *CalendarBucketing `json:\"bucketed_on,omitempty\"`\n\tSource     string             `json:\"source,omitempty\"`\n\tComputedAt int64              `json:\"computed_at,omitempty\"`\n\t// Partial says some of this is missing or approximate, and Note says\n\t// which: the archive does not reach back over the whole window, or\n\t// the mirror answered only part of it.\n\tPartial bool   `json:\"partial\"`\n\tNote    string `json:\"note\"`\n\t// UnusableSubmit is how many jobs could not be placed on any submit\n\t// day because their QDate is not a date (see calendarQDateFloor).\n\t// NOT serialized: it is a mirror-integrity fact for the operator's log\n\t// and for tests, not something a chart's reader can do anything with.\n\tUnusableSubmit int `json:\"-\"`\n}\n```\nCalendarResponse is the whole panel.\n\n```go\ntype ClientOrigin string\n```\nClientOrigin says how a client came to exist. The empty value is meaningful and is not the same as \"not dynamic\": it marks a row that predates the column, where the answer was never recorded. Rendering that as \"not dynamically registered\" would assert something nobody checked.\n\n```go\nconst (\n\t// ClientOriginUnknown is a row that predates provenance tracking.\n\tClientOriginUnknown ClientOrigin = \"\"\n\t// ClientOriginDynamic is a client that registered itself through\n\t// /mcp/oauth2/register (RFC 7591).\n\tClientOriginDynamic ClientOrigin = \"dynamic\"\n\t// ClientOriginSeeded is a client this server created at startup.\n\tClientOriginSeeded ClientOrigin = \"seeded\"\n\t// ClientOriginAdmin is a client an operator created through the admin\n\t// page, which is the only way to get one holding a grant that acts\n\t// with no user present.\n\tClientOriginAdmin ClientOrigin = \"admin\"\n\t// ClientOriginUser is a client a user created for themselves. It is\n\t// the only origin that comes with an owner.\n\tClientOriginUser ClientOrigin = \"user\"\n)\n```\n\n```go\ntype CollectorAdsResponse struct {\n\tAds []*classad.ClassAd `json:\"ads\"`\n}\n```\nCollectorAdsResponse represents collector ads listing response\n\n```go\ntype Config struct {\n\tListenAddr string // Address to listen on (e.g., \":8080\")\n\t// MCPListenAddr, when set, serves MCP on its own listener instead of\n\t// alongside the web UI and the REST API. Empty is the default and\n\t// keeps everything on one port.\n\t//\n\t// A separate port is worth having only if the split is real, so the\n\t// protocol endpoint then answers there and not on the main listener.\n\t// The OAuth2 endpoints stay on both: a client that reaches either has\n\t// to be able to finish authenticating.\n\tMCPListenAddr string\n\tScheddName    string // Schedd name\n\tScheddAddr    string // Schedd address (e.g., \"127.0.0.1:9618\"). If empty, discovered from collector.\n\t// MultiAP serves every access point matching a ScheddAd constraint;\n\t// see HandlerConfig.MultiAP.\n\tMultiAP MultiAPConfig\n\n\t// ScheddAddrDiscovered says ScheddAddr was resolved from the collector\n\t// rather than set by an operator.\n\t//\n\t// It matters because the two look identical here and behave\n\t// differently: a pinned address is honoured even when the collector\n\t// disagrees, while a discovered one must follow the collector. The\n\t// daemon resolves the address in main() and passes the result, so\n\t// without this every deployment that only sets SCHEDD_NAME looked\n\t// pinned -- and kept dialling the dead socket of a schedd that had\n\t// restarted, forever. See issue #308.\n\tScheddAddrDiscovered bool\n\tUserHeader           string // HTTP header to extract username from (optional)\n\t// UserHeaderTrustedProxies is the CIDR list from which UserHeader\n\t// is honored. See HandlerConfig.UserHeaderTrustedProxies for\n\t// full docs and the security rationale. Configurable via\n\t// HTTP_API_USER_HEADER_TRUSTED_PROXIES.\n\tUserHeaderTrustedProxies []string\n\t// TrustedProxies lists CIDRs whose forwarded headers are honored for\n\t// access logging. Empty means none are. HTTP_API_TRUSTED_PROXIES.\n\tTrustedProxies []string\n\t// UserHeaderTrustAnyUnsafe disables the trusted-proxy gate and\n\t// honors UserHeader from any source. Demo / test only — see\n\t// HandlerConfig.UserHeaderTrustAnyUnsafe. Configurable via\n\t// HTTP_API_USER_HEADER_TRUST_ANY.\n\tUserHeaderTrustAnyUnsafe bool\n\tSigningKeyPath           string // Path to token signing key (optional, for token generation)\n\tTrustDomain              string // Trust domain: issuer of minted tokens, and the only issuer accepted for a bearer IDTOKEN (optional)\n\tUIDDomain                string // UID domain for generated token username (optional; only used if UserHeader is set)\n\tHTTPBaseURL              string // Base URL for HTTP API (e.g., \"http://localhost:8080\") for generating file download links in MCP responses\n\n\t// MCPBaseURL is the public base URL of the MCP listener, when MCP has\n\t// its own port and that port is published under a different origin\n\t// than the web UI. Empty means MCP is reached at the same base URL as\n\t// everything else, which is true whenever the ports are combined and\n\t// whenever a split is only local.\n\t//\n\t// It exists for one attribute: RFC 9728 requires the protected-resource\n\t// document to name the resource the client asked about, and a client\n\t// that reaches MCP on another origin asked about that origin. Naming\n\t// the web UI's instead makes the document one the client must reject.\n\tMCPBaseURL string\n\t// CCB decides how to reach a daemon behind a Condor Connection Broker:\n\t// on an inbound path of this server's own (see sharedportrouter), or by\n\t// having the broker relay. Set once by the operator and applied to every\n\t// surface that reaches into a running job -- a shell, a session, tailing\n\t// output -- so two of them cannot disagree. Nil keeps cedar's default,\n\t// which only works on a host the execute nodes can reach.\n\tCCB           *htcondor.CCBDialer\n\tTLSCertFile   string              // Path to TLS certificate file (optional, enables HTTPS)\n\tTLSKeyFile    string              // Path to TLS key file (optional, enables HTTPS)\n\tTLSCACertFile string              // Path to TLS CA certificate file (optional, for trusting self-signed certs)\n\tReadTimeout   time.Duration       // HTTP read timeout (default: 30s)\n\tWriteTimeout  time.Duration       // HTTP write timeout (default: 30s)\n\tIdleTimeout   time.Duration       // HTTP idle timeout (default: 120s)\n\tCollector     *htcondor.Collector // Collector for metrics (optional)\n\t// JobQueueLogPath, if set, is the path to the schedd's job_queue.log; the\n\t// server mirrors it into a watch-enabled collection and serves\n\t// /api/v1/jobs/watch (SSE) from it. Empty disables the jobs watch endpoint.\n\tJobQueueLogPath string\n\tEnableMetrics   bool // Enable /metrics endpoint (default: true if Collector is set)\n\t// UsageStatsFlushInterval is how often the call counters -- MCP\n\t// tool calls and REST API requests alike -- are written to the\n\t// application database. Zero means the default.\n\tUsageStatsFlushInterval time.Duration\n\t// UsageStatsMaxLabelValues caps distinct values per /metrics label\n\t// for usage statistics. Zero means the default.\n\tUsageStatsMaxLabelValues int\n\t// UsageStatsOmitUser renders every /metrics user label as a single\n\t// placeholder, for a site that does not want usernames on a\n\t// potentially public endpoint. The durable table is unaffected.\n\tUsageStatsOmitUser bool\n\t// UsageStatsMaxSeries caps how many distinct series each kind\n\t// holds at all. Zero means the default.\n\tUsageStatsMaxSeries int\n\t// RESTStatsEnabled counts REST API requests the same way MCP tool\n\t// calls are counted (HTTP_API_REST_STATS).\n\tRESTStatsEnabled bool\n\t// UtilizationMaxJobs is HTTP_API_UTILIZATION_MAX_JOBS: the most jobs\n\t// one /api/v1/utilization analysis may read. Zero means the default.\n\tUtilizationMaxJobs int\n\t// SpoolMaxUploadBytes is HTTP_API_SPOOL_MAX_UPLOAD_BYTES: the most\n\t// one upload command may transfer. Zero means the default.\n\tSpoolMaxUploadBytes int64\n\t// RuntimeEstimateInterval and RuntimeEstimateBackfill are\n\t// HTTP_API_RUNTIME_ESTIMATE_INTERVAL and _BACKFILL. See the\n\t// HandlerConfig fields of the same names.\n\tRuntimeEstimateInterval time.Duration\n\tRuntimeEstimateBackfill time.Duration\n\tMetricsCacheTTL         time.Duration // Metrics cache TTL (default: 10s)\n\t// MetricsPublic disables the API-key auth gate on /metrics.\n\t// Configurable via HTTP_API_METRICS_PUBLIC; see HandlerConfig.\n\tMetricsPublic bool\n\n\t// htcondordb mirror routing; see HandlerConfig for what each does.\n\tDBMirrorName     string          // HTTP_API_DBMIRROR_NAME\n\tDBMirrorAddress  string          // HTTP_API_DBMIRROR_ADDRESS\n\tDBMirrorRequired bool            // HTTP_API_DBMIRROR_REQUIRED\n\tLogger           *logging.Logger // Logger instance (optional, creates default if nil)\n\tJupyterWorkDir   string          // Per-instance scratch dir for JupyterLab submission artifacts; default \u003cTempDir\u003e/htcondor-api-jupyter\n\t// JupyterMaxLifetimeSec is the wall-clock ceiling on a JupyterLab\n\t// session, and JupyterKernelIdleSec the kernel-idle limit after\n\t// which JupyterLab culls and shuts down. Zero disables either.\n\tJupyterMaxLifetimeSec int\n\tJupyterKernelIdleSec  int\n\t// JupyterStartGraceSec is how long a JupyterLab job may wait in the\n\t// queue before the schedd removes it (and its token expires), and\n\t// JupyterReconnectGraceSec how long a session whose tunnel dropped is\n\t// kept for its helper to dial back. Zero means the default.\n\tJupyterStartGraceSec     int\n\tJupyterReconnectGraceSec int\n\n\t// InteractiveExtraSubmit is an optional verbatim block of extra\n\t// HTCondor submit-file directives merged into every\n\t// interactive-terminal and Jupyter job. See\n\t// HandlerConfig.InteractiveExtraSubmit for the trust model and\n\t// full documentation. Configurable via\n\t// HTTP_API_INTERACTIVE_EXTRA_SUBMIT.\n\tInteractiveExtraSubmit string\n\n\t// DagmanPath is where condor_dagman lives on the access point, for\n\t// the submit_dag tool. See HandlerConfig.DagmanPath. Configurable\n\t// via HTTP_API_DAGMAN_PATH.\n\tDagmanPath string\n\n\t// DagmanEnvironment is extra environment for the DAGMan manager job.\n\t// See HandlerConfig.DagmanEnvironment. Configurable via\n\t// HTTP_API_DAGMAN_ENVIRONMENT.\n\tDagmanEnvironment map[string]string\n\n\t// InteractiveRequirements is an optional ClassAd expression ANDed into\n\t// the interactive terminal job's Requirements. See\n\t// HandlerConfig.InteractiveRequirements.\n\tInteractiveRequirements string\n\n\t// VSCodeImage is the container image a code-server app runs; see\n\t// HandlerConfig.VSCodeImage.\n\tVSCodeImage string\n\n\t// Build is the site's container-build configuration; see\n\t// mcpserver.BuildConfig and HandlerConfig.Build.\n\tBuild mcpserver.BuildConfig\n\t// SubmitFileDefaults and SubmitFileOverrides are the site-wide\n\t// submit-file policy applied to EVERY submission -- REST, templates,\n\t// interactive, Jupyter and MCP alike. Defaults apply only where the\n\t// submit file is silent; overrides win over it. See\n\t// HandlerConfig for the trust model.\n\t// DBMirrorTokenSubject overrides the identity the htcondordb token\n\t// asserts. See HandlerConfig.\n\tDBMirrorTokenSubject string\n\n\tSubmitFileDefaults  string\n\tSubmitFileOverrides string\n\n\t// Idempotency-key enforcement; see HandlerConfig for what each\n\t// does. Configurable via HTTP_API_IDEMPOTENCY_KEY_CHECK,\n\t// _RETENTION, _TIMEOUT and _HISTORY_WINDOW.\n\tIdempotencyKeyCheck         string\n\tIdempotencyKeyRetention     time.Duration\n\tIdempotencyKeyTimeout       time.Duration\n\tIdempotencyKeyHistoryWindow time.Duration\n\n\t// Batch-submission template paths.\n\tTemplateGlobalPath string // Optional YAML file with operator-curated templates\n\t// TemplateUserStoreDBPath is deprecated; the templates store\n\t// shares the unified DBPath. Kept so existing callers compile.\n\tTemplateUserStoreDBPath string //nolint:unused // back-compat; ignored.\n\tEnableMCP               bool   // Serve MCP at /mcp. See HandlerConfig.EnableMCP.\n\t// MCPOAuth2Disabled serves MCP with the forwarded-HTCondor-token\n\t// path alone (HTTP_API_MCP_OAUTH2 = false). Stated negatively so the\n\t// zero value serves OAuth2. See HandlerConfig.MCPOAuth2Disabled.\n\tMCPOAuth2Disabled bool\n\t// Reservations turns the reservation subsystem on: the admin API,\n\t// the admin page and the controller that holds pool capacity. Off\n\t// unless configured, because it evicts other people's jobs.\n\tReservations bool\n\t// SSHToJobDisabled withdraws everything built on condor_ssh_to_job\n\t// (HTTP_API_SSH_TO_JOB = false). Stated negatively so the zero\n\t// value allows it. See ssh_to_job.go.\n\tSSHToJobDisabled bool\n\t// InteractiveJupyterDisabled, InteractiveVSCodeDisabled and\n\t// InteractiveTerminalDisabled withhold one of the three built-in\n\t// interactive applications (HTTP_API_INTERACTIVE_JUPYTER,\n\t// _VSCODE, _TERMINAL = false).\n\t//\n\t// Stated negatively so the zero value is the one every installation\n\t// had before these existed: all three offered. A Config built\n\t// without thinking about them -- in a test, or by a caller written\n\t// earlier -- keeps serving what it served.\n\tInteractiveJupyterDisabled  bool\n\tInteractiveVSCodeDisabled   bool\n\tInteractiveTerminalDisabled bool\n\t// ReservationEPConstraint limits which execute points a reservation\n\t// may draw seats from, as a ClassAd expression over the slot ad.\n\t// Empty means every startd the collector reports.\n\tReservationEPConstraint string\n\t// ReservationClaims holds an always-on reservation's capacity as\n\t// persistent claims on this access point's schedd rather than by\n\t// pushing machine attributes. Off unless configured.\n\tReservationClaims bool\n\t// ReservationStampBudget caps how many cluster ads one stamping\n\t// pass writes. Zero takes the package default.\n\tReservationStampBudget int\n\t// WebUIEnabled says this server serves the web UI, which needs\n\t// OAuth2 whether or not MCP is on. See HandlerConfig.WebUIEnabled.\n\tWebUIEnabled bool\n\t// DBPath is the unified SQLite database file. See HandlerConfig.DBPath.\n\tDBPath string\n\t// KEKFilePath enables envelope encryption for long-lived secrets\n\t// in the DB. See HandlerConfig.KEKFilePath.\n\tKEKFilePath string\n\t// OAuth2DBPath is the legacy name for DBPath; kept for back-compat.\n\tOAuth2DBPath string\n\tOAuth2Issuer string // OAuth2 issuer URL (default: listen address)\n\t// MCPCIMDEnabled resolves an https:// MCP client_id as a Client ID Metadata\n\t// Document (public client); MCPCIMDAllowedHosts optionally restricts it.\n\tMCPCIMDEnabled      bool\n\tMCPCIMDAllowedHosts []string\n\t// MCPDCRDisabled turns off dynamic client registration (HTTP_API_MCP_DCR).\n\tMCPDCRDisabled bool\n\t// MCPTokenExchangeIssuers: JSON list of trusted external issuers for token\n\t// exchange (HTTP_API_MCP_TOKEN_EXCHANGE_ISSUERS).\n\tMCPTokenExchangeIssuers string\n\tOAuth2ClientID          string   // OAuth2 client ID for SSO (optional)\n\tOAuth2ClientSecret      string   // OAuth2 client secret for SSO (optional)\n\tOAuth2AuthURL           string   // OAuth2 authorization URL for SSO (optional)\n\tOAuth2TokenURL          string   // OAuth2 token URL for SSO (optional)\n\tOAuth2RedirectURL       string   // OAuth2 redirect URL for SSO (optional)\n\tOAuth2UserInfoURL       string   // OAuth2 user info endpoint for SSO (optional)\n\tOAuth2Scopes            []string // OAuth2 scopes to request (default: [\"openid\", \"profile\", \"email\"])\n\tOAuth2UsernameClaim     string   // Claim name for username in token (default: \"sub\")\n\tOAuth2GroupsClaim       string   // Claim name for groups in user info (default: \"groups\")\n\t// OAuth2Requirements is a ClassAd expression evaluated against the\n\t// token's claims at login. Empty means no policy.\n\tOAuth2Requirements string\n\n\t// IdentityMapStrategies is the ordered list of ways to turn an OIDC\n\t// subject into a local account -- \"gecos\", \"username\", or both, as in\n\t// \"gecos,username\". Empty disables mapping entirely. When set, group\n\t// membership comes from the system rather than the token, and a\n\t// caller that maps to no single account is refused a session.\n\tIdentityMapStrategies []idmap.Strategy\n\t// IdentityGroupSources lists where group membership comes from, as\n\t// parsed specs: \"system\" and/or \"file:\u003cpath\u003e\". Empty keeps the\n\t// token's groups claim, which is what a container wants because it\n\t// holds no account database to read. Independent of\n\t// IdentityMapStrategies: a deployment may want either, both, or\n\t// neither. Several sources are unioned, the way glibc merges NSS\n\t// services, so a site can carry directory groups and hand-maintained\n\t// ones at once.\n\tIdentityGroupSources []string\n\t// IdentityMapPasswdFile reads accounts from this file instead of\n\t// /etc/passwd. Empty means /etc/passwd, which is the only account\n\t// source that enumerates: the GECOS index cannot list accounts that\n\t// live only in a directory. Accounts it does map are still verified\n\t// against the live database, directory included.\n\tIdentityMapPasswdFile string\n\n\t// SSHGatewayAddress is where the SSH gateway listens, e.g. \":2222\".\n\t// Empty disables it. See httpserver/sshgateway.go.\n\tSSHGatewayAddress string\n\t// SSHGatewayIssuer is the OAuth2 issuer the gateway drives the\n\t// device flow against. Empty means the server's own issuer.\n\tSSHGatewayIssuer string\n\t// SSHHostKeyFile and SSHCAKeyFile point at operator-staged private\n\t// keys; empty means keep them sealed in the application database.\n\tSSHHostKeyFile string\n\tSSHCAKeyFile   string\n\t// SSHGatewayPublicHost is the name users ssh to; see HandlerConfig.\n\tSSHGatewayPublicHost string\n\t// SandboxCacheDir, SandboxCacheMB and SandboxMaxGB tune the +jobs\n\t// file service's reads. See httpserver.Config.\n\tSandboxCacheDir string\n\tSandboxCacheMB  int\n\tSandboxMaxGB    int\n\t// SSHGatewayLockout refuses connections from a source that keeps\n\t// failing to log in; see HandlerConfig.\n\tSSHGatewayLockout SSHGatewayLockoutConfig\n\t// SSHGatewaySessionCpus/MemoryMB/DiskMB size a session the gateway\n\t// creates on demand. Zero means the interactive default.\n\tSSHGatewaySessionCpus     int\n\tSSHGatewaySessionMemoryMB int\n\tSSHGatewaySessionDiskMB   int\n\t// IdentityMapTTL is how long the GECOS index and the group lookups\n\t// are reused. Zero means five minutes.\n\tIdentityMapTTL time.Duration\n\n\t// IdentityMapStripDomain also tries the local part of a scoped\n\t// subject -- \"bockelman@wisc.edu\" as \"bockelman\". Only sound where\n\t// something else constrains which identity providers may log in,\n\t// since the local part is not unique across domains.\n\tIdentityMapStripDomain bool\n\t// OAuth2AccessTokenLifespan / OAuth2RefreshTokenLifespan control how long the\n\t// embedded MCP issuer's tokens are valid. Zero means \"use the package default\"\n\t// (1h access, 30d refresh). RefreshTokenLifespan must be \u003e= AccessTokenLifespan.\n\tOAuth2AccessTokenLifespan  time.Duration\n\tOAuth2RefreshTokenLifespan time.Duration\n\t// OAuth2MaxGrantLifetime caps the total age of a grant measured from\n\t// the consent that created it, regardless of how often it is\n\t// refreshed. Defaults to DefaultMaxGrantLifetime (30 days) if zero.\n\t// See HandlerConfig.OAuth2MaxGrantLifetime.\n\tOAuth2MaxGrantLifetime time.Duration\n\t// OAuth2RevocationOracles selects the refresh-time revocation oracles.\n\t// Nil selects the default set; see HandlerConfig.OAuth2RevocationOracles\n\t// for the recognized names.\n\tOAuth2RevocationOracles []string\n\tMCPAccessGroup          string // Group required for any MCP access (empty = all authenticated)\n\tMCPReadGroup            string // Group required for read operations (empty = all have read)\n\tMCPWriteGroup           string // Group required for write operations (empty = all have write)\n\t// UpstreamRefresh is HTTP_API_UPSTREAM_REFRESH: auto, on or off.\n\t// Decides whether this server keeps the identity provider's refresh\n\t// token so it can ask about a user later. See upstream_refresh.go.\n\tUpstreamRefresh string\n\t// TokenRetention is HTTP_API_TOKEN_RETENTION: how long a dead token\n\t// row is kept before deletion. Empty means the default (90 days),\n\t// \"off\" keeps them forever. See oauth2_retention.go.\n\tTokenRetention string\n\n\t// APIKeyEntitlementTTL is HTTP_API_API_KEY_ENTITLEMENT_TTL: how long\n\t// an API key that is not a service key may keep an entitlement that\n\t// nothing has been able to confirm. Zero takes the default.\n\tAPIKeyEntitlementTTL time.Duration\n\t// ServiceKeyMaxLifetime is HTTP_API_SERVICE_KEY_MAX_LIFETIME: the\n\t// furthest out a service key's expiry may be set. Zero takes the\n\t// default.\n\tServiceKeyMaxLifetime time.Duration\n\n\t// MCPAdminGroup / MCPSuperuserGroup gate the two cross-user MCP\n\t// privileges. Empty means NOBODY, not everybody -- see\n\t// HandlerConfig for why these invert the default above.\n\tMCPAdminGroup     string\n\tMCPSuperuserGroup string\n\tScheddHost        string // SCHEDD_HOST: the host (optionally name@host, optionally with a port) whose schedd to use\n\tMCPInstructions   string // Server-level instructions provided to all MCP agents (e.g., AP-specific guidance)\n\t// MCPDisabledTools (HTTP_API_MCP_DISABLED_TOOLS) names tools this site cannot\n\t// offer, as path.Match patterns separated by commas or whitespace.\n\tMCPDisabledTools string\n\t// MCPReadOnly (HTTP_API_MCP_READ_ONLY) serves MCP with no tool that\n\t// changes anything, whatever the caller's scopes say.\n\tMCPReadOnly bool\n\t// MCPConfirmSubmitOver (HTTP_API_MCP_CONFIRM_SUBMIT_OVER) and\n\t// MCPConfirmRemoveOver (HTTP_API_MCP_CONFIRM_REMOVE_OVER) are the job\n\t// counts above which the MCP submit and remove tools ask the person\n\t// running the client to confirm. Zero is off, and is the default.\n\tMCPConfirmSubmitOver int\n\tMCPConfirmRemoveOver int\n\t// MCPDisableSecretRedaction turns off credential masking on MCP tool\n\t// results (HTTP_API_MCP_REDACT_SECRETS = false).\n\tMCPDisableSecretRedaction bool\n\t// MCPRedactDisabledRules (HTTP_API_MCP_REDACT_DISABLED_RULES) names\n\t// masking rules to turn off, as globs over rule ids.\n\tMCPRedactDisabledRules string\n\t// WebUIAppOnlyGroup names groups whose members land in their site app\n\t// instead of the dashboard. Presentation only; see HandlerConfig.\n\tWebUIAppOnlyGroup string\n\t// SiteAppsDir holds the \u003cid\u003e.zip bundles; policy is configuration\n\t// for operator-deployed static web apps. Empty disables the feature.\n\tSiteAppsDir string\n\t// SiteAppsReloadInterval is how often that directory is rescanned.\n\tSiteAppsReloadInterval time.Duration\n\t// WebhooksDisabled turns outbound webhooks off entirely\n\t// (HTTP_API_WEBHOOKS = false). Negated so the zero value leaves them\n\t// on, as every other user-facing feature here does.\n\tWebhooksDisabled bool\n\t// WebhookFanoutLimit caps how many jobs one webhook may deliver for\n\t// before it rolls up and is disabled. Zero selects the default.\n\tWebhookFanoutLimit int\n\t// SiteAppsUpload is whether administrators may publish a bundle\n\t// through the web interface (HTTP_API_SITE_APPS_UPLOAD).\n\tSiteAppsUpload bool\n\t// SiteAppsGitHub is whether a bundle may be fetched from a GitHub\n\t// release rather than attached (HTTP_API_SITE_APPS_GITHUB).\n\tSiteAppsGitHub bool\n\t// MCPSkillsReloadInterval is how often that directory is re-read so a\n\t// checkout updated underneath this process is noticed without a\n\t// reconfigure. Zero disables the poll.\n\tMCPSkillsReloadInterval time.Duration\n\t// MCPSkillsDir publishes a directory of site-authored Markdown skills\n\t// to agents. Empty disables the feature.\n\tMCPSkillsDir  string\n\tMCPAdminUsers []string // Authenticated subjects exempt from the MCP owner-scope wrapper\n\n\t// PoolQueryPolicy restricts which collector attributes a caller\n\t// without the cross-user read privilege may read. Nil means no\n\t// restriction. See webapi/poolpolicy.\n\tPoolQueryPolicy *poolpolicy.Policy\n\tWebUIAdminGroup string // Group required for Web UI admin pages (empty disables admin UI). Configurable via HTTP_API_WEBUI_ADMIN_GROUP.\n\t// WebUIAccessGroup gates web interface login; empty falls back to\n\t// MCPAccessGroup. Comma-separated.\n\tWebUIAccessGroup string\n\t// Web UI branding: the site's own name, footer logos, images,\n\t// stylesheet and tab icon. All optional; unset leaves the pages as\n\t// they ship. See HandlerConfig and httpserver/branding.go.\n\tWebUISiteName    string\n\tWebUISiteTagline string\n\tWebUIFooterLogos string\n\tWebUIBrandingDir string\n\tWebUICustomCSS   string\n\tWebUIFavicon     string\n\t// The site's policy pages, served at /privacy and /terms. Each is\n\t// a markdown file (or \"default\"), or failing that a URL to\n\t// redirect to. Unset serves neither. See httpserver/policy.go.\n\tWebUIPrivacyFile string\n\tWebUIPrivacyURL  string\n\tWebUITermsFile   string\n\tWebUITermsURL    string\n\t// SpoolBufferDir is where a cluster-wide upload buffers its tar\n\t// before fanning it out to each proc. Empty selects the system temp\n\t// directory.\n\tSpoolBufferDir string\n\t// SuperuserGroup gates superuser mode. Empty disables it. See\n\t// HandlerConfig.SuperuserGroup -- notably, it is NOT WebUIAdminGroup.\n\tSuperuserGroup string\n\t// ProjectLeadsFile and ProjectLeadsGroup configure project leads. See\n\t// HandlerConfig.\n\tProjectLeadsFile  string\n\tProjectLeadsGroup string\n\t// SuperuserFallbackIdentity overrides the identity used when the\n\t// operator is not themselves a usable queue superuser. Empty selects\n\t// condor@$(UID_DOMAIN). See HandlerConfig.\n\tSuperuserFallbackIdentity string\n\tEnableIDP                 bool // Enable built-in IDP (always enabled in demo mode)\n\t// SeedDemoUser seeds a second, non-admin IDP account. Demo mode only;\n\t// see HandlerConfig.SeedDemoUser for why it is not keyed on EnableIDP.\n\tSeedDemoUser bool\n\t// DemoCredentialsFile is where seeded demo passwords are written as\n\t// JSON. Demo mode only; see HandlerConfig.DemoCredentialsFile.\n\tDemoCredentialsFile string\n\t// SeedDemoPlacementUser seeds \"newbie\", an IDP account with no access.\n\t// Demo mode sets it when it runs a condor_placementd; see\n\t// HandlerConfig.SeedDemoPlacementUser.\n\tSeedDemoPlacementUser bool\n\t// IDPDBPath is deprecated; the IDP shares the unified DBPath.\n\tIDPDBPath string //nolint:unused // back-compat; ignored.\n\tIDPIssuer string // IDP issuer URL (default: listen address)\n\t// IDPAccessTokenLifespan / IDPRefreshTokenLifespan: see OAuth2*Lifespan above.\n\tIDPAccessTokenLifespan  time.Duration\n\tIDPRefreshTokenLifespan time.Duration\n\tSessionTTL              time.Duration  // HTTP session TTL (default: 24h)\n\tHTCondorConfig          *config.Config // HTCondor configuration (optional, used for LOCAL_DIR default)\n\t// ClientConfig is the HTCondor configuration this server's own\n\t// connections to HTCondor daemons are built from: the schedd, credd\n\t// and placementd clients it creates, and the security configs it\n\t// builds around callers' tokens (SEC_* methods and levels, token and\n\t// SSL client credential locations, query rate limits). nil means the\n\t// process-wide default that htcondor.GetDefaultConfig loads from\n\t// $CONDOR_CONFIG, which is what htcondor-api uses. It is separate from\n\t// HTCondorConfig because htcondor-api loads that one with HTTP_API\n\t// subsystem and local-name scoping, so pointing the clients at it would\n\t// change which SEC_* values an existing deployment authenticates with.\n\t// A Collector passed in above is the caller's to configure.\n\tClientConfig *config.Config\n\t// PingInterval is the periodic collector/schedd ping cadence; zero\n\t// or negative disables it. See HandlerConfig.PingInterval.\n\tPingInterval time.Duration\n\t// MCPWatchMaxWait caps in-call MCP watch_jobs blocking; keep it\n\t// under the front gateway timeout. See HandlerConfig.MCPWatchMaxWait.\n\tMCPWatchMaxWait time.Duration\n\t// MCPMaxRequestDuration is the hard stop on an MCP request that keeps\n\t// making progress. See HandlerConfig.MCPMaxRequestDuration.\n\tMCPMaxRequestDuration time.Duration\n\n\t// MCPUseSDKTransport serves /mcp with the upstream MCP SDK's transport.\n\t// See HandlerConfig.MCPUseSDKTransport.\n\tMCPUseSDKTransport bool\n\t// RequiredCredentials names the OAuth service credentials that must\n\t// exist before a job may be submitted. See\n\t// HandlerConfig.RequiredCredentials.\n\tRequiredCredentials []string\n\t// CreddAddress pins the credd to talk to. See HandlerConfig.CreddAddress.\n\tCreddAddress       string\n\tStreamBufferSize   int                  // Buffer size for streaming queries (default: 100)\n\tStreamWriteTimeout time.Duration        // Write timeout for streaming queries (default: 5s)\n\tToken              string               // Token for daemon authentication (optional)\n\tCredd              htcondor.CreddClient // Optional credd client; defaults to in-memory implementation\n\t// Placementd is an optional condor_placementd client; nil means\n\t// \"discover one\". See HandlerConfig.\n\tPlacementd htcondor.PlacementdClient\n\t// Placement onboarding; see the HandlerConfig fields of the same\n\t// names.\n\tPlacementIdentityClaims    []string\n\tPlacementDisplayNameClaims []string\n\tPlacementDeviceClients     *string\n\tPlacementScheddHost        string\n\tPlacementCollectorHost     string\n\tPlacementdName             string\n\tPlacementPrefillDomains    []string\n\tPlacementRequestRetention  time.Duration\n\n\t// LLMAPIKeyFile is the path to a file holding the Anthropic API\n\t// key. Empty disables the chat endpoint. See HandlerConfig.\n\tLLMAPIKeyFile string\n\t// LLMAPIURL is an optional override for the upstream Anthropic\n\t// endpoint, useful when the operator runs an LLM gateway. Empty\n\t// = direct to api.anthropic.com.\n\tLLMAPIURL string\n\t// LLMModel overrides the default model id. Empty = package default.\n\tLLMModel string\n\t// LLMAuthScheme is how the key is sent upstream: \"x-api-key\"\n\t// (default) or \"bearer\". See HandlerConfig.\n\tLLMAuthScheme string\n\t// LLMOperatorInstructionsFile is the path to a file with extra\n\t// system-prompt rules the operator wants the chat assistant to\n\t// follow on every turn. Empty disables. See HandlerConfig for\n\t// the file-mode requirement and rationale.\n\tLLMOperatorInstructionsFile string\n}\n```\nConfig holds server configuration\n\n```go\ntype ConnectorStatus struct {\n\tID   string `json:\"id\"`\n\tKind string `json:\"kind\"`\n\t// Connected is whether this caller has granted it.\n\tConnected bool `json:\"connected\"`\n\t// NeedsConsent is set when a grant exists but the provider will no\n\t// longer renew it, which is a different thing from never having\n\t// connected and wants a different sentence in a UI.\n\tNeedsConsent bool       `json:\"needs_consent,omitempty\"`\n\tLastUsedAt   *time.Time `json:\"last_used_at,omitempty\"`\n\t// ConnectURL is the fixed entry point. Safe to print.\n\tConnectURL string `json:\"connect_url\"`\n\t// Transfer is spool or direct.\n\tTransfer string `json:\"transfer\"`\n}\n```\nConnectorStatus is one connector as the listing reports it.\n\n```go\ntype DagDryRunResponse struct {\n\tDryRun  bool   `json:\"dry_run\"`\n\tDagName string `json:\"dag_name\"`\n\t// SubmitFile is the DAGMan manager job's submit file as it would be\n\t// sent, with the site's submit policy already in it.\n\tSubmitFile string       `json:\"submit_file\"`\n\tInputFiles []string     `json:\"input_files\"`\n\tDeferred   []string     `json:\"deferred,omitempty\"`\n\tNotes      []string     `json:\"notes,omitempty\"`\n\tFindings   []DagFinding `json:\"findings,omitempty\"`\n\t// Fatal and Errors are the workflow's own verdict: a dry run reports\n\t// every fatal finding rather than stopping at the first, because the\n\t// caller asked what is wrong with this workflow and one error hides\n\t// the other four.\n\tFatal  bool     `json:\"fatal\"`\n\tErrors []string `json:\"errors,omitempty\"`\n}\n```\nDagDryRunResponse is a workflow that was checked and not submitted.\n\n```go\ntype DagFinding struct {\n\tSeverity string `json:\"severity\"`\n\tMessage  string `json:\"message\"`\n\tLine     int    `json:\"line,omitempty\"`\n\tSource   string `json:\"source,omitempty\"`\n}\n```\nDagFinding is one thing the analysis noticed, in the shape a page can show: severity, the line of the caller's own DAG it is about, and the included or spliced file that line belongs to when it is not the top-level one.\n\n```go\ntype DagGraphGroup struct {\n\tID    string `json:\"id\"`\n\tLabel string `json:\"label\"`\n\t// Description is what the group's nodes run, when it is known. It is\n\t// empty for a workflow read from a DOT file, which carries no submit\n\t// descriptions.\n\tDescription string         `json:\"description\"`\n\tCount       int            `json:\"count\"`\n\tParentIDs   []string       `json:\"parent_ids\"`\n\tStatus      map[string]int `json:\"status\"`\n}\n```\nDagGraphGroup is one collapsed group plus the state histogram of its members, which is what a drawing colours a shape by.\n\n```go\ntype DagGraphNode struct {\n\tName    string `json:\"name\"`\n\tGroupID string `json:\"group_id\"`\n\tState   string `json:\"state\"`\n\t// JobID, HoldReason and ExitCode are the \"why\" behind a state, and\n\t// they come from the queue or the archive even when the state itself\n\t// came from the status file -- a node the status file calls an error\n\t// is a number until something says which job failed and how.\n\tJobID      string `json:\"job_id,omitempty\"`\n\tHoldReason string `json:\"hold_reason,omitempty\"`\n\tExitCode   *int   `json:\"exit_code,omitempty\"`\n\t// Detail is DAGMan's own note about the node, when the status file\n\t// carried one (\"idle: 2 held\", an error message, \"Had an ancestor\n\t// node fail\").\n\tDetail string `json:\"detail,omitempty\"`\n\tSource string `json:\"source\"`\n}\n```\nDagGraphNode is one node's state.\n\n```go\ntype DagGraphResponse struct {\n\tCluster int    `json:\"cluster\"`\n\tDagFile string `json:\"dag_file\"`\n\t// DotFile and StatusFile name the files this answer was read out of,\n\t// so a caller looking at the spool can find them.\n\tDotFile    string `json:\"dot_file\"`\n\tStatusFile string `json:\"status_file,omitempty\"`\n\tNodeCount  int    `json:\"node_count\"`\n\tEdgeCount  int    `json:\"edge_count\"`\n\tGroupCount int    `json:\"group_count\"`\n\n\tGroups []DagGraphGroup `json:\"groups\"`\n\t// Nodes is the per-node overlay, or null when the workflow is too\n\t// large to list node by node. NodesOmitted then says so and\n\t// NodesOmittedReason says why.\n\tNodes              []DagGraphNode `json:\"nodes\"`\n\tNodesOmitted       bool           `json:\"nodes_omitted,omitempty\"`\n\tNodesOmittedReason string         `json:\"nodes_omitted_reason,omitempty\"`\n\n\t// ApproximateLayering is set when the grouping is not the exact\n\t// structural one -- a cycle, or a refinement that hit its bound -- so\n\t// the group layering is a best effort rather than a topology.\n\tApproximateLayering bool `json:\"approximate_layering,omitempty\"`\n\n\t// StateSources names which of status-file/dot-file/queue/archive\n\t// actually contributed a node state.\n\tStateSources []string `json:\"state_sources\"`\n\t// StatusFileTime is the node status file's own timestamp, present\n\t// only when that file contributed. It matters: the queue half of this\n\t// response is live, while the status file is only as fresh as DAGMan's\n\t// last write plus the last whole-sandbox fetch.\n\tStatusFileTime int64 `json:\"status_file_time,omitempty\"`\n\t// Warnings carry what could not be consulted, so a missing archive\n\t// reads as \"not available\" rather than as \"nothing ran\".\n\tWarnings []string `json:\"warnings,omitempty\"`\n\t// FetchedAt is when the structure and the node states in this answer\n\t// were actually read out of the spool -- NOT when this response was\n\t// assembled. On a cached load those are minutes apart, and the panel\n\t// reports this as the age of what it is drawing.\n\tFetchedAt time.Time `json:\"fetched_at\"`\n\t// TookMS is how long this request spent producing the answer, which\n\t// is the number the panel shows and the one an operator compares a\n\t// cached load against a refresh with.\n\tTookMS int64 `json:\"took_ms\"`\n}\n```\nDagGraphResponse is the body of GET /api/v1/jobs/{id}/dag.\n\n```go\ntype DagSubmitLinks struct {\n\t// Job is the manager job's ad: DAGMan publishes its node counts\n\t// there, so this is \"how far along is the workflow\".\n\tJob string `json:\"job\"`\n\t// Watch is the manager job's SSE stream, so a page waiting on the\n\t// workflow does not poll.\n\tWatch string `json:\"watch\"`\n\t// Dag is the workflow's structure and per-node state, read from what\n\t// the instrumentation writes. Empty when instrument was false.\n\tDag string `json:\"dag,omitempty\"`\n\t// Nodes lists the node jobs in the queue.\n\tNodes string `json:\"nodes\"`\n\t// Output is the whole spool, including DagmanLog and whatever the\n\t// nodes produced: node outputs come back to the DAG's directory, not\n\t// to a node job's sandbox, which is gone.\n\tOutput string `json:\"output\"`\n}\n```\nDagSubmitLinks are the endpoints that follow a workflow, so a caller does not have to assemble them (and get the node query wrong).\n\n```go\ntype DagSubmitRequest struct {\n\t// Dag is the DAG description file's contents. Required.\n\tDag string `json:\"dag\"`\n\t// Files are the files the DAG references, as name -\u003e contents: node\n\t// submit files, PRE/POST scripts, small inputs. Names must be bare:\n\t// a spooled sandbox is one flat directory.\n\tFiles map[string]string `json:\"files,omitempty\"`\n\t// DagName is the file name the DAG is written as. Default\n\t// \"workflow.dag\".\n\tDagName string `json:\"dag_name,omitempty\"`\n\t// BatchName sets JobBatchName, as condor_q -batch shows it.\n\tBatchName string `json:\"batch_name,omitempty\"`\n\t// MaxIdle, MaxJobs, MaxPre and MaxPost throttle DAGMan. Zero is\n\t// unset.\n\tMaxIdle int `json:\"max_idle,omitempty\"`\n\tMaxJobs int `json:\"max_jobs,omitempty\"`\n\tMaxPre  int `json:\"max_pre,omitempty\"`\n\tMaxPost int `json:\"max_post,omitempty\"`\n\t// Append is extra submit-file lines for the DAGMan manager job.\n\tAppend string `json:\"append,omitempty\"`\n\t// Instrument defaults to TRUE, which is why it is a pointer: the\n\t// flag exists only to turn instrumentation off, and an absent field\n\t// must not read as false. See dagman.Submission.Instrument for the\n\t// one case where off is the right answer.\n\tInstrument *bool `json:\"instrument,omitempty\"`\n\t// DryRun checks the workflow and submits nothing.\n\tDryRun bool `json:\"dry_run,omitempty\"`\n}\n```\nDagSubmitRequest is a workflow submitted as JSON. The multipart form carries the same fields under the same names, one per form value, with the files as file parts instead of a map.\n\n```go\ntype DagSubmitResponse struct {\n\tClusterID int    `json:\"cluster_id\"`\n\tJobID     string `json:\"job_id\"`\n\tDagName   string `json:\"dag_name\"`\n\t// Schedd and Assignment are multi-AP only, as on JobSubmitResponse:\n\t// the access point the workflow went to, and why.\n\tSchedd     string               `json:\"schedd,omitempty\"`\n\tAssignment *apassign.Assignment `json:\"assignment,omitempty\"`\n\t// InputFiles is what was staged into the workflow's spool directory,\n\t// which is also what the manager job declared. Nothing can be added\n\t// to it.\n\tInputFiles []string `json:\"input_files\"`\n\t// Deferred are files the DAG will read once it is running and that\n\t// are not staged now -- a sub-DAG an earlier node writes, a submit\n\t// file a script generates. Expected, not missing.\n\tDeferred []string `json:\"deferred,omitempty\"`\n\t// Notes and Findings are the same analysis twice: rendered lines to\n\t// show, and the structured form to act on.\n\tNotes    []string     `json:\"notes,omitempty\"`\n\tFindings []DagFinding `json:\"findings,omitempty\"`\n\t// NodeConstraint selects the workflow's node jobs.\n\tNodeConstraint string `json:\"node_constraint\"`\n\t// DotFile and StatusFile are what the instrumentation will write\n\t// into the spool; empty when instrument was false, in which case\n\t// there is no graph and no per-node state to read.\n\tDotFile    string `json:\"dot_file,omitempty\"`\n\tStatusFile string `json:\"status_file,omitempty\"`\n\t// DagmanLog is DAGMan's own log, by name, inside the spool that\n\t// Links.Output returns.\n\tDagmanLog string `json:\"dagman_log\"`\n\t// Links are where to go next, ready to use.\n\tLinks DagSubmitLinks `json:\"links\"`\n}\n```\nDagSubmitResponse is a submitted workflow.\n\nIt answers \"what now?\" as well as \"what happened\", because a caller holding only a cluster id cannot find the workflow's own jobs: DAGMan submits each node as its own cluster, and DAGManJobId is the only thing linking them to the manager. Handing over the constraint and the paths is the difference between a page that shows the workflow and a page that queries the manager job again and concludes it has no jobs.\n\n```go\ntype DashboardAP struct {\n\tSchedd string `json:\"schedd\"`\n\t// State is the hub's view of the AP: fresh, or the state it is\n\t// degraded in.\n\tState        string         `json:\"state\"`\n\tJobsByStatus map[string]int `json:\"jobs_by_status\"`\n\tJobsTotal    int            `json:\"jobs_total\"`\n}\n```\nDashboardAP is one AP's counts.\n\n```go\ntype DashboardAPActivity struct {\n\tSchedd string `json:\"schedd\"`\n\tState  string `json:\"state\"`\n\t// FinishedRecently is how many of the caller's jobs on the AP are\n\t// known to have finished in the window: history records, and\n\t// departures the hub's jobs stream saw with evidence.\n\tFinishedRecently int `json:\"finished_recently\"`\n\t// FinishedPartial says the count may be low: the AP is not fresh on\n\t// the hub (its history may lag, and its departures are not counted),\n\t// or the history read hit its limit.\n\tFinishedPartial bool `json:\"finished_partial,omitempty\"`\n}\n```\nDashboardAPActivity is one AP's line in the activity answer.\n\n```go\ntype DashboardActivity struct {\n\tHoldReasons []HoldReasonCount `json:\"hold_reasons,omitempty\"`\n\n\tRecentlySubmitted []RecentJob `json:\"recently_submitted,omitempty\"`\n\tRecentlyStarted   []RecentJob `json:\"recently_started,omitempty\"`\n\tRecentlyHeld      []RecentJob `json:\"recently_held,omitempty\"`\n\tRecentlyCompleted []RecentJob `json:\"recently_completed,omitempty\"`\n\n\t// CompletedAvailable is false when nothing could answer \"what\n\t// finished recently\". Reported rather than left as an empty list,\n\t// which would read as \"nothing finished\".\n\tCompletedAvailable bool `json:\"completed_available\"`\n\t// CompletedPartial says the list came from the queue alone -- the\n\t// handful still in JobStatus == 4 before the reaper destroys them.\n\t// That is minutes of history at best, and a viewer told otherwise\n\t// would read a short list as a quiet access point.\n\tCompletedPartial bool `json:\"completed_partial\"`\n\n\t// HoldWindowSeconds is the span the hold breakdown covers. Reported\n\t// rather than assumed: the rows answer \"why did jobs BECOME held\n\t// recently\", which is a different question from the HELD tile beside\n\t// them, and a reader who takes it for the latter will conclude the\n\t// backlog vanished.\n\tHoldWindowSeconds int64 `json:\"hold_window_seconds,omitempty\"`\n\n\t// Source is what answered, and ComputedAt when. A cached snapshot is\n\t// minutes old by design; saying so is the difference between a stale\n\t// number and a wrong one.\n\tSource     string `json:\"source\"`\n\tComputedAt int64  `json:\"computed_at\"`\n}\n```\nDashboardActivity is the \"how is this access point doing\" half of the dashboard: why jobs are held, and what has changed lately.\n\n```go\ntype DashboardActivityResponse struct {\n\tActivity DashboardActivity `json:\"activity\"`\n\t// Goodput is absent where nothing could answer it -- no history\n\t// archive means no rate, and an omitted field says that where a\n\t// zeroed one would read as \"everything failed\".\n\tGoodput *GoodputSummary `json:\"goodput,omitempty\"`\n\t// APs and Sources are multi-AP mode's: what finished per access\n\t// point, and which APs' data is not current (multiap_dashboard.go).\n\tAPs     []DashboardAPActivity `json:\"aps,omitempty\"`\n\tSources *multiap.Sources      `json:\"sources,omitempty\"`\n}\n```\nDashboardActivityResponse is the slow half of the dashboard.\n\n```go\ntype DashboardResponse struct {\n\tUsername     string         `json:\"username\"`\n\tJobsByStatus map[string]int `json:\"jobs_by_status\"`\n\tJobsTotal    int            `json:\"jobs_total\"`\n\t// Activity is the \"how is this access point doing\" half: why jobs\n\t// are held, and what changed recently. Computed from the same walk\n\t// as the counts.\n\t// Activity and Goodput are served by /api/v1/dashboard/activity and\n\t// omitted here. They stay on the type so a client that has not moved\n\t// yet gets a response missing two optional fields rather than one\n\t// that fails to decode.\n\tActivity DashboardActivity `json:\"activity,omitzero\"`\n\t// Goodput is absent where nothing could answer it -- no history\n\t// archive means no rate, and an omitted field says that where a\n\t// zeroed one would read as \"everything failed\".\n\tGoodput *GoodputSummary `json:\"goodput,omitempty\"`\n\t// APs and Sources are multi-AP mode's: the counts per access point,\n\t// and which APs' data is not current (multiap_dashboard.go).\n\tAPs     []DashboardAP    `json:\"aps,omitempty\"`\n\tSources *multiap.Sources `json:\"sources,omitempty\"`\n}\n```\nDashboardResponse summarizes the user's queue at the AP. It is a minimal shape on purpose; we'll grow it (transfer history, recent completions, user-level quota) in PR (b)/(c) once the SPA has the basics.\n\n```go\ntype DeviceAuthorizationResponse struct {\n\tDeviceCode              string `json:\"device_code\"`\n\tUserCode                string `json:\"user_code\"`\n\tVerificationURI         string `json:\"verification_uri\"`\n\tVerificationURIComplete string `json:\"verification_uri_complete,omitempty\"`\n\tExpiresIn               int    `json:\"expires_in\"`\n\tInterval                int    `json:\"interval,omitempty\"`\n}\n```\nDeviceAuthorizationResponse represents the response from device authorization endpoint\n\n```go\ntype DeviceCodeHandler struct {\n\t// contains filtered or unexported fields\n}\n```\nDeviceCodeHandler implements the OAuth 2.0 Device Authorization Grant (RFC 8628)\n\n```go\nfunc NewDeviceCodeHandler(storage *OAuth2Storage, config *fosite.Config) *DeviceCodeHandler\n```\nNewDeviceCodeHandler creates a new device code handler\n\n```go\nfunc (h *DeviceCodeHandler) HandleDeviceAccessRequest(ctx context.Context, deviceCode string, session fosite.Session) (fosite.Requester, error)\n```\nHandleDeviceAccessRequest handles token requests with device\\_code grant type\n\n```go\nfunc (h *DeviceCodeHandler) HandleDeviceAuthorizationRequest(ctx context.Context, client fosite.Client, scopes []string, sshSession string) (*DeviceAuthorizationResponse, error)\n```\nHandleDeviceAuthorizationRequest handles the device authorization endpoint.\n\nsshSession, when not empty, is the interactive session the caller is trying to reach over SSH. It is stored on the request form so the verification page can read it back and show that workspace rather than a generic consent form; see sshSessionFromRequester.\n\n```go\ntype ErrorResponse struct {\n\tError   string `json:\"error\"`\n\tMessage string `json:\"message,omitempty\"`\n\tCode    int    `json:\"code\"`\n}\n```\nErrorResponse represents an error response body\n\n```go\ntype ExitCodeCount struct {\n\t// Code is the exit status. Signal is set instead when the job was\n\t// killed, in which case Code has no meaning.\n\tCode   int64 `json:\"code\"`\n\tSignal bool  `json:\"signal\"`\n\tCount  int   `json:\"count\"`\n\t// Seconds is the wall clock spent on jobs that ended this way.\n\tSeconds int64 `json:\"seconds\"`\n}\n```\nExitCodeCount is one way jobs finished badly.\n\n```go\ntype GoodputSummary struct {\n\tWindowHours int `json:\"window_hours\"`\n\t// Since is the exact lower bound the numbers were computed over, so\n\t// a drill-down can ask the archive the same question and get a list\n\t// whose length matches the count that was clicked. Deriving it in\n\t// the browser from WindowHours would drift by the age of the\n\t// response.\n\tSince int64 `json:\"since\"`\n\n\t// Succeeded is jobs that ran to completion and said so: exit 0, not\n\t// killed by a signal.\n\tSucceeded int `json:\"succeeded\"`\n\t// Failed is jobs that ran to completion and reported a problem --\n\t// a non-zero exit or a fatal signal.\n\tFailed int `json:\"failed\"`\n\t// Unfinished is jobs that left without an outcome, which is what a\n\t// removal looks like from here. Counted separately rather than\n\t// folded into failures: a job its owner cancelled is not the access\n\t// point going wrong.\n\tUnfinished int `json:\"unfinished\"`\n\n\t// GoodSeconds and BadSeconds are wall-clock time on the execute\n\t// node, split the same way. This is the half that makes the panel\n\t// worth having.\n\tGoodSeconds int64 `json:\"good_seconds\"`\n\tBadSeconds  int64 `json:\"bad_seconds\"`\n\n\t// TopFailures ranks the exit codes behind Failed, because \"412 jobs\n\t// failed\" and \"412 jobs failed with exit 127\" are different amounts\n\t// of information.\n\tTopFailures []ExitCodeCount `json:\"top_failures,omitempty\"`\n}\n```\nGoodputSummary is the outcome of everything that finished in the window.\n\n```go\ntype GrantRef struct {\n\tRequestID string\n\tClientID  string\n\tSubject   string\n\tSignature string\n}\n```\nGrantRef identifies one authorization grant: the pairing of an access token with the refresh token minted alongside it.\n\n```go\ntype Handler struct {\n\t// contains filtered or unexported fields\n}\n```\nHandler represents the HTTP API handler that can be embedded in any HTTP server\n\n```go\nfunc NewHandler(cfg HandlerConfig) (*Handler, error)\n```\nNewHandler creates a new HTTP API handler that can be embedded in any HTTP server\n\n```go\nfunc (h *Handler) AdvertiseAugment() func(*classad.ClassAd)\n```\nAdvertiseAugment returns the daemon.AdvertiseConfig.Augment callback that adds this API server's attributes to its collector ad. Exported so the daemon bootstrap in package main can wire it without reaching into unexported state.\n\n```go\nfunc (h *Handler) GetOAuth2Provider() *OAuth2Provider\n```\nGetOAuth2Provider returns the OAuth2 provider (for testing)\n\n```go\nfunc (h *Handler) GetSchedd() *htcondor.Schedd\n```\nGetSchedd returns the current schedd instance (thread-safe)\n\n```go\nfunc (h *Handler) ReloadAPAssignment()\n```\nReloadAPAssignment re-reads the access point assignment's files -- the mapfile, the REST token file -- and drops cached answers, so an edited mapfile places the next submission. A mapfile that no longer parses keeps the last good map, and says so in the log. A no-op outside multi-AP mode.\n\n```go\nfunc (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\nServeHTTP implements http.Handler interface.\n\nEvery request flows through the metrics middleware first so the HTTP request counters / duration histogram / in-flight gauge cover every route uniformly — not just the ones we remembered to wrap in setupRoutes. The middleware short-circuits /metrics itself to avoid Prometheus scrapes self-instrumenting.\n\nSecurity headers are emitted on every response (see applySecurityHeaders). Setting them at the top wrapper guarantees no route can opt out by accident — handlers further down the stack can still override (e.g. relaxing frame-ancestors for an embeddable widget) but the secure defaults are present until explicitly changed.\n\n```go\nfunc (s *Handler) SetChatInstructions(path string)\n```\nSetChatInstructions re-reads the operator's chat instructions file.\n\nCalled on every reconfigure, not only when the configured path changes: the usual reason to reload is that the file's contents were edited, which a diff of the setting cannot see -- the same reasoning as SetMCPSkillsDir. A read that fails leaves the previous text in place; a file that has momentarily gone missing should not silently strip the assistant of the site's rules mid-session.\n\nNo-op when chat is not enabled, since there is then no engine to tell.\n\n```go\nfunc (s *Handler) SetConnectorConfig(params *config.Config)\n```\nSetConnectorConfig installs connector policy from a freshly-loaded configuration.\n\nCalled on EVERY reconfigure rather than when a parameter is seen to change, for the reason site apps is: a connector's definition is spread over a parameter per connector per setting, and declaring a new connector adds names nothing was watching. A diff over the names that existed before cannot see a name that did not.\n\nThe client secret is re-read by whoever uses it rather than cached here, so a rotated secret at an unchanged path takes effect too -- the path is in the configuration and the bytes are not, so no diff could see that edit either.\n\n```go\nfunc (h *Handler) SetInteractiveJupyter(spec string)\n```\nSetInteractiveJupyter turns the JupyterLab application on or off.\n\nThis and the two below are dynamic because nothing is constructed from them: each is a check made when a session is created, and the list /auth/me publishes is read per request, so a reconfigure reaches the next launch and the next page load. The alternative -- restarting the daemon -- drops every live notebook and terminal to stop new ones being made, which is the opposite of what these settings are careful about.\n\n```go\nfunc (h *Handler) SetInteractiveTerminal(spec string)\n```\nSetInteractiveTerminal turns the Terminal application on or off, and with it the MCP tool that starts the same kind of session.\n\n```go\nfunc (h *Handler) SetInteractiveVSCode(spec string)\n```\nSetInteractiveVSCode turns the VS Code application on or off.\n\n```go\nfunc (h *Handler) SetMCPAccessGroups(raw string)\n```\nSetMCPAccessGroups installs the groups required for MCP access.\n\n```go\nfunc (h *Handler) SetMCPAdminGroups(raw string)\n```\nSetMCPAdminGroups installs the groups whose members may read every user's jobs through MCP. Emptying it revokes the privilege for everyone -- these two, unlike the read/write groups above, have no fallback to a broader group.\n\n```go\nfunc (h *Handler) SetMCPConfirmRemoveOver(spec string)\n```\nSetMCPConfirmRemoveOver is the removal half; see SetMCPConfirmSubmitOver above.\n\n```go\nfunc (h *Handler) SetMCPConfirmSubmitOver(spec string)\n```\nSetMCPConfirmSubmitOver and SetMCPConfirmRemoveOver set the job counts above which the MCP submit and remove tools ask the person running the client to confirm.\n\nDynamic for the reason the read-only setting is: an operator who has just watched an agent act at a scale they did not expect wants the gate up now, for the sessions already connected.\n\nOne setter each, because the reconfigure table is keyed by setting and an operator may raise one without restating the other. Each reads the other's current value back out so the tool server is told both, which is the only shape its setter has.\n\n```go\nfunc (h *Handler) SetMCPDisabledTools(spec string)\n```\nSetMCPDisabledTools installs the site's disabled-tool patterns.\n\nNo-op when MCP is disabled, since there is then no server to tell.\n\n```go\nfunc (h *Handler) SetMCPInstructions(instructions string)\n```\nSetMCPInstructions installs new deployment-specific MCP instructions. No-op when MCP is disabled, since there is then no server to tell.\n\nOnly sessions that initialize after this call see the new text; MCP hands an agent its instructions once, in the initialize response.\n\n```go\nfunc (h *Handler) SetMCPReadGroups(raw string)\n```\nSetMCPReadGroups installs the groups required for MCP read access.\n\n```go\nfunc (h *Handler) SetMCPReadOnly(spec string)\n```\nSetMCPReadOnly turns the site-wide read-only MCP surface on or off.\n\nDynamic for the reason the disabled-tool list is: an operator who discovers their agents can act when they meant them only to look should be able to stop it now, for the sessions already connected, rather than at the next restart.\n\nThe grant side is not re-run here. Tokens already carrying mcp:write keep carrying it until they refresh, and it buys them nothing: the refusal is in the tool server, which every transport passes through.\n\nNo-op when MCP is disabled, since there is then no server to tell.\n\n```go\nfunc (h *Handler) SetMCPRedactDisabledRules(spec string)\n```\nSetMCPRedactDisabledRules installs the site's turned-off masking rules.\n\nNo-op when MCP is disabled, since there is then no server to tell.\n\n```go\nfunc (h *Handler) SetMCPRedactSecrets(spec string)\n```\nSetMCPRedactSecrets turns credential masking on tool results on or off.\n\nThe two masking settings are applied together because the rule set is built from both, and a reconfigure delivers one parameter at a time -- so each setter records its own and re-applies the pair.\n\nNo-op when MCP is disabled, since there is then no server to tell.\n\n```go\nfunc (h *Handler) SetMCPSkillsDir(dir string)\n```\nSetMCPSkillsDir reloads the site skill library.\n\nCalled on every reconfigure, not only when the configured path changes: the usual reason to reload is that the checkout the path points at has been updated, which a diff of the setting cannot see. Reading a few dozen Markdown files is cheap enough to do unconditionally.\n\nNo-op when MCP is disabled, since there is then no server to tell.\n\n```go\nfunc (h *Handler) SetMCPSuperuserGroups(raw string)\n```\nSetMCPSuperuserGroups installs the groups whose members may change another user's jobs through MCP.\n\n```go\nfunc (h *Handler) SetMCPWriteGroups(raw string)\n```\nSetMCPWriteGroups installs the groups required for MCP write access.\n\n```go\nfunc (h *Handler) SetProjectLeadsFile(path string)\n```\nSetProjectLeadsFile installs HTTP\\_API\\_PROJECT\\_LEADS\\_FILE and re-reads it.\n\nCalled on every reconfigure, not only when the path changes: the usual reason to reconfigure is that the file was edited. (The file is also re-checked for changes on its own every few seconds, so an edit takes effect without a reconfigure; this makes it immediate.)\n\nLike SetSuperuserGroups, this cannot switch superuser mode ON in a running daemon that started without it.\n\n```go\nfunc (h *Handler) SetProjectLeadsGroup(pattern string)\n```\nSetProjectLeadsGroup installs HTTP\\_API\\_PROJECT\\_LEADS\\_GROUP.\n\n```go\nfunc (h *Handler) SetSiteAppPolicy(params *config.Config)\n```\nSetSiteAppPolicy installs policy read from a freshly-loaded configuration and rescans.\n\nCalled on every reconfigure rather than when a parameter is seen to change, because an app's policy is spread over several parameters and a new app adds parameters that were not there to diff. The scan is what applies them, so it runs here rather than waiting out the reload interval: an operator who has just run condor\\_reconfig has said when they want this to take effect.\n\n```go\nfunc (h *Handler) SetSuperuserGroups(raw string)\n```\nSetSuperuserGroups installs the groups permitted to use superuser mode.\n\nMembership only. Superuser mode builds a policy object and a signing identity at startup, and only when a group was configured then, so this cannot switch the feature ON in a running daemon -- it says so rather than appearing to succeed. Emptying it DOES switch it off, since every check goes through the group list.\n\n```go\nfunc (h *Handler) SetWebUIAccessGroups(raw string)\n```\nSetWebUIAccessGroups installs the groups required to log in to the web interface. Emptying it restores the fallback to the MCP access groups.\n\n```go\nfunc (h *Handler) SetWebUIAdminGroups(raw string)\n```\nSetWebUIAdminGroups installs the groups required for the admin pages.\n\nEmptying it disables the admin UI, which is what an empty value has always meant, so this can switch the admin surface off without a restart as well as change who reaches it.\n\n```go\nfunc (h *Handler) SetWebUIAppOnlyGroups(raw string)\n```\nSetWebUIAppOnlyGroups installs the groups whose members land in their site app rather than the dashboard. Reloadable for the same reason the others are: a site adds a lab mid-semester.\n\n```go\nfunc (h *Handler) SetWebUIBrandingDir(v string)\n```\nSetWebUIBrandingDir installs the directory served under /branding/.\n\n```go\nfunc (h *Handler) SetWebUICustomCSS(v string)\n```\nSetWebUICustomCSS installs the stylesheet served at /branding.css.\n\n```go\nfunc (h *Handler) SetWebUIFavicon(v string)\n```\nSetWebUIFavicon installs the browser tab icon.\n\n```go\nfunc (h *Handler) SetWebUIFooterLogos(v string)\n```\nSetWebUIFooterLogos installs the footer's institutional band. A value that does not parse leaves the previous band in place and says so in the log.\n\n```go\nfunc (h *Handler) SetWebUIPrivacyFile(v string)\n```\nSetWebUIPrivacyFile installs the privacy notice served at /privacy.\n\n```go\nfunc (h *Handler) SetWebUIPrivacyURL(v string)\n```\nSetWebUIPrivacyURL installs where /privacy redirects, for a site whose privacy notice lives elsewhere.\n\n```go\nfunc (h *Handler) SetWebUISiteName(v string)\n```\nSetWebUISiteName installs the name in the sidebar and the browser tab.\n\n```go\nfunc (h *Handler) SetWebUISiteTagline(v string)\n```\nSetWebUISiteTagline installs the line under the name in the sidebar.\n\n```go\nfunc (h *Handler) SetWebUITermsFile(v string)\n```\nSetWebUITermsFile installs the terms of use served at /terms.\n\n```go\nfunc (h *Handler) SetWebUITermsURL(v string)\n```\nSetWebUITermsURL installs where /terms redirects.\n\n```go\nfunc (h *Handler) SetupRoutes(setupFunc func(*http.ServeMux))\n```\nSetupRoutes sets up the HTTP routes on the handler's multiplexer This should be called by Server.NewServer or by users who create a Handler directly\n\n```go\nfunc (h *Handler) Start(ctx context.Context, ln net.Listener, protocol string) error\n```\nStart initializes the handler and starts background goroutines. The provided context controls the handler's lifetime - when the context is cancelled, the handler will gracefully shut down all background goroutines.\n\nThis method should be called by Server.Start() or Server.StartTLS() before serving requests.\n\n```go\nfunc (h *Handler) Stop(ctx context.Context) error\n```\nStop gracefully stops all background goroutines and closes providers. This method is called when the handler's context is cancelled (via Server.Shutdown). The background goroutines are responsible for watching their context and exiting when done.\n\n```go\nfunc (h *Handler) StopUsageStats()\n```\nStopUsageStats halts the periodic flush and writes once more, so the counters a clean shutdown leaves behind are complete rather than up to one interval stale.\n\nSafe to call on a Handler that never started the loop, and safe to call twice: Server.Shutdown can run from more than one signal path.\n\n```go\nfunc (h *Handler) UpdateOAuth2RedirectURL(redirectURL string)\n```\nUpdateOAuth2RedirectURL updates the OAuth2 redirect URL for SSO integration\n\n```go\nfunc (h *Handler) UpdateSchedd(newAddress string)\n```\nUpdateSchedd updates the schedd instance with a new address (thread-safe). On change, logs both addresses, the age of the previous address, and — when both addresses are shared-port — the old and new sock= IDs so it's obvious whether a schedd restart drove the update (sock= changed) versus a network-level address shift (host:port changed but sock= stable).\n\nAlways sets scheddAddrLastConfirmedAt to now: the caller has just talked to the collector successfully, regardless of whether the address differs from the cached value.\n\n```go\ntype HandlerConfig struct {\n\tScheddName string // Schedd name\n\tScheddAddr string // Schedd address (e.g., \"127.0.0.1:9618\"). If empty, discovered from collector.\n\n\t// ScheddAddrDiscovered says ScheddAddr was resolved from the collector\n\t// rather than set by an operator.\n\t//\n\t// It matters because the two look identical here and behave\n\t// differently: a pinned address is honoured even when the collector\n\t// disagrees, while a discovered one must follow the collector. The\n\t// daemon resolves the address in main() and passes the result, so\n\t// without this every deployment that only sets SCHEDD_NAME looked\n\t// pinned -- and kept dialling the dead socket of a schedd that had\n\t// restarted, forever. See issue #308.\n\tScheddAddrDiscovered bool\n\t// ScheddHost is the SCHEDD_HOST setting: the host (optionally\n\t// \"name@host\", optionally with a port) whose schedd to talk to.\n\t// Consulted when neither ScheddAddr nor ScheddName is set; it picks\n\t// that host's schedd rather than whichever one the collector\n\t// happens to list first.\n\tScheddHost string\n\t// MultiAP, when its ScheddConstraint is set, serves every access point\n\t// matching that constraint instead of one schedd. See multiap.go.\n\tMultiAP MultiAPConfig\n\t// InteractiveExtraSubmit holds extra HTCondor submit-file\n\t// directives merged into the submit file produced for each\n\t// interactive-terminal and JupyterLab job. The string value is\n\t// spliced in verbatim just before the `queue` directive, so it\n\t// can override or extend anything the builder emits (typical\n\t// use: pin an accounting group, add +ProjectName, set a\n\t// site-wide `requirements` fragment, force `concurrency_limits`,\n\t// etc.).\n\t//\n\t// Trust model: the value comes from operator-only configuration\n\t// (HTCondor config or env), so it's inserted into every submit\n\t// file verbatim — no whitelist, no quoting. Treat this as the\n\t// operator's hook into job admission policy, equivalent in\n\t// privilege to writing the schedd's site_local config.\n\t//\n\t// Multi-line content is supported via HTCondor config syntax (a\n\t// quoted multi-line value, or backslash continuations). Empty\n\t// disables the feature. Configurable via\n\t// HTTP_API_INTERACTIVE_EXTRA_SUBMIT.\n\tInteractiveExtraSubmit string\n\n\t// DagmanPath is where condor_dagman lives on the access point\n\t// (HTTP_API_DAGMAN_PATH). Empty means the package default.\n\tDagmanPath string\n\n\t// DagmanEnvironment is extra environment for the DAGMan manager job\n\t// (HTTP_API_DAGMAN_ENVIRONMENT).\n\tDagmanEnvironment map[string]string\n\n\t// InteractiveRequirements is an optional ClassAd expression ANDed into\n\t// the interactive terminal job's Requirements.\n\t//\n\t// It exists because a terminal is only useful if it can be attached to,\n\t// and whether that works is a property of the machine. condor_ssh_to_job\n\t// enters the job's namespace with setns, which fails when the container\n\t// runtime made that namespace as root and HTCondor is not root -- the\n\t// job runs, and every attempt to open a shell on it fails. Constraining\n\t// where these jobs land is the only lever the submitter has.\n\t//\n\t// Operator-only configuration, never caller-supplied: it is an\n\t// expression, and a submitter who could set it could widen their own\n\t// match rather than narrow it.\n\tInteractiveRequirements string\n\n\t// VSCodeImage is the container image a code-server app runs.\n\t// Empty means vscode.RecommendedImage.\n\tVSCodeImage string\n\n\t// Build is the site's container-build configuration, handed to the\n\t// MCP server's build_container tool. See mcpserver.BuildConfig.\n\tBuild mcpserver.BuildConfig\n\t// DBMirrorTokenSubject overrides the identity the htcondordb token\n\t// asserts, default \"condor@\u003ctrust domain\u003e\". Configure via\n\t// HTTP_API_DBMIRROR_TOKEN_SUBJECT.\n\tDBMirrorTokenSubject string\n\n\t// SubmitFileDefaults are submit-file lines applied to every\n\t// submission ONLY where the submit file is silent, so a user who\n\t// sets the same command keeps their own value. Configure via\n\t// HTTP_API_SUBMIT_FILE_DEFAULTS.\n\tSubmitFileDefaults string\n\t// SubmitFileOverrides are submit-file lines applied to every\n\t// submission that WIN over whatever the submit file says. Use for\n\t// requirements that are not the user's to opt out of -- an access\n\t// point that rejects a `log =` outside the home directory, say.\n\t// Configure via HTTP_API_SUBMIT_FILE_OVERRIDES.\n\t//\n\t// Same trust model as InteractiveExtraSubmit: operator-only config,\n\t// spliced in verbatim.\n\tSubmitFileOverrides string\n\n\t// IdempotencyKeyCheck is how much of the idempotency-key guarantee\n\t// this access point enforces: NONE, QUEUE, FULL or AUTO (the\n\t// default: FULL where an htcondordb mirror is configured, QUEUE\n\t// where none is). Configure via HTTP_API_IDEMPOTENCY_KEY_CHECK.\n\t// See webapi/idempotency.\n\tIdempotencyKeyCheck string\n\t// IdempotencyKeyRetention is how long a key this server submitted\n\t// stays claimed in memory, covering the window in which a finished\n\t// job is in neither the queue nor the mirrored history. Zero means\n\t// idempotency.DefaultRetention. Configure via\n\t// HTTP_API_IDEMPOTENCY_KEY_RETENTION (seconds).\n\tIdempotencyKeyRetention time.Duration\n\t// IdempotencyKeyTimeout bounds the queue and history lookups a\n\t// keyed submission waits on. Zero means\n\t// idempotency.DefaultTimeout. Configure via\n\t// HTTP_API_IDEMPOTENCY_KEY_TIMEOUT (seconds).\n\tIdempotencyKeyTimeout time.Duration\n\t// IdempotencyKeyHistoryWindow, when non-zero, limits the history\n\t// lookup to that much of the past. It trades the guarantee for the\n\t// cost of the read and is not needed where the history is indexed\n\t// on the key. Configure via\n\t// HTTP_API_IDEMPOTENCY_KEY_HISTORY_WINDOW (seconds).\n\tIdempotencyKeyHistoryWindow time.Duration\n\n\tUserHeader string // HTTP header to extract username from (optional)\n\t// UserHeaderTrustedProxies is a list of CIDRs from which UserHeader\n\t// is honored. When UserHeader is set, this list MUST be non-empty\n\t// (or UserHeaderTrustAnyUnsafe must be true) — otherwise the\n\t// header is silently ignored, treating the request as\n\t// unauthenticated. Configure via HTTP_API_USER_HEADER_TRUSTED_PROXIES\n\t// (comma-separated CIDRs, e.g. \"127.0.0.1/32,::1/128,10.0.0.0/8\")\n\t// or programmatically.\n\tUserHeaderTrustedProxies []string\n\n\t// TrustedProxies lists CIDRs (or bare addresses) whose X-Forwarded-For\n\t// and X-Real-IP headers are honoured for access logging. Empty means\n\t// no forwarded header is believed and the peer address is logged.\n\t// Configure via HTTP_API_TRUSTED_PROXIES.\n\tTrustedProxies []string\n\t// UserHeaderTrustAnyUnsafe disables the trusted-proxy check and\n\t// accepts UserHeader from any source. This is the demo / test\n\t// mode only — it is unsafe in any production deployment because\n\t// it lets any client spoof identity by setting the header.\n\t// Configure via HTTP_API_USER_HEADER_TRUST_ANY=1 (loud warning\n\t// at startup).\n\tUserHeaderTrustAnyUnsafe bool\n\tSigningKeyPath           string // Path to token signing key (optional, for token generation)\n\tTrustDomain              string // Trust domain: issuer of minted tokens, and the only issuer accepted for a bearer IDTOKEN (optional)\n\tUIDDomain                string // UID domain for generated token username (optional; only used if UserHeader is set)\n\tHTTPBaseURL              string // Base URL for HTTP API (e.g., \"http://localhost:8080\") for generating file download links in MCP responses\n\n\t// MCPBaseURL is the public base URL of the MCP listener, when MCP has\n\t// its own port and that port is published under a different origin\n\t// than the web UI. Empty means MCP is reached at the same base URL as\n\t// everything else, which is true whenever the ports are combined and\n\t// whenever a split is only local.\n\t//\n\t// It exists for one attribute: RFC 9728 requires the protected-resource\n\t// document to name the resource the client asked about, and a client\n\t// that reaches MCP on another origin asked about that origin. Naming\n\t// the web UI's instead makes the document one the client must reject.\n\tMCPBaseURL string\n\t// CCB decides how to reach a daemon behind a Condor Connection Broker:\n\t// on an inbound path of this server's own (see sharedportrouter), or by\n\t// having the broker relay. Set once by the operator and applied to every\n\t// surface that reaches into a running job -- a shell, a session, tailing\n\t// output -- so two of them cannot disagree. Nil keeps cedar's default,\n\t// which only works on a host the execute nodes can reach.\n\tCCB           *htcondor.CCBDialer\n\tTLSCACertFile string              // Path to TLS CA certificate file (optional, for trusting self-signed certs)\n\tCollector     *htcondor.Collector // Collector for metrics (optional)\n\n\t// htcondordb mirror routing. Empty/false is the default: discover\n\t// whatever htcondordb advertises to the collector and use it as an\n\t// optional accelerator. See dbmirror.Options for what each does and\n\t// when an operator needs it.\n\tDBMirrorName     string // HTTP_API_DBMIRROR_NAME: pin routing to this mirror\n\tDBMirrorAddress  string // HTTP_API_DBMIRROR_ADDRESS: dial this sinful instead of the advertised one\n\tDBMirrorRequired bool   // HTTP_API_DBMIRROR_REQUIRED: fail rather than fall back to the schedd\n\n\tJobQueueLogPath string // schedd job_queue.log to mirror for /api/v1/jobs/watch (optional)\n\tEnableMetrics   bool   // Enable /metrics endpoint (default: true if Collector is set)\n\t// UsageStatsFlushInterval is how often the call counters -- MCP\n\t// tool calls and REST API requests alike -- are written to the\n\t// application database. Zero means\n\t// DefaultUsageStatsFlushInterval; the counters are also flushed at\n\t// shutdown regardless.\n\tUsageStatsFlushInterval time.Duration\n\t// UsageStatsMaxLabelValues caps the distinct values any single\n\t// /metrics label may take for usage statistics. Zero means\n\t// usagestats.DefaultMaxLabelValues. The durable table is unaffected:\n\t// it always records the verbatim user and client.\n\tUsageStatsMaxLabelValues int\n\t// UsageStatsOmitUser renders every /metrics user label as a single\n\t// placeholder. The durable table still records the real name. See\n\t// usagestats.Collector.\n\tUsageStatsOmitUser bool\n\t// UsageStatsMaxSeries caps how many distinct series each store\n\t// holds at all -- which bounds memory and the table, not just the\n\t// scrape. Zero means usagestats.DefaultMaxSeries.\n\tUsageStatsMaxSeries int\n\t// RESTStatsEnabled counts REST API requests the same way MCP tool\n\t// calls are counted. Separable from the MCP counting because the\n\t// web UI polls, so this is the kind whose volume an operator might\n\t// actually object to.\n\tRESTStatsEnabled bool\n\t// UtilizationMaxJobs is HTTP_API_UTILIZATION_MAX_JOBS: the most jobs\n\t// one utilization analysis may read. Zero means the default (a\n\t// million).\n\tUtilizationMaxJobs int\n\t// SpoolMaxUploadBytes is HTTP_API_SPOOL_MAX_UPLOAD_BYTES: the most\n\t// bytes one upload command may transfer, counting a cluster-wide\n\t// fan-out as the tar times the procs it serves. Zero means the\n\t// default; see spool.LimitsFor.\n\tSpoolMaxUploadBytes int64\n\t// RuntimeEstimateInterval is how often the runtime estimator reads\n\t// newly finished jobs from the htcondordb mirror\n\t// (HTTP_API_RUNTIME_ESTIMATE_INTERVAL). Zero or negative disables\n\t// runtime estimates entirely; there is no implicit default here, the\n\t// shipped daemon sets 5m.\n\tRuntimeEstimateInterval time.Duration\n\t// RuntimeEstimateBackfill is how much history the estimator reads at\n\t// startup, and how long a group of jobs is remembered without a new\n\t// completion (HTTP_API_RUNTIME_ESTIMATE_BACKFILL). Zero means 168h.\n\tRuntimeEstimateBackfill time.Duration\n\n\tMetricsCacheTTL time.Duration // Metrics cache TTL (default: 10s)\n\t// MetricsPublic disables the API-key auth gate on /metrics. Use\n\t// only when network ACLs already isolate the endpoint (e.g. a\n\t// private listening address or a sidecar proxy). Default: false\n\t// — an admin must mint an API key with the `metrics` scope and\n\t// configure Prometheus to send it as a Bearer token.\n\tMetricsPublic bool\n\tLogger        *logging.Logger // Logger instance (optional, creates default if nil)\n\t// EnableMCP serves the MCP protocol endpoint (/mcp) and nothing\n\t// else: OAuth2 is decided by OAuth2Enabled, which this is half of.\n\tEnableMCP bool\n\t// MCPOAuth2Disabled withdraws OAuth2 from the MCP endpoint\n\t// (HTTP_API_MCP_OAUTH2 = false): callers authenticate by forwarding\n\t// an HTCondor token, which the schedd validates, and by nothing\n\t// else. A deployment behind a gateway that forwards a per-user\n\t// IDTOKEN on every request never reaches the OAuth2 path, so serving\n\t// an authorization server it cannot honour -- such a pod has no pool\n\t// signing key -- is endpoints with no use behind them.\n\t//\n\t// Stated negatively so the zero value serves OAuth2, which is what\n\t// every deployment did before the setting existed.\n\tMCPOAuth2Disabled bool\n\n\t// Reservations turns the reservation subsystem on: the admin API,\n\t// the admin page and the controller that holds pool capacity ahead\n\t// of a scheduled window. Off unless configured, because holding\n\t// capacity means evicting other people's jobs.\n\tReservations bool\n\t// SSHToJobDisabled withdraws everything built on condor_ssh_to_job\n\t// (HTTP_API_SSH_TO_JOB = false): the gateway, the console's terminal\n\t// on a job, the job proxy and the VS Code app reached through it,\n\t// the Terminal application, and the MCP tools that run commands in a\n\t// job. See ssh_to_job.go.\n\t//\n\t// Stated negatively for the reason the three below are.\n\tSSHToJobDisabled bool\n\t// InteractiveJupyterDisabled, InteractiveVSCodeDisabled and\n\t// InteractiveTerminalDisabled withhold one of the three built-in\n\t// interactive applications (HTTP_API_INTERACTIVE_JUPYTER,\n\t// _VSCODE, _TERMINAL = false).\n\t//\n\t// Stated negatively so the zero value is the one every installation\n\t// had before these existed: all three offered. A Config built\n\t// without thinking about them -- in a test, or by a caller written\n\t// earlier -- keeps serving what it served.\n\tInteractiveJupyterDisabled  bool\n\tInteractiveVSCodeDisabled   bool\n\tInteractiveTerminalDisabled bool\n\n\t// ReservationStampBudget caps how many cluster ads one stamping\n\t// pass writes. Zero takes the package default.\n\tReservationStampBudget int\n\n\t// ReservationEPConstraint limits which execute points a reservation\n\t// may draw seats from, as a ClassAd expression evaluated against the\n\t// slot ad. Empty means every startd the collector reports.\n\tReservationEPConstraint string\n\n\t// ReservationClaims holds an always-on reservation's capacity as\n\t// persistent claims on this access point's schedd rather than by\n\t// pushing machine attributes. Off unless configured: it changes\n\t// where a running reservation's capacity comes from, and the schedd\n\t// has to be told to accept the request.\n\tReservationClaims bool\n\t// WebUIEnabled says this server serves the web UI. OAuth2 -- the\n\t// authorization server, its metadata, the device flow and the SSO\n\t// login -- is served when this or EnableMCP is set: MCP gates only\n\t// MCP. The daemon sets it from webui.IsEmbedded(); an embedder or a\n\t// test sets it directly.\n\tWebUIEnabled bool\n\n\t// DBPath is the unified SQLite database file backing OAuth2/MCP\n\t// storage, the embedded IDP, browser sessions, and user-saved\n\t// batch-submission templates. Defaults to LOCAL_DIR/htcondor-api.db\n\t// (or /var/lib/condor/htcondor-api.db when LOCAL_DIR is unset).\n\t// Configure via HTTP_API_DB_PATH.\n\tDBPath string\n\n\t// KEKFilePath is the path to a file holding the master Key\n\t// Encryption Key used to envelope-encrypt long-lived secrets in\n\t// the application database (the OAuth2 / IDP issuer's RSA\n\t// signing key, fosite's HMAC GlobalSecret). Configured via\n\t// HTTP_API_KEK_FILE — the FILE PATH lives in HTCondor config,\n\t// the KEY BYTES never do (HTCondor treats config values as\n\t// public).\n\t//\n\t// Empty disables encryption: secrets are stored in plaintext as\n\t// before. When set, the file must contain exactly 32 raw bytes\n\t// or a 32-byte hex string and must be 0600/0400. See\n\t// httpserver/appdb/seal for the design.\n\tKEKFilePath string\n\n\t// OAuth2DBPath is a deprecated alias for DBPath kept so existing\n\t// in-process embedders (and the test suite) keep compiling without\n\t// a wholesale rename. NewHandler honors it only when DBPath is\n\t// empty. The cmd-line wrapper does NOT bridge HTTP_API_OAUTH2_DB_PATH\n\t// into this field — pointing the unified DB at a pre-unification\n\t// oauth.db is a guaranteed crash-loop (the legacy schema conflicts\n\t// with goose 0001_init.sql), and the wrapper logs a deprecation\n\t// warning instead. New code should set DBPath.\n\tOAuth2DBPath string\n\tOAuth2Issuer string // OAuth2 issuer URL (default: listen address)\n\t// MCPCIMDEnabled resolves an https:// MCP client_id as a Client ID Metadata\n\t// Document (a public client) instead of requiring DCR. MCPCIMDAllowedHosts,\n\t// when set, restricts which hosts such a client_id may point at.\n\tMCPCIMDEnabled      bool\n\tMCPCIMDAllowedHosts []string\n\t// MCPDCRDisabled refuses dynamic client registration (RFC 7591) and\n\t// stops advertising its endpoint, for a deployment whose clients are\n\t// all seeded, operator-provisioned or CIMD. HTTP_API_MCP_DCR=false.\n\tMCPDCRDisabled bool\n\t// MCPTokenExchangeIssuers is the JSON list of trusted external issuers for\n\t// RFC 8693 token exchange (HTTP_API_MCP_TOKEN_EXCHANGE_ISSUERS). Empty = off.\n\tMCPTokenExchangeIssuers string\n\tOAuth2ClientID          string   // OAuth2 client ID for SSO (optional)\n\tOAuth2ClientSecret      string   // OAuth2 client secret for SSO (optional)\n\tOAuth2AuthURL           string   // OAuth2 authorization URL for SSO (optional)\n\tOAuth2TokenURL          string   // OAuth2 token URL for SSO (optional)\n\tOAuth2RedirectURL       string   // OAuth2 redirect URL for SSO (optional)\n\tOAuth2UserInfoURL       string   // OAuth2 user info endpoint for SSO (optional)\n\tOAuth2Scopes            []string // OAuth2 scopes to request (default: [\"openid\", \"profile\", \"email\"])\n\tOAuth2UsernameClaim     string   // Claim name for username in token (default: \"sub\")\n\tOAuth2GroupsClaim       string   // Claim name for groups in user info (default: \"groups\")\n\t// OAuth2Requirements is a ClassAd expression evaluated against the\n\t// token's claims at login. Empty means no policy.\n\tOAuth2Requirements string\n\n\t// IdentityMapStrategies is the ordered list of ways to turn an OIDC\n\t// subject into a local account -- \"gecos\", \"username\", or both, as in\n\t// \"gecos,username\". Empty disables mapping entirely. When set, group\n\t// membership comes from the system rather than the token, and a\n\t// caller that maps to no single account is refused a session.\n\tIdentityMapStrategies []idmap.Strategy\n\t// IdentityGroupSources lists where group membership comes from, as\n\t// parsed specs: \"system\" and/or \"file:\u003cpath\u003e\". Empty keeps the\n\t// token's groups claim, which is what a container wants because it\n\t// holds no account database to read. Independent of\n\t// IdentityMapStrategies: a deployment may want either, both, or\n\t// neither. Several sources are unioned, the way glibc merges NSS\n\t// services, so a site can carry directory groups and hand-maintained\n\t// ones at once.\n\tIdentityGroupSources []string\n\t// IdentityMapPasswdFile reads accounts from this file instead of\n\t// /etc/passwd. Empty means /etc/passwd, which is the only account\n\t// source that enumerates: the GECOS index cannot list accounts that\n\t// live only in a directory. Accounts it does map are still verified\n\t// against the live database, directory included.\n\tIdentityMapPasswdFile string\n\n\t// SSHGatewayAddress is where the SSH gateway listens, e.g. \":2222\".\n\t// Empty disables it. Setting it makes a missing host key a startup\n\t// error rather than a quietly absent listener.\n\tSSHGatewayAddress string\n\t// SSHGatewayIssuer is the OAuth2 issuer the gateway drives the\n\t// device flow against. Empty means the server's own issuer, which\n\t// is right unless this process cannot reach its own public URL --\n\t// a container behind a proxy terminating TLS, typically.\n\tSSHGatewayIssuer string\n\t// SSHHostKeyFile and SSHCAKeyFile point at operator-staged private\n\t// keys. Empty means generate and keep them sealed in the\n\t// application database, which needs HTTP_API_KEK_FILE. The key\n\t// bytes deliberately have no environment variable: /proc/\u003cpid\u003e/environ\n\t// and crash dumps both leak the environment, a secret volume does not.\n\tSSHHostKeyFile string\n\tSSHCAKeyFile   string\n\t// SSHGatewayPublicHost is the name users actually ssh to, e.g.\n\t// \"ap2001-ssh.chtc.chtc.io\".\n\t//\n\t// It cannot be derived: the container listens on :2222 behind a\n\t// Service that publishes 22 on a different address entirely, so\n\t// the listen address is not what anybody types. Empty means the\n\t// web UI simply does not print an ssh command, which is better\n\t// than printing one that does not work.\n\tSSHGatewayPublicHost string\n\t// SandboxCacheDir is where the +jobs file service keeps job output\n\t// it has already fetched. Empty means no byte cache, so every read\n\t// streams the sandbox again -- correct, but a client walking a job's\n\t// files pays a full transfer per file, because a spooled sandbox has\n\t// no ranged read.\n\t//\n\t// Its contents are discarded at every start and may be deleted by\n\t// hand at any time; nothing depends on them.\n\tSandboxCacheDir string\n\t// SandboxCacheMB is that cache's budget in megabytes. Zero takes a\n\t// default, negative disables the cache.\n\tSandboxCacheMB int\n\t// SandboxMaxGB is the largest job sandbox the file service will\n\t// serve, in gigabytes. Zero takes a default, negative means no\n\t// limit.\n\t//\n\t// The limit guards the one unavoidable full-bandwidth read: learning\n\t// a sandbox's file list means receiving all of it, because the sizes\n\t// arrive one per file just ahead of each body. A job over the limit\n\t// is refused before any byte moves.\n\tSandboxMaxGB int\n\n\t// SSHGatewayLockout refuses connections from a source that keeps\n\t// failing to log in. The zero value is enabled with defaults,\n\t// because a public SSH port with no lockout at all is not a\n\t// reasonable thing to ship.\n\tSSHGatewayLockout SSHGatewayLockoutConfig\n\n\t// SSHGatewaySessionCpus, SSHGatewaySessionMemoryMB and\n\t// SSHGatewaySessionDiskMB size the session the gateway creates for\n\t// a caller who connected by name rather than to an existing job.\n\t// Zero means the interactive default, which is what these sessions\n\t// asked for before the knobs existed.\n\tSSHGatewaySessionCpus     int\n\tSSHGatewaySessionMemoryMB int\n\tSSHGatewaySessionDiskMB   int\n\t// IdentityMapTTL is how long the GECOS index and the group lookups\n\t// are reused. Zero means five minutes.\n\tIdentityMapTTL time.Duration\n\n\t// IdentityMapStripDomain also tries the local part of a scoped\n\t// subject -- \"bockelman@wisc.edu\" as \"bockelman\". Only sound where\n\t// something else constrains which identity providers may log in,\n\t// since the local part is not unique across domains.\n\tIdentityMapStripDomain bool\n\t// OAuth2AccessTokenLifespan is how long an access token issued by the embedded\n\t// MCP issuer is valid. Defaults to 1 hour if zero.\n\tOAuth2AccessTokenLifespan time.Duration\n\t// OAuth2RefreshTokenLifespan is how long a refresh token issued by the embedded\n\t// MCP issuer is valid. Defaults to 30 days if zero. Must be \u003e= OAuth2AccessTokenLifespan;\n\t// otherwise refresh grants will fail before the access token expires (see PelicanPlatform/pelican#3389).\n\tOAuth2RefreshTokenLifespan time.Duration\n\t// OAuth2MaxGrantLifetime caps the total age of a grant, measured from\n\t// the consent that created it, regardless of how often it is\n\t// refreshed. Defaults to DefaultMaxGrantLifetime (30 days) if zero.\n\t//\n\t// This is distinct from OAuth2RefreshTokenLifespan, which every\n\t// refresh resets: without a cap, a client that refreshes more often\n\t// than the refresh lifespan holds its access indefinitely, so removing\n\t// a user's entitlement never expires anything. The cap is the backstop\n\t// that bounds that exposure even when no revocation oracle notices the\n\t// removal. See reauthorizeRefreshGrant.\n\t//\n\t// Configurable via HTTP_API_OAUTH2_MAX_GRANT_LIFETIME.\n\tOAuth2MaxGrantLifetime time.Duration\n\t// OAuth2RevocationOracles names the oracles consulted on every refresh\n\t// grant to decide whether the user is still entitled to what they hold.\n\t// Recognized values:\n\t//\n\t//   \"schedd-userrec\" — honor `condor_qusers -disable \u003cuser\u003e`. Reads the\n\t//       schedd's per-user record (READ authorization) and revokes the\n\t//       grant when it says Enabled=false, surfacing DisableReason.\n\t//       Cheap, and acts only on an explicit administrative decision.\n\t//   \"schedd-acl\"     — probe the schedd's ALLOW_READ / ALLOW_WRITE ACLs\n\t//       with DC_SEC_QUERY and strip scopes it refuses. Costs up to two\n\t//       extra schedd round trips per refresh and tells you nothing in a\n\t//       pool whose ACLs are wildcards, so it is opt-in.\n\t//\n\t// Nil selects the default set (schedd-userrec). An explicitly empty,\n\t// non-nil slice disables all oracles; the grant lifetime cap still\n\t// applies. Unrecognized names are logged and ignored.\n\t//\n\t// Configurable via HTTP_API_OAUTH2_REVOCATION_ORACLES, where the\n\t// literal \"none\" is the spelling for the empty set — a config file\n\t// cannot express nil-versus-empty on its own.\n\tOAuth2RevocationOracles []string\n\t// SuperuserGroup gates superuser mode, in which an administrator acts\n\t// on another user's jobs as that user. Empty (the default) disables it.\n\t//\n\t// Intentionally separate from WebUIAdminGroup. That group means \"may\n\t// read the admin pages\"; this one means \"may act as anyone on this\n\t// access point\", a categorically larger privilege that deserves its own\n\t// decision and its own off switch.\n\t//\n\t// Superuser mode additionally requires a pool signing key: without one\n\t// this server cannot mint the credential it would act under, so the\n\t// feature stays off however this is set.\n\t//\n\t// Configurable via HTTP_API_SUPERUSER_GROUP.\n\tSuperuserGroup string\n\t// ProjectLeadsFile names the project leads file: superuser mode\n\t// confined to the jobs whose ProjectName the session leads. See\n\t// project_leads.go for the format. HTTP_API_PROJECT_LEADS_FILE.\n\tProjectLeadsFile string\n\t// ProjectLeadsGroup is a group-name pattern containing \"{project}\";\n\t// members of the group it names for project P lead P.\n\t// HTTP_API_PROJECT_LEADS_GROUP.\n\tProjectLeadsGroup string\n\t// SuperuserRefreshInterval is how often the schedd's QUEUE_SUPER_USERS\n\t// set is re-read. Zero selects defaultSuperuserRefresh.\n\tSuperuserRefreshInterval time.Duration\n\t// SuperuserFallbackIdentity is the identity used when the operator is\n\t// not themselves a usable queue superuser. Empty selects\n\t// \"condor@$(UID_DOMAIN)\".\n\t//\n\t// That default suits a schedd running as the condor user, where\n\t// real_owner_is_condor matches the daemon's own OS user. It does NOT\n\t// suit a personal condor: there personal_condor is true, that branch is\n\t// disabled, and the equivalent identity is the user the pool runs as.\n\t// Deployments that run the schedd as something else need this knob, and\n\t// so does any test that wants to exercise the fallback without root.\n\t//\n\t// Configurable via HTTP_API_SUPERUSER_FALLBACK_IDENTITY.\n\tSuperuserFallbackIdentity string\n\t// SuperuserArmTTL is how long superuser mode stays on before disarming\n\t// itself. Zero selects defaultSuperuserArmTTL.\n\tSuperuserArmTTL time.Duration\n\tMCPAccessGroup  string // Group required for any MCP access (empty = all authenticated)\n\tMCPReadGroup    string // Group required for read operations (empty = all have read)\n\tMCPWriteGroup   string // Group required for write operations (empty = all have write)\n\t// MCPAdminGroup grants the mcp:admin scope -- reading every user's\n\t// jobs through MCP. Empty disables it: unlike MCPReadGroup and\n\t// MCPWriteGroup, an empty value here grants the privilege to NOBODY\n\t// rather than to everybody. HTTP_API_MCP_ADMIN_GROUP.\n\tMCPAdminGroup string\n\t// MCPSuperuserGroup grants the mcp:superuser scope -- changing\n\t// another user's jobs (remove, hold, release, edit). Empty disables.\n\t//\n\t// Separate from MCPAdminGroup for the same reason SuperuserGroup is\n\t// separate from WebUIAdminGroup: seeing every job and being able to\n\t// remove every job are different privileges, and the second deserves\n\t// its own decision and its own off switch.\n\t// HTTP_API_MCP_SUPERUSER_GROUP.\n\tMCPSuperuserGroup string\n\tMCPInstructions   string // Server-level instructions provided to all MCP agents (e.g., AP-specific guidance)\n\t// MCPDisabledTools (HTTP_API_MCP_DISABLED_TOOLS) names tools this site cannot\n\t// offer, as path.Match patterns separated by commas or whitespace.\n\tMCPDisabledTools string\n\t// MCPReadOnly (HTTP_API_MCP_READ_ONLY) serves MCP with no tool that\n\t// changes anything, for every caller regardless of scope.\n\tMCPReadOnly bool\n\t// MCPConfirmSubmitOver (HTTP_API_MCP_CONFIRM_SUBMIT_OVER) and\n\t// MCPConfirmRemoveOver (HTTP_API_MCP_CONFIRM_REMOVE_OVER) are the job\n\t// counts above which the MCP submit and remove tools ask the person\n\t// running the client to confirm. Zero is off, and is the default.\n\tMCPConfirmSubmitOver int\n\tMCPConfirmRemoveOver int\n\t// MCPDisableSecretRedaction turns off credential masking on MCP tool\n\t// results (HTTP_API_MCP_REDACT_SECRETS = false). Negative so that the\n\t// zero value is the protective one; see mcpserver.Config.\n\tMCPDisableSecretRedaction bool\n\t// MCPRedactDisabledRules (HTTP_API_MCP_REDACT_DISABLED_RULES) names\n\t// masking rules to turn off, as globs over rule ids.\n\tMCPRedactDisabledRules string\n\t// WebUIAppOnlyGroup names the groups whose members are sent to their\n\t// site app instead of the dashboard, and whose stock navigation\n\t// collapses to their apps. Comma-separated;\n\t// HTTP_API_WEBUI_APP_ONLY_GROUP.\n\t//\n\t// This is presentation and NOT authorization. The API is unchanged,\n\t// every page stays reachable by typing its URL, and the expert-mode\n\t// link opens the full console for the session. It exists so a\n\t// non-technical user does not meet a general-purpose batch console\n\t// they did not ask for -- not to stop a determined one reaching it.\n\t// Documentation must never describe it as a restriction, or someone\n\t// will eventually rely on it as one.\n\tWebUIAppOnlyGroup string\n\t// SiteAppsDir holds \u003cid\u003e.zip bundles. Who may see each one is read\n\t// from HTCondorConfig (HTTP_API_SITE_APP_\u003cID\u003e_GROUPS), not from\n\t// the directory. Empty disables site apps entirely: no library is\n\t// built and no /site/ route is registered.\n\tSiteAppsDir string\n\t// WebhooksDisabled is HTTP_API_WEBHOOKS set false: outbound webhooks\n\t// are not offered at all.\n\t//\n\t// Negated so the zero value leaves them ON, which is what every other\n\t// user-facing feature in this struct does and what a test constructing\n\t// a bare Config expects. An operator turning them off is making a\n\t// decision about egress -- a webhook makes this daemon POST to an\n\t// address a user chose -- so it deserves a knob even though the\n\t// destination is already restricted to routable public addresses.\n\tWebhooksDisabled bool\n\t// WebhookFanoutLimit is HTTP_API_WEBHOOK_FANOUT_LIMIT: the most jobs\n\t// one webhook may deliver for before it rolls up and is disabled. Zero\n\t// selects the package default.\n\tWebhookFanoutLimit int\n\t// SiteAppsUpload is HTTP_API_SITE_APPS_UPLOAD: whether\n\t// administrators may publish a bundle through the web interface.\n\t// False unless the site says otherwise; see siteapps_admin.go.\n\tSiteAppsUpload bool\n\t// SiteAppsGitHub is HTTP_API_SITE_APPS_GITHUB: whether a bundle\n\t// may be fetched from a GitHub release rather than attached. True\n\t// unless the site says otherwise; it has no effect where\n\t// SiteAppsUpload is false.\n\tSiteAppsGitHub bool\n\t// SiteAppsReloadInterval is how often that directory is rescanned,\n\t// so dropping a new bundle in place needs no restart and no signal.\n\t// Zero selects defaultSiteAppsReload.\n\tSiteAppsReloadInterval time.Duration\n\t// MCPSkillsReloadInterval is how often to re-read MCPSkillsDir.\n\tMCPSkillsReloadInterval time.Duration\n\t// MCPSkillsDir is a directory of site-authored Markdown skills to\n\t// publish to agents. Empty disables the feature.\n\tMCPSkillsDir string\n\t// MCPAdminUsers lists authenticated subjects that MCP tool\n\t// dispatch treats as admins — most importantly they are exempt\n\t// from the owner-scope wrapper, so they can query and act on other\n\t// users' jobs. Match is exact against the authenticated actor\n\t// (typically \"user@uid.domain\"). Empty = no admins (default).\n\tMCPAdminUsers []string\n\n\t// PoolQueryPolicy restricts which collector attributes a caller\n\t// without the cross-user read privilege may read. Nil means no\n\t// restriction, which is what HTTP_API_POOL_QUERY_IDENTITY defaults\n\t// to. See webapi/poolpolicy.\n\tPoolQueryPolicy *poolpolicy.Policy\n\tWebUIAdminGroup string // Group(s) required for Web UI admin pages (empty disables admin UI). Comma-separated; HTTP_API_WEBUI_ADMIN_GROUP.\n\n\t// WebUIAccessGroup gates logging in to the web interface, separately\n\t// from MCP. Comma-separated; HTTP_API_WEBUI_ACCESS_GROUP. Empty falls\n\t// back to MCPAccessGroup.\n\tWebUIAccessGroup string\n\n\t// Web UI branding. All optional; unset leaves the pages exactly as\n\t// they ship. See branding.go and HTTP_API_WEBUI_SITE_NAME and\n\t// friends.\n\tWebUISiteName    string\n\tWebUISiteTagline string\n\t// WebUIFooterLogos is a JSON array of {\"src\",\"alt\",\"href\"}. Empty\n\t// keeps the shipped CHTC/Morgridge/UW band; \"[]\" removes it.\n\tWebUIFooterLogos string\n\t// WebUIBrandingDir is served read-only under /branding/.\n\tWebUIBrandingDir string\n\t// WebUICustomCSS is a stylesheet served at /branding.css and loaded\n\t// after the app's own.\n\tWebUICustomCSS string\n\t// WebUIFavicon is a URL for the tab icon, normally one of the files\n\t// in WebUIBrandingDir.\n\tWebUIFavicon string\n\t// The site's policy pages, served at /privacy and /terms. Each is\n\t// a markdown file (or \"default\" for the shipped template), or\n\t// failing that a URL to redirect to. Empty serves no page and puts\n\t// no link in the footer. See httpserver/policy.go.\n\tWebUIPrivacyFile string\n\tWebUIPrivacyURL  string\n\tWebUITermsFile   string\n\tWebUITermsURL    string\n\n\tEnableIDP bool // Enable built-in IDP (always enabled in demo mode)\n\t// SpoolBufferDir is where cluster-wide uploads buffer their tar.\n\t// Empty selects the system temp directory.\n\tSpoolBufferDir string\n\t// SeedDemoUser additionally seeds a second, non-admin IDP account\n\t// (\"user\") alongside \"admin\", printing its generated password the\n\t// same way.\n\t//\n\t// Deliberately NOT keyed on EnableIDP: the built-in IDP can be turned\n\t// on in a real deployment with HTTP_API_ENABLE_IDP, and seeding a\n\t// second standing account there — with its password on stdout — is\n\t// not something an operator asked for. Only -demo sets this.\n\t//\n\t// It exists so tests have two identities to check authorization\n\t// boundaries with: an admin, and someone who is not.\n\tSeedDemoUser bool\n\t// DemoCredentialsFile is where the passwords generated for the\n\t// seeded IDP accounts are written, as JSON, mode 0600.\n\t//\n\t// Demo mode's state lives in a fresh os.MkdirTemp directory whose\n\t// name nobody outside the process knows, so stdout was the only way\n\t// to learn the generated passwords. That makes every automated\n\t// consumer a log scraper, and a log scraper breaks the next time\n\t// somebody reformats a banner -- in CI belonging to people who have\n\t// never read this file. A fixed path is a contract those callers can\n\t// hold us to.\n\t//\n\t// Empty disables the write. Only -demo sets it, for the same reason\n\t// SeedDemoUser is demo-only: a real deployment that enables the\n\t// built-in IdP has not asked us to put a password on its disk.\n\tDemoCredentialsFile string\n\t// SeedDemoPlacementUser additionally seeds \"newbie\", an IDP account\n\t// that maps to no local account and that the placementd does not\n\t// map: signing in as it shows the placement access-request flow.\n\t// Demo mode only, and only when demo mode runs a condor_placementd.\n\tSeedDemoPlacementUser bool\n\t// IDPDBPath is deprecated; the IDP shares the unified DBPath.\n\t// Retained as an unused field so existing callers keep compiling\n\t// during the transition.\n\tIDPDBPath string //nolint:unused // kept for back-compat; ignored by NewHandler.\n\tIDPIssuer string // IDP issuer URL (default: listen address)\n\t// IDPAccessTokenLifespan / IDPRefreshTokenLifespan: see OAuth2*Lifespan above. Zero\n\t// uses the same defaults (1h / 30d).\n\tIDPAccessTokenLifespan  time.Duration\n\tIDPRefreshTokenLifespan time.Duration\n\tSessionTTL              time.Duration  // HTTP session TTL (default: 24h)\n\tHTCondorConfig          *config.Config // HTCondor configuration (optional, used for LOCAL_DIR default)\n\t// ClientConfig: see Config.ClientConfig.\n\tClientConfig *config.Config\n\t// PingInterval is the cadence of the periodic collector/schedd ping\n\t// that feeds /readyz. Zero or negative disables it, which is what a\n\t// deployment with no local HTCondor credential wants: the ping has\n\t// nothing to authenticate with there and can only fail. There is no\n\t// implicit default — the shipped daemon sets this from\n\t// HTTP_API_PING_INTERVAL (default 1m, 0 to disable).\n\tPingInterval time.Duration\n\t// MCPWatchMaxWait caps how long the MCP watch_jobs tool may block\n\t// in-call before returning (HTTP_API_MCP_WATCH_MAX_WAIT). Keep it\n\t// under the gateway/proxy timeout in front of this daemon: a block\n\t// that outlives it loses the response carrying the watch id. Zero\n\t// uses the mcpserver default.\n\tMCPWatchMaxWait time.Duration\n\t// CreddAddress pins the credd to talk to (HTTP_API_CREDD_ADDRESS),\n\t// overriding discovery. Needed where a schedd does not advertise its\n\t// credd; otherwise the credd is read from the schedd itself.\n\tCreddAddress string\n\t// RequiredCredentials names the OAuth service credentials that must\n\t// exist before a job may be submitted (HTTP_API_REQUIRED_CREDENTIALS).\n\t// Some access points hold every job submitted without them. Each submit\n\t// path creates a placeholder for any that is missing; see\n\t// required_creds.go.\n\tRequiredCredentials []string\n\t// UpstreamRefresh is HTTP_API_UPSTREAM_REFRESH. See Config.\n\tUpstreamRefresh string\n\n\t// MCPUseSDKTransport serves /mcp with the upstream MCP SDK's transport\n\t// instead of the hand-rolled JSON-RPC handler. HTTP_API_MCP_TRANSPORT.\n\tMCPUseSDKTransport bool\n\n\t// TokenRetention is HTTP_API_TOKEN_RETENTION. See Config.\n\tTokenRetention string\n\t// APIKeyEntitlementTTL is HTTP_API_API_KEY_ENTITLEMENT_TTL. See Config.\n\tAPIKeyEntitlementTTL time.Duration\n\t// ServiceKeyMaxLifetime is HTTP_API_SERVICE_KEY_MAX_LIFETIME. See Config.\n\tServiceKeyMaxLifetime time.Duration\n\n\t// MCPMaxRequestDuration is the hard stop on an MCP request that is\n\t// still making progress (HTTP_API_MCP_MAX_REQUEST_DURATION). While a\n\t// request runs, its write deadline is moved forward rather than being\n\t// the server-wide HTTP_API_WRITE_TIMEOUT, so a deliberately waiting\n\t// tool is bounded by this instead. Zero uses\n\t// DefaultMCPMaxRequestDuration.\n\tMCPMaxRequestDuration time.Duration\n\tStreamBufferSize      int                  // Buffer size for streaming queries (default: 100)\n\tStreamWriteTimeout    time.Duration        // Write timeout for streaming queries (default: 5s)\n\tToken                 string               // Token for daemon authentication (optional)\n\tCredd                 htcondor.CreddClient // Optional credd client; defaults to in-memory implementation\n\t// Placementd is an optional condor_placementd client. Nil means\n\t// \"discover one\", and a failed discovery simply leaves the\n\t// placement endpoints disabled. Tests inject a fake here.\n\tPlacementd htcondor.PlacementdClient\n\t// PlacementIdentityClaims are the userinfo claims, in order, that a\n\t// session's placement identity is taken from\n\t// (HTTP_API_PLACEMENT_IDENTITY_CLAIMS). Empty means \"sub\".\n\tPlacementIdentityClaims []string\n\t// PlacementDisplayNameClaims are the claims, in order, a placement\n\t// user is greeted by (HTTP_API_PLACEMENT_DISPLAY_NAME_CLAIMS). Empty\n\t// means \"name\".\n\tPlacementDisplayNameClaims []string\n\t// PlacementDeviceClients is HTTP_API_PLACEMENT_DEVICE_CLIENTS as\n\t// written: the client_ids the placement device flow accepts. Nil means\n\t// the default, \"placement_client,curl,\".\n\tPlacementDeviceClients *string\n\t// PlacementScheddHost and PlacementCollectorHost override the\n\t// SCHEDD_HOST and COLLECTOR_HOST lines shown with a placement token.\n\tPlacementScheddHost    string\n\tPlacementCollectorHost string\n\t// PlacementPrefillDomains are the identity domains an access request's\n\t// account is suggested from (HTTP_API_PLACEMENT_PREFILL_DOMAINS): for\n\t// an identity in one of them, the part before its last \"@\" in\n\t// UID_DOMAIN. Empty means no suggestion.\n\tPlacementPrefillDomains []string\n\t// PlacementRequestRetention is how long a decided or withdrawn access\n\t// request is kept (HTTP_API_PLACEMENT_REQUEST_RETENTION). Zero means\n\t// 90 days.\n\tPlacementRequestRetention time.Duration\n\t// PlacementdName pins the placementd by its ad's Name, or by a sinful\n\t// string (HTTP_API_PLACEMENTD_NAME, else PLACEMENTD_HOST). Empty\n\t// means this access point's own placementd: the local address file,\n\t// else a PlacementD ad from this access point's host.\n\tPlacementdName string\n\n\t// LLMAPIKeyFile is the path to a file holding the Anthropic API\n\t// key used by the chat endpoint at /api/v1/chat. Empty disables\n\t// the chat feature. The bytes never live in HTCondor config —\n\t// only this file path does.\n\tLLMAPIKeyFile string\n\t// LLMAPIURL overrides the upstream Anthropic Messages endpoint.\n\t// Use to point at a self-hosted LLM gateway / cache. Empty falls\n\t// back to chat.DefaultAnthropicURL.\n\tLLMAPIURL string\n\t// LLMModel overrides the default Anthropic model id. Empty falls\n\t// back to chat.DefaultAnthropicModel.\n\tLLMModel string\n\t// LLMAuthScheme selects the header the key travels in:\n\t// chat.AuthSchemeAPIKey (x-api-key, the Anthropic default) or\n\t// chat.AuthSchemeBearer for a gateway that wants\n\t// \"Authorization: Bearer\". Empty = x-api-key.\n\tLLMAuthScheme string\n\n\t// LLMOperatorInstructionsFile is the path to a file containing\n\t// extra system-prompt rules the operator wants appended to every\n\t// chat turn (e.g. \"users in this pool may not request more than\n\t// 64 GiB of memory; suggest fewer if asked\"). Empty path = no\n\t// addendum.\n\t//\n\t// File mode is enforced 0600/0400 on load — same rationale as the\n\t// API-key file: the operator may put policy text here that they\n\t// don't want every local user to read. Loaded once at startup; a\n\t// hot-reload would need a server restart.\n\tLLMOperatorInstructionsFile string\n\n\t// JupyterWorkDir is where the embedded helper binary (materialized\n\t// from package jupyterhelperbin) and per-instance scratch artifacts\n\t// (token files) are staged. Files persist for the lifetime of the\n\t// job since HTCondor reads transfer_input_files at job-startup time.\n\t// Defaults to \u003cos.TempDir\u003e/htcondor-api-jupyter.\n\tJupyterWorkDir string\n\t// JupyterMaxLifetimeSec / JupyterKernelIdleSec bound a JupyterLab\n\t// session; see handlers_jupyter.go. Zero disables that limit.\n\tJupyterMaxLifetimeSec int\n\tJupyterKernelIdleSec  int\n\t// JupyterStartGraceSec / JupyterReconnectGraceSec: see\n\t// Handler.jupyterStartGraceSec. Zero means the default.\n\tJupyterStartGraceSec     int\n\tJupyterReconnectGraceSec int\n\n\t// TemplateGlobalPath is an optional YAML file with operator-curated\n\t// batch-submission templates. Empty disables. Built-in templates\n\t// always ship.\n\tTemplateGlobalPath string\n\n\t// TemplateUserStoreDBPath is deprecated; the templates store now\n\t// shares the unified DBPath. Retained so existing callers\n\t// keep compiling; ignored by NewHandler.\n\tTemplateUserStoreDBPath string //nolint:unused // kept for back-compat; ignored by NewHandler.\n}\n```\nHandlerConfig holds handler configuration\n\n```go\nfunc (c HandlerConfig) MCPOAuth2Enabled() bool\n```\nMCPOAuth2Enabled reports whether MCP callers may log in through this server's OAuth2, as opposed to forwarding an HTCondor token.\n\nIt decides the /mcp/oauth2/ spelling of the endpoints, the callback and device-verification pages under /mcp/, and the protected-resource documents that name an authorization server for /mcp -- all of which describe a login, so none of them belongs on a server that offers none. It is NOT what gates /mcp itself: the forwarded-token path is unaffected, which is the whole point of turning this off.\n\n```go\nfunc (c HandlerConfig) OAuth2Enabled() bool\n```\nOAuth2Enabled reports whether this configuration serves OAuth2: the authorization server, its discovery metadata, the device flow and the SSO login.\n\nThe web UI needs it to log anybody in and MCP clients authenticate through it, so either one turns it on. MCP gates only MCP. This was once decided by EnableMCP alone, which left a web UI with MCP off unable to log anybody in, with no metadata and no device flow.\n\n```go\ntype HistoryListResponse struct {\n\tAds              []*classad.ClassAd `json:\"ads\"`\n\tSource           string             `json:\"source,omitempty\"`\n\tSourceNote       string             `json:\"source_note,omitempty\"`\n\tScanLimitReached bool               `json:\"scan_limit_reached,omitempty\"`\n\tRecordsScanned   int                `json:\"records_scanned,omitempty\"`\n}\n```\nHistoryListResponse represents a history listing response. Source and SourceNote name the backend that answered (\"htcondordb\" when a synchronized mirror served it, absent for the schedd) so a caller can tell how fresh the records are.\n\nScanLimitReached is set when the schedd stopped at its scan limit before finding as many records as asked for: it examined only the RecordsScanned most recent history records, so older matches are not in the answer -- even an empty one.\n\n```go\ntype HoldReasonCount struct {\n\tCode  int64  `json:\"code\"`\n\tLabel string `json:\"label\"`\n\tCount int    `json:\"count\"`\n\t// Example is one hold reason string with this code, because the code\n\t// says the category and the message says which file or which host.\n\tExample string `json:\"example,omitempty\"`\n}\n```\nHoldReasonCount is one row of the hold breakdown.\n\n```go\ntype IDPProvider struct {\n\t// contains filtered or unexported fields\n}\n```\nIDPProvider manages OAuth2 operations for the built-in IDP\n\n```go\nfunc NewIDPProvider(opts IDPProviderOptions) (*IDPProvider, error)\n```\nNewIDPProvider creates a new IDP provider with SQLite storage. Both AccessTokenLifespan and RefreshTokenLifespan in opts must be \u003e 0; otherwise an error is returned. See OAuth2ProviderOptions for the rationale.\n\n```go\nfunc (p *IDPProvider) Close() error\n```\nClose is now a no-op: the IDP provider does not own the underlying \\*sql.DB anymore. The Handler that opened the unified app DB is responsible for closing it on shutdown.\n\n```go\nfunc (p *IDPProvider) GetProvider() fosite.OAuth2Provider\n```\nGetProvider returns the underlying fosite OAuth2Provider\n\n```go\nfunc (p *IDPProvider) GetStorage() *IDPStorage\n```\nGetStorage returns the IDP storage\n\n```go\nfunc (p *IDPProvider) GetStrategy() *compose.CommonStrategy\n```\nGetStrategy returns the OAuth2 strategy\n\n```go\nfunc (p *IDPProvider) UpdateIssuer(issuer string)\n```\nUpdateIssuer updates the issuer URL in the OAuth2 config\n\n```go\ntype IDPProviderOptions struct {\n\tDB                   *sql.DB\n\tIssuer               string\n\tAccessTokenLifespan  time.Duration\n\tRefreshTokenLifespan time.Duration\n\t// Sealer envelope-encrypts the IDP's RSA private key + HMAC\n\t// GlobalSecret. See OAuth2ProviderOptions.Sealer.\n\tSealer *seal.Sealer\n}\n```\nIDPProviderOptions configures lifespans and other tunables for the IDP provider. DB is the unified application database (see appdb); the provider does not own its lifecycle.\n\n```go\ntype IDPStorage struct {\n\t// contains filtered or unexported fields\n}\n```\nIDPStorage implements fosite storage interfaces using the unified application database. The IDP's tables (idp\\_\\*) live alongside the OAuth2/MCP tables in the same SQLite file managed by appdb.\n\nSee OAuth2Storage for the sealer field's role.\n\n```go\nfunc NewIDPStorage(db *sql.DB) *IDPStorage\n```\nNewIDPStorage wraps an already-opened, already-migrated DB. Schema is owned by the appdb migrations; this struct only holds the query helpers. The caller retains DB ownership.\n\n```go\nfunc (s *IDPStorage) AuthenticateUser(ctx context.Context, username, password string) error\n```\nAuthenticateUser verifies username and password\n\n```go\nfunc (s *IDPStorage) ClientAssertionJWTValid(ctx context.Context, jti string) error\n```\nClientAssertionJWTValid implements fosite.ClientAssertionJWTValid interface\n\n```go\nfunc (s *IDPStorage) CreateAccessTokenSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreateAccessTokenSession stores an access token session\n\n```go\nfunc (s *IDPStorage) CreateAuthorizeCodeSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreateAuthorizeCodeSession stores an authorization code session\n\n```go\nfunc (s *IDPStorage) CreateClient(ctx context.Context, client *fosite.DefaultClient) error\n```\nCreateClient creates a new OAuth2 client\n\n```go\nfunc (s *IDPStorage) CreateOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) error\n```\nCreateOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *IDPStorage) CreatePKCERequestSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreatePKCERequestSession stores a PKCE request session\n\n```go\nfunc (s *IDPStorage) CreateRefreshTokenSession(ctx context.Context, signature string, _ string, request fosite.Requester) error\n```\nCreateRefreshTokenSession stores a refresh token session\n\n```go\nfunc (s *IDPStorage) CreateSession(ctx context.Context, username string) (string, error)\n```\nCreateSession creates a new session for the given username. The returned ID is the idp\\_session cookie value; idp\\_sessions stores its sessionKey, as http\\_sessions does.\n\n```go\nfunc (s *IDPStorage) CreateUser(ctx context.Context, username, password, state string) error\n```\nCreateUser creates a new user with hashed password and specified state\n\n```go\nfunc (s *IDPStorage) DeleteAccessTokenSession(ctx context.Context, signature string) error\n```\nDeleteAccessTokenSession deletes an access token session\n\n```go\nfunc (s *IDPStorage) DeleteOpenIDConnectSession(ctx context.Context, signature string) error\n```\nDeleteOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *IDPStorage) DeletePKCERequestSession(ctx context.Context, signature string) error\n```\nDeletePKCERequestSession deletes a PKCE request session\n\n```go\nfunc (s *IDPStorage) DeleteRefreshTokenSession(ctx context.Context, signature string) error\n```\nDeleteRefreshTokenSession deletes a refresh token session\n\n```go\nfunc (s *IDPStorage) DeleteSession(ctx context.Context, sessionID string) error\n```\nDeleteSession deletes a session\n\n```go\nfunc (s *IDPStorage) GetAccessTokenSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetAccessTokenSession retrieves an access token session\n\n```go\nfunc (s *IDPStorage) GetAuthorizeCodeSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetAuthorizeCodeSession retrieves an authorization code session\n\n```go\nfunc (s *IDPStorage) GetClient(ctx context.Context, clientID string) (fosite.Client, error)\n```\nGetClient retrieves a client by ID\n\n```go\nfunc (s *IDPStorage) GetOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) (fosite.Requester, error)\n```\nGetOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *IDPStorage) GetPKCERequestSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetPKCERequestSession retrieves a PKCE request session\n\n```go\nfunc (s *IDPStorage) GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetRefreshTokenSession retrieves a refresh token session\n\n```go\nfunc (s *IDPStorage) GetSession(ctx context.Context, sessionID string) (string, error)\n```\nGetSession retrieves the username for a given session ID\n\n```go\nfunc (s *IDPStorage) GetUserState(ctx context.Context, username string) (string, error)\n```\nGetUserState retrieves the state of a user\n\n```go\nfunc (s *IDPStorage) InvalidateAuthorizeCodeSession(ctx context.Context, signature string) error\n```\nInvalidateAuthorizeCodeSession invalidates an authorization code\n\n```go\nfunc (s *IDPStorage) LoadHMACSecret(ctx context.Context) ([]byte, error)\n```\nLoadHMACSecret loads the HMAC secret. See OAuth2Storage.LoadHMACSecret.\n\n```go\nfunc (s *IDPStorage) LoadRSAKey(ctx context.Context) (string, error)\n```\nLoadRSAKey loads the RSA private key. See OAuth2Storage.LoadRSAKey.\n\n```go\nfunc (s *IDPStorage) RevokeAccessToken(ctx context.Context, requestID string) error\n```\nRevokeAccessToken revokes an access token\n\n```go\nfunc (s *IDPStorage) RevokeAllForSubject(ctx context.Context, subject string) (int64, error)\n```\nRevokeAllForSubject deactivates every IDP access and refresh token belonging to one subject. See OAuth2Storage.RevokeAllForSubject.\n\n```go\nfunc (s *IDPStorage) RevokeRefreshToken(ctx context.Context, requestID string) error\n```\nRevokeRefreshToken revokes a refresh token\n\n```go\nfunc (s *IDPStorage) RevokeRefreshTokenMaybeGracePeriod(ctx context.Context, requestID string, _ string) error\n```\nRevokeRefreshTokenMaybeGracePeriod implements fosite.TokenRevocationStorage interface\n\n```go\nfunc (s *IDPStorage) RotateRefreshToken(ctx context.Context, requestID string, _ string) error\n```\nRotateRefreshToken revokes the refresh token and its associated access token for the request (required by fosite's RefreshTokenStorage as of v0.49).\n\n```go\nfunc (s *IDPStorage) SaveHMACSecret(ctx context.Context, secret []byte) error\n```\nSaveHMACSecret stores the HMAC secret. See OAuth2Storage.SaveHMACSecret.\n\n```go\nfunc (s *IDPStorage) SaveRSAKey(ctx context.Context, privateKeyPEM string) error\n```\nSaveRSAKey stores the RSA private key. Mirrors OAuth2Storage's implementation — see SaveRSAKey there for the encryption rationale.\n\n```go\nfunc (s *IDPStorage) SetClientAssertionJWT(ctx context.Context, jti string, exp time.Time) error\n```\nSetClientAssertionJWT implements fosite.SetClientAssertionJWT interface\n\n```go\nfunc (s *IDPStorage) SetSealer(sealer *seal.Sealer)\n```\nSetSealer enables envelope encryption for the long-lived secret columns (RSA private key, HMAC secret). See OAuth2Storage.SetSealer.\n\n```go\nfunc (s *IDPStorage) UpdateClientSecret(ctx context.Context, clientID string, hashedSecret []byte) error\n```\nUpdateClientSecret replaces a client's stored secret, which must already be hashed.\n\n```go\nfunc (s *IDPStorage) UserExists(ctx context.Context, username string) (bool, error)\n```\nUserExists checks if a user exists\n\n```go\ntype Impersonation struct {\n\t// Actor is the authenticated human who armed superuser mode.\n\tActor string\n\t// Target is the job owner being acted for, derived from the job rather\n\t// than supplied by the caller.\n\tTarget string\n\t// Identity is what this server authenticates to the schedd as. Either\n\t// Actor (when they are themselves a queue superuser) or the shared\n\t// fallback.\n\tIdentity string\n\t// ActorIsSuperUser records which of those it was. When true the schedd's\n\t// own log names the human; when false the schedd only ever sees the\n\t// shared identity and this server's audit record is the only place the\n\t// actor appears.\n\tActorIsSuperUser bool\n\t// Project is set when the actor is acting as a project lead rather\n\t// than as a global superuser: the project, as configured, that grants\n\t// this impersonation. Empty for global scope.\n\tProject string\n}\n```\nImpersonation describes one superuser action: who asked for it, whose job it is, and which identity the server will present to the schedd.\n\n```go\nfunc (i Impersonation) Reason(what string) string\n```\nReason renders the actor and target into a string suitable for a HoldReason / RemoveReason / ReleaseReason.\n\nThe schedd appends \"(by user \\\u003cauthenticated identity\u003e)\" to whatever reason it is given -- see actOnJobs in schedd.cpp -- so when the actor is a queue superuser the job ad ends up naming them twice, from two independent sources. When they are not, the schedd can only append the shared identity, and this prefix is the ONLY record in the job ad of which human acted. That is why the actor goes in the text rather than being left to the schedd.\n\nThe result lands in the job ad, so it outlives this server's logs, follows the job into history, and is visible to the job's owner -- who is entitled to know that somebody else touched their job, and which somebody.\n\nA project lead's reason names the project, so the owner can tell which grant was used and whom to ask about it.\n\n```go\ntype Integration struct {\n\tID           string     `json:\"id\"`\n\tName         string     `json:\"name,omitempty\"`\n\tRedirectURIs []string   `json:\"redirect_uris,omitempty\"`\n\tGrantTypes   []string   `json:\"grant_types,omitempty\"`\n\tScopes       []string   `json:\"scopes,omitempty\"`\n\tPublic       bool       `json:\"public\"`\n\tCreatedAt    time.Time  `json:\"created_at\"`\n\tLastUsedAt   *time.Time `json:\"last_used_at,omitempty\"`\n\t// HasSecret says a secret exists, without being one. A confidential\n\t// client always has one; it is shown only at creation, so the UI needs\n\t// to say \"a secret exists and you cannot see it again\" rather than\n\t// leaving a blank field that reads as \"no secret\".\n\tHasSecret bool `json:\"has_secret\"`\n}\n```\nIntegration is one of the caller's clients as the UI sees it. There is no secret field, by the same reasoning as connectors.Stored: a struct with one is a struct that ends up in a response the first time somebody adds an endpoint. The secret exists once, in the reply to the creation that minted it.\n\n```go\ntype InteractiveCreateTerminalRequest struct {\n\tCpus     int `json:\"cpus,omitempty\"`\n\tMemoryMB int `json:\"memory_mb,omitempty\"`\n\tDiskMB   int `json:\"disk_mb,omitempty\"`\n\n\t// GPU fields. Mirrored verbatim into request_gpus and the\n\t// gpus_minimum_* / cuda_version / require_gpus submit lines.\n\t// Gpus == 0 disables the entire GPU section in the submit file.\n\tGpus                  int    `json:\"gpus,omitempty\"`\n\tGpusMinimumCapability string `json:\"gpus_minimum_capability,omitempty\"`\n\tGpusMinimumMemory     int    `json:\"gpus_minimum_memory,omitempty\"`\n\tGpusMinimumRuntime    string `json:\"gpus_minimum_runtime,omitempty\"`\n\tCudaVersion           string `json:\"cuda_version,omitempty\"`\n\tRequireGpus           string `json:\"require_gpus,omitempty\"`\n\n\t// SubmitLines are extra submit commands the user typed in the launch\n\t// form (e.g. \"+ProjectName = ...\", \"environment = ...\"). Untrusted:\n\t// validated with interactive.ValidateCallerSubmitLines, which rejects\n\t// anything that would redefine the session (executable, universe,\n\t// queue, ...). Merged before the operator's block so operator policy\n\t// still wins.\n\tSubmitLines string `json:\"submit_lines,omitempty\"`\n}\n```\nInteractiveCreateTerminalRequest is the optional JSON body of POST /api/v1/interactive/terminal. All fields are optional; the server fills sensible defaults.\n\n```go\ntype InteractiveCreateTerminalResponse struct {\n\tInstanceID string `json:\"instance_id\"`\n\tClusterID  int    `json:\"cluster_id\"`\n\tProcID     int    `json:\"proc_id\"`\n\tJobID      string `json:\"job_id\"` // \"cluster.proc\" (the complete id in multi-AP mode) — convenience for the SPA\n\tBatchName  string `json:\"batch_name\"`\n\t// Schedd is the access point the terminal was placed on, in\n\t// multi-AP mode.\n\tSchedd string `json:\"schedd,omitempty\"`\n}\n```\nInteractiveCreateTerminalResponse is the JSON returned on success.\n\n```go\ntype InteractiveTerminalSummary struct {\n\tInstanceID string `json:\"instance_id\"`\n\tJobID      string `json:\"job_id\"`\n\t// Schedd is the access point the job is on, in multi-AP mode, where\n\t// JobID is the complete id.\n\tSchedd                       string `json:\"schedd,omitempty\"`\n\tClusterID                    int    `json:\"cluster_id\"`\n\tProcID                       int    `json:\"proc_id\"`\n\tBatchName                    string `json:\"batch_name\"`\n\tJobStatus                    int    `json:\"job_status\"`\n\tJobCurrentStartExecutingDate int64  `json:\"job_current_start_executing_date,omitempty\"`\n\tHoldReasonCode               int    `json:\"hold_reason_code,omitempty\"`\n\tHoldReason                   string `json:\"hold_reason,omitempty\"`\n\tSubmittedAt                  string `json:\"submitted_at,omitempty\"` // RFC3339 from QDate\n\n\t// Kind distinguishes a terminal launched from this web app\n\t// (\"terminal\") from a named session started through MCP or the SSH\n\t// gateway (\"session\"). They are both interactive jobs of this\n\t// server's making and belong on the same page, but they are not\n\t// interchangeable: a session outlives the connection that made it\n\t// and is reached by name, so the UI should not offer it the\n\t// terminal's close-on-disconnect affordances.\n\tKind string `json:\"kind\"`\n\t// Name is the session's name, for Kind == \"session\". Empty for a\n\t// terminal, which has only an opaque instance id.\n\tName string `json:\"name,omitempty\"`\n\t// SSHCommand is how to reach a session from a shell, when the SSH\n\t// gateway is configured. Empty otherwise.\n\tSSHCommand string `json:\"ssh_command,omitempty\"`\n}\n```\nInteractiveTerminalSummary is the SPA-facing shape of one terminal session. Returned by GET /api/v1/interactive/terminal.\n\nJobCurrentStartExecutingDate is the schedd's \"executable actually started running\" timestamp; combined with JobStatus the SPA's shared status module distinguishes \"queued\" from \"transferring input\" from \"executing\".\n\n```go\ntype IssueSection struct {\n\tKind  string `json:\"kind\"`\n\tTitle string `json:\"title\"`\n\t// Total and Users are over the whole section, so a section header\n\t// can say \"4,812 jobs, 11 users\" without the reader adding up rows\n\t// -- and so the numbers do not change when the slider does.\n\tTotal    int              `json:\"total\"`\n\tUsers    int              `json:\"users\"`\n\tClusters []issues.Cluster `json:\"clusters\"`\n}\n```\nIssueSection is one kind of problem: holds, or run attempts that failed.\n\n```go\ntype IssueTimings struct {\n\t// HoldsMs and RunAttemptsMs are the two reads, with what they\n\t// returned beside them -- a slow read of forty rows and a slow read\n\t// of forty thousand are different problems.\n\tHoldsMs       int64 `json:\"holds_query_ms\"`\n\tHolds         int   `json:\"holds\"`\n\tRunAttemptsMs int64 `json:\"run_attempts_query_ms\"`\n\tRunAttempts   int   `json:\"run_attempts\"`\n\t// ClusterMs is the grouping: masking, the parse tree, the merge pass\n\t// and the per-cluster summaries.\n\tClusterMs int64 `json:\"cluster_ms\"`\n\t// Cached says the reads were not done for this request. Without it a\n\t// second page load looks fast and hides what the first one cost.\n\tCached bool `json:\"cached\"`\n\t// AgeSeconds is how old the cached reads are.\n\tAgeSeconds int64 `json:\"age_seconds,omitempty\"`\n}\n```\nIssueTimings splits the cost of one answer.\n\n```go\ntype IssuesResponse struct {\n\tWindowSeconds int64 `json:\"window_seconds\"`\n\tComputedAt    int64 `json:\"computed_at\"`\n\t// Granularity as applied, which may be the clamped form of what was\n\t// asked for.\n\tGranularity float64 `json:\"granularity\"`\n\t// IncludeEnded says whether run-attempt history was read: without\n\t// it the page describes what is stuck now, with it what has gone\n\t// wrong over the window.\n\tIncludeEnded bool `json:\"include_ended\"`\n\t// OwnedByMe says whose jobs these are as applied: a caller that may\n\t// not see everyone's gets its own whatever it asked for.\n\tOwnedByMe bool `json:\"owned_by_me\"`\n\t// Constraint is the caller's filter as applied (re-serialized), or\n\t// empty.\n\tConstraint string `json:\"constraint,omitempty\"`\n\t// BucketSeconds is how much time one slice of a cluster's timeline\n\t// covers, so a caller can label it without re-deriving the window.\n\tBucketSeconds int64          `json:\"bucket_seconds,omitempty\"`\n\tSource        string         `json:\"source,omitempty\"`\n\tTruncated     bool           `json:\"truncated,omitempty\"`\n\tNotes         []string       `json:\"notes,omitempty\"`\n\tSections      []IssueSection `json:\"sections\"`\n\t// Sources is multi-AP mode's: which access points' data is not\n\t// current. Every example and cluster there names its AP.\n\tSources *multiap.Sources `json:\"sources,omitempty\"`\n\t// Timings is what the answer cost to produce. Returned rather than\n\t// only logged: this page reads two large tables and then does real\n\t// work on what comes back, so \"it is slow\" has three possible\n\t// answers, and the person who can see the slowness is usually not\n\t// the person who can read the server's log.\n\tTimings *IssueTimings `json:\"timings,omitempty\"`\n}\n```\nIssuesResponse is the whole page.\n\n```go\ntype JobActionFunc func(ctx context.Context, constraint, reason string) (*htcondor.JobActionResults, error)\n```\nJobActionFunc is a function that performs a job action (hold, release, etc.)\n\n```go\ntype JobEditRequest struct {\n\tAttributes map[string]interface{} `json:\"attributes\"` // Attributes to update\n}\n```\nJobEditRequest represents a job edit request\n\n```go\ntype JobListResponse struct {\n\tJobs []*classad.ClassAd `json:\"jobs\"`\n}\n```\nJobListResponse represents a job listing response\n\n```go\ntype JobLogResponse struct {\n\tJobID     string          `json:\"jobId\"`\n\tFilename  string          `json:\"filename\"`\n\tTruncated bool            `json:\"truncated\"`\n\tEvents    []userlog.Event `json:\"events\"`\n}\n```\nJobLogResponse is the JSON shape returned by GET /api/v1/jobs/{id}/log. It mirrors the stdout/stderr endpoints — explicit fetch, no streaming.\n\n```go\ntype JobOutcome struct {\n\tJob    string `json:\"job\"`\n\tReason string `json:\"reason\"`\n}\n```\nJobOutcome is one job left alone, and why.\n\n```go\ntype JobSubmitRequest struct {\n\tSubmitFile string `json:\"submit_file\"` // Submit file content\n}\n```\nJobSubmitRequest represents a job submission request\n\n```go\ntype JobSubmitResponse struct {\n\tClusterID int `json:\"cluster_id\"`\n\t// JobIDs are \"cluster.proc\"; in multi-AP mode, complete ids\n\t// (\"cluster.proc@schedd\"), the form every later step takes.\n\tJobIDs []string `json:\"job_ids\"`\n\t// Schedd is the access point the job was submitted to (multi-AP\n\t// mode only).\n\tSchedd string `json:\"schedd,omitempty\"`\n\t// Jobs names each job by its separate parts (multi-AP mode only).\n\tJobs []multiap.JobRef `json:\"jobs,omitempty\"`\n\t// Assignment is the caller's AP assignment the submission followed\n\t// (multi-AP mode only).\n\tAssignment *apassign.Assignment `json:\"assignment,omitempty\"`\n\t// Warnings are submitlint diagnostics about the submit file: things\n\t// that parsed and submitted fine but almost certainly do not do what\n\t// the submitter meant, most importantly output the job is about to\n\t// throw away. The job is already in the queue by the time these are\n\t// known, so they are advice about whether to remove and resubmit it,\n\t// not an error -- which is why they ride on a 201 rather than\n\t// replacing it with a 400.\n\tWarnings []string `json:\"warnings,omitempty\"`\n}\n```\nJobSubmitResponse represents a job submission response\n\n```go\ntype JupyterCreateRequest struct {\n\t// Image is the Docker image to launch. Default\n\t// quay.io/jupyter/scipy-notebook:latest.\n\tImage string `json:\"image\"`\n\t// Cpus is the requested core count. Default 2.\n\tCpus int `json:\"cpus\"`\n\t// MemoryMB is the requested RAM in mebibytes. Default 4096.\n\tMemoryMB int `json:\"memory_mb\"`\n\t// DiskMB is the requested scratch disk in mebibytes. Default 4096.\n\tDiskMB int `json:\"disk_mb\"`\n\n\t// GPU fields. Mirrored verbatim into request_gpus and the\n\t// gpus_minimum_* / cuda_version / require_gpus submit lines.\n\t// Gpus == 0 disables the entire GPU section in the submit file.\n\tGpus                  int    `json:\"gpus,omitempty\"`\n\tGpusMinimumCapability string `json:\"gpus_minimum_capability,omitempty\"`\n\tGpusMinimumMemory     int    `json:\"gpus_minimum_memory,omitempty\"`\n\tGpusMinimumRuntime    string `json:\"gpus_minimum_runtime,omitempty\"`\n\tCudaVersion           string `json:\"cuda_version,omitempty\"`\n\tRequireGpus           string `json:\"require_gpus,omitempty\"`\n\n\t// SubmitLines are extra submit commands the user typed in the launch\n\t// form. Untrusted: validated with interactive.ValidateCallerSubmitLines,\n\t// which rejects anything that would redefine the job (executable,\n\t// universe, container_image, queue, ...). Merged before the operator's\n\t// extras so operator policy still wins.\n\tSubmitLines string `json:\"submit_lines,omitempty\"`\n}\n```\nJupyterCreateRequest is the optional JSON body of POST /jupyter/instances. All fields have sensible defaults so a bare {} is a valid request.\n\n```go\ntype JupyterCreateResponse struct {\n\tInstanceID string `json:\"instance_id\"`\n\tClusterID  string `json:\"cluster_id\"`\n\t// Schedd is the access point the session was placed on, in\n\t// multi-AP mode.\n\tSchedd string `json:\"schedd,omitempty\"`\n\t// ProxyPath is where the browser should eventually point its iframe\n\t// (only useful once the helper has connected back; the SSE stream\n\t// from /events tells you when).\n\tProxyPath string `json:\"proxy_path\"`\n}\n```\nJupyterCreateResponse is the JSON returned by POST /jupyter/instances.\n\n```go\ntype JupyterInstanceSummary struct {\n\tInstanceID string `json:\"instance_id\"`\n\tClusterID  string `json:\"cluster_id,omitempty\"`\n\t// JobID is the session's job as /api/v1/jobs/{id} names it:\n\t// cluster.0, or in multi-AP mode the complete id. Empty until the\n\t// submit returns.\n\tJobID string `json:\"job_id,omitempty\"`\n\t// Schedd is the access point the session's job is on, in multi-AP\n\t// mode.\n\tSchedd    string `json:\"schedd,omitempty\"`\n\tImage     string `json:\"image,omitempty\"`\n\tOwner     string `json:\"owner\"`\n\tCreatedAt string `json:\"created_at\"`\n\tConnected bool   `json:\"connected\"` // helper has dialed back\n\t// Reconnecting: the helper was connected and its tunnel dropped (or\n\t// went with the last server process); it is expected to dial back.\n\tReconnecting                 bool   `json:\"reconnecting,omitempty\"`\n\tProxyPath                    string `json:\"proxy_path\"`\n\tEventsPath                   string `json:\"events_path\"`\n\tJobStatus                    int    `json:\"job_status,omitempty\"`\n\tJobCurrentStartExecutingDate int64  `json:\"job_current_start_executing_date,omitempty\"`\n\tHoldReasonCode               int    `json:\"hold_reason_code,omitempty\"`\n\tHoldReason                   string `json:\"hold_reason,omitempty\"`\n}\n```\nJupyterInstanceSummary is the SPA-facing shape returned by both GET /api/v1/jupyter/instances (list) and GET /api/v1/jupyter/instances/{id} (single). The proxy\\_path is what the iframe should mount; the events\\_path drives the SSE stream.\n\nThe job\\_\\* fields are populated from a single bulk schedd query (handleJupyterListInstances) so the list view can run the same status-interpretation logic the detail page uses, without a round-trip per row. Empty when the schedd query failed or the cluster is gone — the SPA falls back to a \"loading\"/\"connected only\" view in that case.\n\n```go\ntype LoginRateLimiter struct {\n\t// contains filtered or unexported fields\n}\n```\nLoginRateLimiter is a token bucket per key -- a source address, a username -- for endpoints an unauthenticated caller can reach.\n\nThe key space is chosen by the caller, so the table is bounded: no goroutine per key, and at most maxKeys entries. Entries are kept in recency order. One untouched for longer than its bucket takes to refill is indistinguishable from a new one and is dropped as the limiter is used; past the cap the least recently used entry goes, which is never the key somebody is busy hammering.\n\n```go\nfunc NewLoginRateLimiter(r rate.Limit, b int) *LoginRateLimiter\n```\nNewLoginRateLimiter creates a new login rate limiter rate: maximum requests per second per key burst: maximum burst size per key\n\n```go\nfunc (l *LoginRateLimiter) Allow(key string) bool\n```\nAllow spends one attempt from key's budget and reports whether there was one to spend.\n\n```go\nfunc (l *LoginRateLimiter) Exhausted(key string) bool\n```\nExhausted reports whether key has no attempt left to spend, without spending one. For a limit charged only on failure: check this first, then call Allow once the attempt has failed.\n\n```go\ntype MultiAPBulkResponse struct {\n\tMessage    string `json:\"message\"`\n\tConstraint string `json:\"constraint\"`\n\tmultiap.BulkReport\n}\n```\nMultiAPBulkResponse is the body of a multi-AP bulk action.\n\n```go\ntype MultiAPConfig struct {\n\t// ScheddConstraint is HTTP_API_SCHEDD_CONSTRAINT: the AP set, over\n\t// ScheddAds.\n\tScheddConstraint string\n\t// HubName and HubAddress are HTTP_API_HUB_NAME / _ADDRESS: name the\n\t// federation hubs (one, or several separated by commas or spaces),\n\t// or dial one at a fixed address, instead of discovering every\n\t// HTCondorDB ad that carries FederationConstraint.\n\tHubName    string\n\tHubAddress string\n\t// HubSwitchAfter, HubSwitchMargin and HubFailAfter are\n\t// HTTP_API_HUB_SWITCH_SECONDS, _SWITCH_MARGIN and _FAIL_AFTER: how\n\t// the active hub is chosen among several (multiap.HubPolicy). Zero\n\t// takes the default.\n\tHubSwitchAfter  time.Duration\n\tHubSwitchMargin int\n\tHubFailAfter    int\n\t// HubSettle is HTTP_API_HUB_SETTLE_SECONDS: how long after a switch\n\t// the new hub's APs are reported settling. Zero takes the default.\n\tHubSettle time.Duration\n\t// Stale is HTTP_API_MULTI_AP_STALE: include (default) or exclude a\n\t// degraded AP's rows from unscoped reads.\n\tStale string\n\t// JobIDCodec is HTTP_API_JOB_ID_CODEC; empty selects jobid's default.\n\tJobIDCodec string\n\t// BulkFresh is HTTP_API_BULK_FRESH_SECONDS: how fresh the hub's copy\n\t// of an AP must be for a bulk action to skip that AP on the hub's\n\t// word that nothing there matches. Zero (the default) or negative\n\t// never skips: every usable AP is contacted.\n\tBulkFresh time.Duration\n\t// Assignment is HTTP_API_AP_ASSIGNMENT and its knobs: which AP a\n\t// user's new work goes to.\n\tAssignment apassign.Config\n\t// contains filtered or unexported fields\n}\n```\nMultiAPConfig configures multi-AP mode. ScheddConstraint set enables it.\n\n```go\nfunc (c MultiAPConfig) Enabled() bool\n```\nEnabled reports whether multi-AP mode is configured.\n\n```go\ntype OAuth2Provider struct {\n\t// contains filtered or unexported fields\n}\n```\nOAuth2Provider manages OAuth2 operations\n\n```go\nfunc NewOAuth2Provider(opts OAuth2ProviderOptions) (*OAuth2Provider, error)\n```\nNewOAuth2Provider creates a new OAuth2 provider with SQLite storage. Both AccessTokenLifespan and RefreshTokenLifespan in opts must be \u003e 0; otherwise an error is returned. This is intentional: silent fallback to fosite's defaults (1h access, 30d refresh) has bitten downstream projects when callers forget to pass them through, so callers must opt in explicitly.\n\n```go\nfunc (p *OAuth2Provider) AuthenticateClient(ctx context.Context, r *http.Request, form url.Values) (fosite.Client, error)\n```\nAuthenticateClient authenticates the client on a token request (client\\_secret\\_basic / client\\_secret\\_post), for custom grant flows that bypass fosite's NewAccessRequest pipeline -- notably RFC 8693 token exchange. The concrete provider from compose.Compose is \\*fosite.Fosite, which exposes the same client-authentication strategy the standard token endpoint uses.\n\n```go\nfunc (p *OAuth2Provider) Close() error\n```\nClose is now a no-op: the OAuth2 provider does not own the underlying \\*sql.DB anymore. The Handler that opened the unified app DB is responsible for closing it on shutdown. Method retained so callers that defer p.Close() during refactors don't break.\n\n```go\nfunc (p *OAuth2Provider) GetProvider() fosite.OAuth2Provider\n```\nGetProvider returns the underlying fosite OAuth2Provider\n\n```go\nfunc (p *OAuth2Provider) GetStorage() *OAuth2Storage\n```\nGetStorage returns the OAuth2 storage\n\n```go\nfunc (p *OAuth2Provider) GetStrategy() *compose.CommonStrategy\n```\nGetStrategy returns the OAuth2 strategy\n\n```go\nfunc (p *OAuth2Provider) IntrospectAccessToken(ctx context.Context, token string) (fosite.AccessRequester, error)\n```\nIntrospectAccessToken validates one of our access tokens and returns the requester behind it (subject via GetSession, and the granted scopes), or an error if the token is unknown/expired/revoked. Used by token exchange to bind a subject\\_token to its authorization. Unlike IntrospectToken it keeps the requester, which is where the granted scopes live.\n\n```go\nfunc (p *OAuth2Provider) IntrospectToken(ctx context.Context, token string) (fosite.Session, error)\n```\nIntrospectToken validates an access token and returns the session\n\n```go\nfunc (p *OAuth2Provider) UpdateIssuer(issuer string)\n```\nUpdateIssuer updates the issuer URL in the configuration This is useful when using port 0 and getting the actual port after server start\n\n```go\ntype OAuth2ProviderOptions struct {\n\tDB                   *sql.DB\n\tIssuer               string\n\tAccessTokenLifespan  time.Duration\n\tRefreshTokenLifespan time.Duration\n\t// Sealer envelope-encrypts long-lived secrets in the DB (the\n\t// issuer's RSA private key, fosite's HMAC GlobalSecret). When\n\t// non-nil, the storage adapter pulls/pushes ciphertext + wrapped\n\t// DEK on the corresponding load/save calls. Nil = plaintext.\n\tSealer *seal.Sealer\n\n\t// CIMDEnabled turns on Client ID Metadata Document resolution: an https://\n\t// client_id is fetched and treated as a public client (see oauth2_cimd.go).\n\tCIMDEnabled bool\n\t// CIMDAllowedHosts optionally restricts which hosts a CIMD client_id may\n\t// point at; empty means any host (the SSRF guards still apply).\n\tCIMDAllowedHosts []string\n\n\t// TokenPath is the token endpoint's path on Issuer. Empty means\n\t// /mcp/oauth2/token, which every server serving MCP routes; a server\n\t// without MCP does not route it and must say where its token\n\t// endpoint is.\n\tTokenPath string\n}\n```\nOAuth2ProviderOptions configures lifespans and other tunables for the OAuth2 provider. Lifespans must be \u003e 0; callers are expected to validate or default before constructing. DB is the unified application database (see appdb); the provider does not own its lifecycle.\n\n```go\ntype OAuth2StateEntry struct {\n\tAuthorizeRequest fosite.AuthorizeRequester\n\tTimestamp        time.Time\n\tOriginalURL      string   // Original URL to redirect back to after authentication\n\tUsername         string   // Authenticated username for consent flow\n\tGroups           []string // User groups for scope filtering in consent flow\n\t// PlacementIdentity is the sign-in identity of a placementd-mapped\n\t// approver, recorded on the grant consent creates so its tokens are\n\t// bounded by what that identity holds. Empty for every other approver.\n\tPlacementIdentity string\n\t// BrowserBinding is the login-binding nonce held in a cookie by the\n\t// browser that started this login (see login_binding.go). The SSO\n\t// callback accepts the state only from a browser presenting it.\n\t// Empty for states that are not a round trip through the IdP.\n\tBrowserBinding string\n\t// contains filtered or unexported fields\n}\n```\nOAuth2StateEntry represents a stored OAuth2 authorization state\n\n```go\ntype OAuth2StateStore struct {\n\t// contains filtered or unexported fields\n}\n```\nOAuth2StateStore manages OAuth2 state parameters for the authorization flow\n\n```go\nfunc NewOAuth2StateStore() *OAuth2StateStore\n```\nNewOAuth2StateStore creates a new OAuth2 state store Call Start() to begin the cleanup goroutine\n\n```go\nfunc (s *OAuth2StateStore) GenerateState() (string, error)\n```\nGenerateState generates a secure random state parameter\n\n```go\nfunc (s *OAuth2StateStore) Get(state string) (fosite.AuthorizeRequester, bool)\n```\nGet retrieves and removes an authorize request for the given state\n\n```go\nfunc (s *OAuth2StateStore) GetWithURL(state string) (fosite.AuthorizeRequester, string, bool)\n```\nGetWithURL retrieves and removes an authorize request for the given state along with the original URL\n\n```go\nfunc (s *OAuth2StateStore) GetWithUsername(state string) (fosite.AuthorizeRequester, string, []string, bool)\n```\nGetWithUsername retrieves an authorize request for the given state along with username and groups (without removing)\n\n```go\nfunc (s *OAuth2StateStore) Len() int\n```\nLen returns the number of pending states.\n\n```go\nfunc (s *OAuth2StateStore) PlacementIdentity(state string) string\n```\nPlacementIdentity is the placementd identity stored for state's consent, or \"\".\n\n```go\nfunc (s *OAuth2StateStore) Remove(state string)\n```\nRemove removes an entry for the given state\n\n```go\nfunc (s *OAuth2StateStore) Start(ctx context.Context)\n```\nStart begins the cleanup goroutine\n\n```go\nfunc (s *OAuth2StateStore) Store(state string, ar fosite.AuthorizeRequester)\n```\nStore stores an authorize request with the given state\n\n```go\nfunc (s *OAuth2StateStore) StoreForBrowser(state string, ar fosite.AuthorizeRequester, originalURL, binding string)\n```\nStoreForBrowser stores the state of a login that leaves for the IdP and comes back through the SSO callback. binding is the nonce the starting browser was given; the callback requires it back.\n\n```go\nfunc (s *OAuth2StateStore) StoreForConsent(state string, ar fosite.AuthorizeRequester, username string, groups []string, placementIdentity string)\n```\nStoreForConsent is StoreWithUsername for an approver a placementd mapping signed in through placementIdentity (\"\" for any other approver).\n\n```go\nfunc (s *OAuth2StateStore) StoreWithURL(state string, ar fosite.AuthorizeRequester, originalURL string)\n```\nStoreWithURL stores an authorize request with the given state and original URL\n\n```go\nfunc (s *OAuth2StateStore) StoreWithUsername(state string, ar fosite.AuthorizeRequester, originalURL, username string, groups ...[]string)\n```\nStoreWithUsername stores an authorize request with the given state, original URL, and username\n\n```go\nfunc (s *OAuth2StateStore) Take(state string) (*OAuth2StateEntry, bool)\n```\nTake retrieves and removes the entry for state (one-time use).\n\n```go\nfunc (s *OAuth2StateStore) Wait()\n```\nWait waits for the cleanup goroutine to finish\n\n```go\ntype OAuth2Storage struct {\n\t// contains filtered or unexported fields\n}\n```\nOAuth2Storage implements fosite storage interfaces using the unified application database. The schema is owned by appdb's migrations — this struct is purely a thin set of query helpers around an already- migrated \\*sql.DB.\n\nThe optional \\`sealer\\` field is the application's envelope-encryption gate. When non-nil, SaveRSAKey / SaveHMACSecret store ciphertext + wrapped DEK; LoadRSAKey / LoadHMACSecret transparently decrypt rows whose DEK column is populated. When nil, the storage falls back to the pre-encryption plaintext behavior — back-compat for deployments that haven't configured a KEK yet.\n\n```go\nfunc NewOAuth2Storage(db *sql.DB) *OAuth2Storage\n```\nNewOAuth2Storage wraps an already-opened DB in the OAuth2 storage helpers. Schema creation is no longer this struct's responsibility — see httpserver/appdb. The caller retains ownership of the DB (don't call Close() here on shutdown).\n\nThe returned storage starts in plaintext mode; call SetSealer if a KEK has been loaded.\n\n```go\nfunc (s *OAuth2Storage) ApproveDeviceCodeSession(ctx context.Context, userCode string, subject string, session fosite.Session) error\n```\nApproveDeviceCodeSession approves a device code (user authorized the device)\n\n```go\nfunc (s *OAuth2Storage) ApproveDeviceCodeSessionWithScopes(ctx context.Context, userCode string, subject string, session fosite.Session, grantedScopes []string) error\n```\nApproveDeviceCodeSessionWithScopes is like ApproveDeviceCodeSession but also overrides the device code's granted\\_scopes column with the supplied subset. Use this when the consent UI showed the user per-scope checkboxes and the user declined some — the resulting access token must reflect the user-approved intersection, not the originally-requested set.\n\nPass nil grantedScopes to leave the existing granted\\_scopes untouched (equivalent to ApproveDeviceCodeSession). Pass an empty (non-nil) slice to record \"user explicitly approved zero scopes\" — useful as a sentinel; fosite will refuse to mint a token for a no-scope grant, but we want the audit log to show the user's choice.\n\n```go\nfunc (s *OAuth2Storage) ClientAssertionJWTValid(ctx context.Context, jti string) error\n```\nClientAssertionJWTValid implements fosite.ClientAssertionJWTValid interface This checks if a JWT ID (JTI) has already been used to prevent replay attacks\n\n```go\nfunc (s *OAuth2Storage) CreateAccessTokenSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreateAccessTokenSession stores an access token session\n\n```go\nfunc (s *OAuth2Storage) CreateAuthorizeCodeSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreateAuthorizeCodeSession stores an authorization code session\n\n```go\nfunc (s *OAuth2Storage) CreateClient(ctx context.Context, client *fosite.DefaultClient) error\n```\nCreateClient creates a new OAuth2 client\n\n```go\nfunc (s *OAuth2Storage) CreateDeviceCodeSession(ctx context.Context, deviceCode string, userCode string, request fosite.Requester, expiresAt time.Time) error\n```\nCreateDeviceCodeSession creates a new device code session. The device code is what the client presents to the token endpoint, so oauth2\\_device\\_codes.device\\_code stores its sessionKey, not the code; every query on that column hashes first.\n\n```go\nfunc (s *OAuth2Storage) CreateOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) error\n```\nCreateOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *OAuth2Storage) CreatePKCERequestSession(ctx context.Context, signature string, request fosite.Requester) error\n```\nCreatePKCERequestSession stores a PKCE request session\n\n```go\nfunc (s *OAuth2Storage) CreateRefreshTokenSession(ctx context.Context, signature string, _ string, request fosite.Requester) error\n```\nCreateRefreshTokenSession stores a refresh token session. As of fosite v0.49 the signature carries the associated access token signature; we key sessions off the refresh signature and revoke by request ID, so it is not stored.\n\n```go\nfunc (s *OAuth2Storage) DeleteAccessTokenSession(ctx context.Context, signature string) error\n```\nDeleteAccessTokenSession deletes an access token session\n\n```go\nfunc (s *OAuth2Storage) DeleteOpenIDConnectSession(ctx context.Context, signature string) error\n```\nDeleteOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *OAuth2Storage) DeletePKCERequestSession(ctx context.Context, signature string) error\n```\nDeletePKCERequestSession deletes a PKCE request session\n\n```go\nfunc (s *OAuth2Storage) DeleteRefreshTokenSession(ctx context.Context, signature string) error\n```\nDeleteRefreshTokenSession deletes a refresh token session\n\n```go\nfunc (s *OAuth2Storage) DenyDeviceCodeSession(ctx context.Context, userCode string) error\n```\nDenyDeviceCodeSession denies a device code (user rejected the device)\n\n```go\nfunc (s *OAuth2Storage) DeviceCodeIsPending(ctx context.Context, userCode string) bool\n```\nDeviceCodeIsPending reports whether a user code names a device code that is still waiting for a decision.\n\nA separate, deliberately narrow read rather than a status field on GetDeviceCodeSessionByUserCode, which several pages share: that lookup answers for a code in any state, and a consent surface that told its caller which state would be an oracle for walking the eight-character code space. This returns one bit and no error detail for exactly that reason -- \"not pending\" covers absent, expired, approved, denied and used alike.\n\n```go\nfunc (s *OAuth2Storage) EnsureGrantAuthorizedScopes(ctx context.Context, requestID string, scopes []string) error\n```\nEnsureGrantAuthorizedScopes records what a grant was authorized with, for grants that predate its being captured at consent.\n\nEvery grant in existence when that started being recorded has none, and without this the admin page reads the scopes in force as the whole authorization. Switching one off then shrinks the set it would restore from, so the scope cannot be put back -- the one-way door the toggle exists to remove, for exactly the grants an operator already had.\n\nCalled with the set in force BEFORE a change, which for a grant nobody has touched is what it was authorized with. A no-op once a value is present, so a later narrowing cannot overwrite the original.\n\nThe session is rewritten through a generic map rather than the Session type: decoding into Session and re-encoding would drop any field this build does not know about, and a token session carries the OIDC claims.\n\n```go\nfunc (s *OAuth2Storage) FindGrantBySignaturePrefix(ctx context.Context, kind, prefix string) (GrantRef, error)\n```\nFindGrantBySignaturePrefix resolves the fingerprint shown in the admin token listing back to the grant behind it.\n\nkind selects the table, because the listing shows access and refresh tokens together and their signatures live in different ones.\n\n```go\nfunc (s *OAuth2Storage) GetAccessTokenSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetAccessTokenSession retrieves an access token session\n\n```go\nfunc (s *OAuth2Storage) GetAuthorizeCodeSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetAuthorizeCodeSession retrieves an authorization code session\n\n```go\nfunc (s *OAuth2Storage) GetClient(ctx context.Context, clientID string) (fosite.Client, error)\n```\nGetClient retrieves a client by ID\n\n```go\nfunc (s *OAuth2Storage) GetDB() *sql.DB\n```\nGetDB returns the underlying database connection. Kept on the struct because tests and the SessionStore wiring still reach for it.\n\n```go\nfunc (s *OAuth2Storage) GetDeviceCodeSession(ctx context.Context, deviceCode string, session fosite.Session) (fosite.Requester, error)\n```\nGetDeviceCodeSession retrieves a device code session by device code\n\n```go\nfunc (s *OAuth2Storage) GetDeviceCodeSessionByUserCode(ctx context.Context, userCode string) (string, fosite.Requester, error)\n```\nGetDeviceCodeSessionByUserCode retrieves a device code session by user code. The string it returns is the stored key (sessionKey of the device code), not the device code itself.\n\n```go\nfunc (s *OAuth2Storage) GetOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) (fosite.Requester, error)\n```\nGetOpenIDConnectSession implements openid.OpenIDConnectRequestStorage interface\n\n```go\nfunc (s *OAuth2Storage) GetPKCERequestSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetPKCERequestSession retrieves a PKCE request session\n\n```go\nfunc (s *OAuth2Storage) GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (fosite.Requester, error)\n```\nGetRefreshTokenSession retrieves a refresh token session\n\n```go\nfunc (s *OAuth2Storage) GrantAuthorizedScopes(ctx context.Context, requestID string) ([]string, error)\n```\nGrantAuthorizedScopes reads what a grant's authorization ENDED with: the set an operator may restore it to.\n\nRead from the stored session rather than a column of its own, because that session is what fosite carries forward across every refresh -- a column would have to be re-derived on each new token row, and the set it has to preserve is the one from the ORIGINAL authorization, not from whatever the grant has been narrowed to since.\n\nA grant issued before this was recorded has none. Its current scopes are then the only defensible bound: the alternative is inventing an authorization nobody made.\n\n```go\nfunc (s *OAuth2Storage) GrantScopes(ctx context.Context, requestID string) ([]string, error)\n```\nGrantScopes reads the scopes currently granted under one grant.\n\nRead from the access token where there is one, falling back to the refresh token: the two carry the same granted set by construction, and a grant whose access token has expired still has a refresh token an operator may want to narrow.\n\n```go\nfunc (s *OAuth2Storage) InvalidateAuthorizeCodeSession(ctx context.Context, signature string) error\n```\nInvalidateAuthorizeCodeSession invalidates an authorization code\n\n```go\nfunc (s *OAuth2Storage) InvalidateDeviceCodeSession(ctx context.Context, deviceCode string) error\n```\nInvalidateDeviceCodeSession invalidates a device code after it's been used\n\n```go\nfunc (s *OAuth2Storage) LoadHMACSecret(ctx context.Context) ([]byte, error)\n```\nLoadHMACSecret loads the HMAC secret. See LoadRSAKey for the encryption-vs-plaintext branching.\n\n```go\nfunc (s *OAuth2Storage) LoadRSAKey(ctx context.Context) (string, error)\n```\nLoadRSAKey loads the RSA private key. Falls back to plaintext when the row's DEK column is NULL — that's the pre-encryption format and the format used when no KEK is configured. When a DEK is present but no sealer is configured (KEK was removed without rotating data), returns an explicit error rather than handing back ciphertext or silently regenerating the key.\n\n```go\nfunc (s *OAuth2Storage) MarkDeviceCodePolled(ctx context.Context, deviceCode string, now time.Time, minGap time.Duration) (bool, error)\n```\nMarkDeviceCodePolled records a poll of deviceCode at now, unless the previous recorded poll was less than minGap before it, and reports whether it did. One test-and-set, so two polls racing each other cannot both pass. A device code that does not exist reports true: the lookup that follows answers for it.\n\nTimes are compared with julianday rather than as text, since the driver writes each one in the zone it carries.\n\n```go\nfunc (s *OAuth2Storage) RevokeAccessToken(ctx context.Context, requestID string) error\n```\nRevokeAccessToken revokes an access token\n\n```go\nfunc (s *OAuth2Storage) RevokeAllForSubject(ctx context.Context, subject string) (int64, error)\n```\nRevokeAllForSubject deactivates every access and refresh token belonging to one subject, across all clients.\n\nThis is the operator's answer to \"this person is gone, cut them off now\". The refresh-time oracles handle the steady state, but they only fire when the user's client next shows up, and only when an oracle can see the removal at all; an admin needs a way to act immediately and unconditionally.\n\nIt returns the number of token rows deactivated. Rows are marked inactive rather than deleted so the admin token listing can still show what was revoked.\n\n```go\nfunc (s *OAuth2Storage) RevokeGrant(ctx context.Context, requestID string) (int64, error)\n```\nRevokeGrant deactivates every token issued under one grant -- the access token and the refresh token that came with it.\n\nRevoking only the access token would be theatre: a client holding the refresh token mints a new one within minutes, which is exactly the case an operator reaches for this to stop. Rows are deactivated rather than deleted, matching RevokeAllForSubject, so the listing can still show what was revoked.\n\n```go\nfunc (s *OAuth2Storage) RevokeRefreshToken(ctx context.Context, requestID string) error\n```\nRevokeRefreshToken revokes a refresh token\n\n```go\nfunc (s *OAuth2Storage) RevokeRefreshTokenMaybeGracePeriod(ctx context.Context, requestID string, _ string) error\n```\nRevokeRefreshTokenMaybeGracePeriod implements fosite.TokenRevocationStorage interface This handles refresh token revocation. The signature parameter allows for grace period implementation but for simplicity we immediately revoke the token by request ID\n\n```go\nfunc (s *OAuth2Storage) RotateRefreshToken(ctx context.Context, requestID string, _ string) error\n```\nRotateRefreshToken revokes the refresh token and its associated access token for the request, mirroring fosite's reference rotation semantics (required by the RefreshTokenStorage interface as of v0.49). The refresh token signature is unused because revocation is keyed by request ID.\n\n```go\nfunc (s *OAuth2Storage) SaveHMACSecret(ctx context.Context, secret []byte) error\n```\nSaveHMACSecret stores the HMAC secret. See SaveRSAKey for the encryption-vs-plaintext branching.\n\n```go\nfunc (s *OAuth2Storage) SaveRSAKey(ctx context.Context, privateKeyPEM string) error\n```\nSaveRSAKey stores the RSA private key. When a sealer is set the PEM bytes are encrypted under a fresh per-row DEK (itself wrapped by the DB-instance KEK); when no sealer is configured the PEM is written verbatim — same on-disk shape as the pre-KEK schema, kept for back-compat with deployments that haven't enabled encryption.\n\n```go\nfunc (s *OAuth2Storage) SetClientAssertionJWT(ctx context.Context, jti string, exp time.Time) error\n```\nSetClientAssertionJWT implements fosite.SetClientAssertionJWT interface This stores the JTI (JWT ID) with expiration to prevent replay attacks\n\n```go\nfunc (s *OAuth2Storage) SetGrantScopes(ctx context.Context, requestID string, scopes []string) (int64, error)\n```\nSetGrantScopes rewrites the granted scopes of every token issued under one grant.\n\nApplied to the whole grant for the same reason RevokeGrant is: narrowing only the access token would be undone at the next refresh, minutes later, by a client that still holds a refresh token carrying the old set. The operator reaching for this wants the narrowing to stick.\n\nOnly granted\\_scopes is rewritten. The \\`scopes\\` column records what was REQUESTED, which is a fact about a past request and not this server's to revise -- and reauthorizeRefreshGrant re-derives the allowed set from the granted one, so that is the column that decides what the token can do.\n\n```go\nfunc (s *OAuth2Storage) SetSealer(sealer *seal.Sealer)\n```\nSetSealer enables envelope encryption for the long-lived secret columns (RSA private key, HMAC secret). Calling with nil restores plaintext mode. Callers should set this once at startup, before SaveRSAKey / SaveHMACSecret have a chance to fire — the startup-backfill path in NewHandler does exactly that.\n\n```go\ntype PeekResponse struct {\n\tStdout *PeekedStreamResponse `json:\"stdout,omitempty\"`\n\tStderr *PeekedStreamResponse `json:\"stderr,omitempty\"`\n}\n```\nPeekResponse mirrors htcondor.PeekResult on the wire. Fields that weren't requested (or that the starter elected not to return) are omitted entirely so the SPA can detect \"stream wasn't transferred\" without inferring from a zero-length string.\n\n```go\ntype PeekedStreamResponse struct {\n\tText   string `json:\"text\"`\n\tOffset int64  `json:\"offset\"`\n}\n```\nPeekedStreamResponse is the JSON shape returned for one of the requested streams. \\`bytes\\` is the raw text the starter sent (the caller is responsible for handling NUL/binary content if it shows up — stdout/stderr are nearly always UTF-8). \\`offset\\` is the absolute file offset \\*after\\* this read; pass it back as \\`stdout\\_offset\\` / \\`stderr\\_offset\\` on the next call to follow.\n\n```go\ntype Picker struct {\n\tName      string `json:\"name\"`\n\tProvider  string `json:\"provider\"`\n\tConnector string `json:\"connector\"`\n\t// Service is the credential half of a file reference, so the page\n\t// can build \u003cservice\u003e+\u003cmethod\u003e://\u003cid\u003e/\u003cname\u003e without knowing how\n\t// that name is composed.\n\tService string `json:\"service\"`\n\tMethod  string `json:\"method\"`\n\t// Script is where to load the adapter from. This server's own by\n\t// default, which is why 'self' covers it; a test points it at a\n\t// stand-in so the page code under test is the page code that ships.\n\tScript string `json:\"script\"`\n\t// APIKey is the provider's developer key. Public by design -- it\n\t// lives in client-side JavaScript either way -- and not a secret\n\t// this server holds on anybody's behalf.\n\tAPIKey string `json:\"api_key,omitempty\"`\n\tAppID  string `json:\"app_id,omitempty\"`\n}\n```\nPicker is one chooser as the page sees it.\n\n```go\nfunc (p Picker) FileReference(fileID, name string) string\n```\nFileReference builds the submit-file reference for a chosen file.\n\nHere rather than in the page, so one place decides the spelling and the page cannot drift from what SplitSpoolInputs parses.\n\n```go\ntype PickerOrigins struct {\n\t// Script is where the chooser's own code is loaded from.\n\tScript []string\n\t// Frame is where it renders. A CSP with no frame-src falls back to\n\t// default-src, so an iframe to another origin is blocked without\n\t// this and the chooser appears as an empty box.\n\tFrame []string\n\t// Connect is what it calls.\n\tConnect []string\n\t// Img is where its thumbnails come from.\n\tImg []string\n}\n```\nPickerOrigins is the set of origins a connector's file chooser needs the Content-Security-Policy to allow.\n\nGoogle's Picker is not a library this server can host: it loads from apis.google.com, renders its chooser in a docs.google.com IFRAME, and talks to googleapis.com. The page's CSP is default-src 'self', so every one of those is refused by the browser unless named -- and this repository has already shipped a browser-side feature that was blocked in every real browser and silent about it (the site-apps update badge). So the directives are widened here, from the connector's own definition, and asserted in a test.\n\n```go\ntype PingResponse struct {\n\tDaemon         string `json:\"daemon\"`               // \"collector\" or \"schedd\"\n\tAuthMethod     string `json:\"auth_method\"`          // Authentication method used\n\tUser           string `json:\"user\"`                 // Authenticated username\n\tSessionID      string `json:\"session_id\"`           // Session identifier\n\tValidCommands  string `json:\"valid_commands\"`       // Commands authorized\n\tEncryption     bool   `json:\"encryption\"`           // Whether encryption is enabled\n\tAuthentication bool   `json:\"authentication\"`       // Whether authentication is enabled\n\tAuthorized     bool   `json:\"authorized,omitempty\"` // Whether authorized for requested permission (if permission checked)\n\tPermission     string `json:\"permission,omitempty\"` // Permission level checked (if any)\n}\n```\nPingResponse represents a ping response for a daemon\n\n```go\ntype PlacementAccountInfo struct {\n\t// Account is the AP user, user@domain, exactly as the placementd gave it.\n\tAccount string `json:\"account\"`\n\t// Authorizations are the account's grants as the placementd lists\n\t// them, including ones that are not HTCondor authorization levels.\n\tAuthorizations []string `json:\"authorizations,omitempty\"`\n\t// Projects are the projects the account may name; the first is the\n\t// default.\n\tProjects []string `json:\"projects,omitempty\"`\n\t// Project is the selected project, put in every minted token.\n\tProject string `json:\"project,omitempty\"`\n\t// MappingExpiresAt is when the placementd stops honoring the\n\t// identity; zero for never.\n\tMappingExpiresAt time.Time `json:\"mapping_expires_at,omitzero\"`\n\t// CheckedAt is when the account was last read from the placementd.\n\tCheckedAt time.Time `json:\"checked_at\"`\n}\n```\nPlacementAccountInfo is the placementd account behind a session or an OAuth2 grant.\n\n```go\nfunc (p *PlacementAccountInfo) Levels() []string\n```\nLevels are the HTCondor authorization levels among the account's grants.\n\n```go\ntype PlacementSessionInfo struct {\n\tIdentity    string `json:\"identity\"`\n\tDisplayName string `json:\"display_name,omitempty\"`\n\t// Account is set when the session signed in as the account the\n\t// placementd assigned to Identity (HTTP_API_IDENTITY_MAP =\n\t// placementd): the account, the permissions on jobs it holds, its\n\t// projects and the one tokens are minted for.\n\tAccount  string   `json:\"account,omitempty\"`\n\tLevels   []string `json:\"levels,omitempty\"`\n\tProjects []string `json:\"projects,omitempty\"`\n\tProject  string   `json:\"project,omitempty\"`\n}\n```\nPlacementSessionInfo is the placement identity of a session.\n\n```go\ntype ReauthDecision struct {\n\t// Status is the verdict on the user as a whole.\n\tStatus UserStatus\n\t// Reason is a short operator-facing explanation, surfaced in logs and\n\t// (for revocations) in the OAuth2 error description. HTCondor's\n\t// per-user records carry a DisableReason string that lands here.\n\tReason string\n\t// DeniedScopes are scopes the oracle says this user may no longer\n\t// hold, even when Status is Active. They are removed from the\n\t// refreshed grant rather than failing it, so a user who loses write\n\t// access keeps working read-only instead of being logged out.\n\tDeniedScopes []string\n}\n```\nReauthDecision is what a RevocationOracle reports about one user.\n\n```go\ntype RecentJob struct {\n\tClusterID int64  `json:\"cluster_id\"`\n\tProcID    int64  `json:\"proc_id\"`\n\tOwner     string `json:\"owner,omitempty\"`\n\t// Schedd and JobID name the job's access point and its complete id,\n\t// in multi-AP mode.\n\tSchedd string `json:\"schedd,omitempty\"`\n\tJobID  string `json:\"job_id,omitempty\"`\n\t// At is when the event this list is about happened, unix seconds.\n\tAt int64 `json:\"at\"`\n\t// Detail is the one fact worth showing beside it: a hold reason, the\n\t// executable, the host it started on.\n\tDetail string `json:\"detail,omitempty\"`\n\t// Archived says this row came from the history archive rather than\n\t// the live queue, which decides where a click on it should go. The\n\t// queue destroys a finished job within seconds, so most completions\n\t// shown here no longer have a job page -- linking them all to one\n\t// sent people to \"not found\".\n\tArchived bool `json:\"archived,omitempty\"`\n}\n```\nRecentJob is one entry in a recent-activity list.\n\n```go\ntype RevocationOracle interface {\n\t// Name identifies the oracle in log lines.\n\tName() string\n\t// Check reports on username, which is the grant's subject. scopes is\n\t// the set currently granted, so an oracle can skip work for scopes\n\t// nobody holds.\n\tCheck(ctx context.Context, username string, scopes []string) (ReauthDecision, error)\n}\n```\nRevocationOracle answers \"is this user still entitled to what they were granted?\" at refresh time.\n\nImplementations must fail OPEN: a backend that is unreachable, slow, or simply has no record of the user returns UserStatusUnknown, never UserStatusRevoked. A refresh endpoint that hard-denies whenever a dependency hiccups is an outage amplifier, and the absolute grant lifetime cap is what bounds exposure when every oracle is silent.\n\n```go\ntype SSHGatewayLockoutConfig struct {\n\t// Threshold and NetThreshold are the failure budgets for one host\n\t// and for the network around it. Zero means the package default.\n\tThreshold    int\n\tNetThreshold int\n\n\t// Window is how long failures are remembered, BanTime how long\n\t// the first lockout lasts, and MaxBanTime the ceiling the\n\t// doubling stops at. Zero means the package default.\n\tWindow     time.Duration\n\tBanTime    time.Duration\n\tMaxBanTime time.Duration\n\n\t// TrustedNetworks are addresses and CIDR blocks that are never\n\t// counted and never locked out.\n\tTrustedNetworks []string\n\n\t// Disabled turns the lockout off entirely.\n\tDisabled bool\n}\n```\nSSHGatewayLockoutConfig configures the gateway's fail2ban-style lockout: how many failed logins a source may accumulate before new connections from it are refused, and for how long.\n\nThe zero value is the enabled default. Only Disabled turns it off, so a deployment that says nothing gets the protection.\n\n```go\ntype ScheddACLOracle struct {\n\tSchedd    func() *htcondor.Schedd\n\tUIDDomain string\n\tLogger    *logging.Logger\n\t// MintToken produces an HTCondor IDTOKEN asserting username, used as\n\t// the probe credential. The scopes argument is passed through to the\n\t// handler's minter; Check asks for every level it probes (see Check\n\t// for why). ctx is Check's, which carries the sign-in identity of the\n\t// grant being checked, if any (withGrantIdentityContext).\n\tMintToken func(ctx context.Context, username string, scopes []string) (string, error)\n\t// Config is the HTCondor configuration the probe's security config is\n\t// built from; nil is the process-wide default.\n\tConfig *config.Config\n\t// Sessions holds the probe's cedar session caches. Nil gives each\n\t// probe a fresh cache; it never uses the process-global one.\n\tSessions *TokenCache\n}\n```\nScheddACLOracle strips scopes whose HTCondor authorization level the schedd would refuse for this user, by running a DC\\_SEC\\_QUERY probe — the same question condor\\_ping asks.\n\nIt is the weaker of the two oracles and is deliberately scoped to narrowing rather than revoking. Two reasons:\n\n  - It cannot see identity at all. The MCP server mints the IDTOKEN it probes with, so the schedd is being asked \"do your ACLs admit this name\", not \"does this person still exist\". A deleted user whose name still matches ALLOW\\_WRITE passes.\n  - ALLOW\\_WRITE is \\`\\*@uid\\_domain\\` in many pools, in which case the probe tells you nothing about any individual.\n\nWhat it does catch is a pool that genuinely enumerates users in its ACLs, where removing someone from ALLOW\\_WRITE should stop their write access without waiting for the grant's lifetime cap.\n\n```go\nfunc (o *ScheddACLOracle) Check(ctx context.Context, username string, scopes []string) (ReauthDecision, error)\n```\nCheck implements RevocationOracle.\n\nIt probes only the levels the user actually holds: a grant with no write scope never asks about WRITE. The verdict is always Active — this oracle answers a question about permissions, not about the person — with denied scopes listed for whatever the schedd refuses.\n\n```go\nfunc (o *ScheddACLOracle) Name() string\n```\nName implements RevocationOracle.\n\n```go\ntype Server struct {\n\t*Handler // Embedded handler for business logic\n\t// contains filtered or unexported fields\n}\n```\nServer represents the HTTP API server\n\n```go\nfunc NewServer(cfg Config) (*Server, error)\n```\nNewServer creates a new HTTP API server\n\n```go\nfunc (s *Server) GetAddr() string\n```\nGetAddr returns the actual listening address of the server. Returns empty string if the server hasn't started yet.\n\n```go\nfunc (s *Server) ServeAdditionalListener(ln net.Listener, certFile, keyFile string) error\n```\nServeAdditionalListener serves the already-running server on a second listener.\n\nUnder condor\\_master the daemon is handed a socket -- a shared-port endpoint or a pre-created command socket -- and that is what carries CEDAR commands. An operator who also wants the web UI on a port of their choosing, 443 being the one people ask for, needs both at once: the master's socket for the pool, and a directly dialable port for browsers. The master cannot be told to hand down 443, so this process has to bind it itself.\n\nThe handler is started by ServeListenerWithCert and must not be started again -- doing so would register every route a second time and start a second copy of each background goroutine. This only feeds another listener into the same server, so call it after the primary one is serving.\n\n```go\nfunc (s *Server) ServeListener(ln net.Listener, scheme string) error\n```\nServeListener runs the API server on a caller-supplied net.Listener. scheme controls which protocol the request URLs are advertised under (\"http\" or \"https\") — use \"https\" if the caller has configured httpServer.TLSConfig, \"http\" otherwise.\n\nThis is the entry point used when condor\\_master spawns us as a managed daemon and we accept forwarded connections from condor\\_shared\\_port via a sharedport.Listener instead of binding our own TCP port. The handler bootstrap (issuer URL, OAuth2 setup) is the same as Start/StartTLS; the only difference is the kind of listener we hand to http.Server.Serve.\n\n```go\nfunc (s *Server) ServeListenerWithCert(ln net.Listener, certFile, keyFile string) error\n```\nServeListenerWithCert is the listener-injecting analog of Start/StartTLS used by the daemon framework, which supplies the (shared-port or TCP) listener: it runs the handler then serves on ln, terminating TLS from certFile/keyFile when both are set (https) or speaking plain HTTP otherwise. It returns http.ErrServerClosed after Shutdown, like the standard library.\n\n```go\nfunc (s *Server) ServeMCPListener(ln net.Listener, certFile, keyFile string) error\n```\nServeMCPListener serves only the MCP surface on its own listener.\n\nA second http.Server rather than another listener on the first: the two ports deliberately expose different things, and that difference is the whole point of asking for a separate port. The handler is the same one, fronted by a filter.\n\nThe handler is started by ServeListenerWithCert and must not be started again, so call this after the primary listener is serving. Shutdown closes both.\n\n```go\nfunc (s *Server) Shutdown(ctx context.Context) error\n```\nShutdown gracefully shuts down the HTTP server\n\n```go\nfunc (s *Server) Start() error\n```\nStart starts the HTTP server\n\n```go\nfunc (s *Server) StartTLS(certFile, keyFile string) error\n```\nStartTLS starts the HTTPS server with TLS\n\n```go\ntype Session struct {\n\t*openid.DefaultSession\n\n\t// Groups is the group list asserted by the upstream IDP (or the\n\t// browser session) at the time consent was granted.\n\tGroups []string `json:\"groups,omitempty\"`\n\n\t// AuthTime is when the user authenticated and consented, in UTC.\n\t// It is deliberately NOT refreshed when the grant is refreshed.\n\tAuthTime time.Time `json:\"authTime,omitempty\"`\n\n\t// LastUsed is when a token was last minted from this grant, in UTC.\n\t// It is the point the idle cap is measured from, and unlike AuthTime\n\t// it IS advanced on every refresh -- see reauthorizeGrant.\n\t//\n\t// Zero means no refresh has been recorded, which is the state of a\n\t// freshly consented grant and of every session written before this\n\t// field existed. Both fall back to AuthTime, so a grant always has\n\t// one clock even when it does not have this one.\n\tLastUsed time.Time `json:\"lastUsed,omitempty\"`\n\n\t// AuthorizedScopes is what this authorization ENDED with: the set the\n\t// policy allowed and the user did not untick, recorded once at\n\t// consent and carried unchanged across every refresh.\n\t//\n\t// It is the bound on what an operator may re-enable from the admin\n\t// page. GrantedScope is the set in force now, which an operator may\n\t// have narrowed; this is the set that narrowing started from, so\n\t// putting one back is restoring something this user already agreed\n\t// to rather than granting something new. A scope the user unticked at\n\t// consent never appears here, so no operator can undo that choice.\n\tAuthorizedScopes []string `json:\"authorizedScopes,omitempty\"`\n\n\t// Actor names the client that obtained this token by RFC 8693 token\n\t// exchange on the subject's behalf (delegation): the token acts AS Subject\n\t// but was minted FOR this actor. Empty for tokens obtained directly. It is\n\t// the `act.sub` an exchanged token records, and is surfaced for audit and\n\t// on the HTCondor IDTOKEN minted downstream.\n\tActor string `json:\"actor,omitempty\"`\n\n\t// ParentGrant is the request id of the grant whose access token was\n\t// exchanged for this one. An exchanged token is only as good as that\n\t// grant: storage reports it inactive once no live token remains under\n\t// ParentGrant, and never grants it a scope the parent no longer holds\n\t// (see OAuth2Storage.parentGrantScopes). Empty for tokens obtained\n\t// directly and for those exchanged from an external issuer's token.\n\tParentGrant string `json:\"parentGrant,omitempty\"`\n\n\t// PlacementIdentity is the sign-in identity that approved the grant:\n\t// for a grant holding the placement scope, the identity the placement\n\t// endpoints act for, and only for; for any other grant a placementd-\n\t// mapped session approved, the identity whose bound on the account\n\t// every token minted for the grant stays within. It is never taken\n\t// from a request.\n\tPlacementIdentity string `json:\"placementIdentity,omitempty\"`\n}\n```\nSession is the fosite session persisted for every grant this server issues, for both the MCP OAuth2 provider and the built-in IDP.\n\nIt exists to carry the \\*inputs\\* of the authorization decision alongside its output, so that a refresh grant can recompute the decision instead of replaying it. fosite's refresh pipeline rebuilds a request by cloning the stored session and re-granting whatever scopes the original grant carried (see handler/oauth2/flow\\_refresh.go), so anything the refresh path needs has to survive that round trip. Two fields do that work:\n\n  - Groups: the IDP-asserted group memberships that produced the granted scopes at consent time. They are read once from the userinfo endpoint and otherwise dropped on the floor, so without persisting them here the refresh path cannot re-run getScopesForGroups at all. Note this is a snapshot, not a live reading — see reauthorizeRefreshGrant for what that does and does not catch.\n  - AuthTime: when the human actually authenticated and consented, and LastUsed: when a token was last minted from the grant. Every refresh resets the refresh token's own expiry, so without a clock of our own a grant that keeps refreshing never ends; LastUsed is the one the idle cap is measured from, and AuthTime is what it falls back to.\n\nBoth are advisory inputs to reauthorizeRefreshGrant; nothing else reads them, and a session that predates this type (deserialized from a row written by an older build) simply has them zero-valued. See reauthorizeRefreshGrant for how that case is handled.\n\n```go\nfunc DefaultIDPSession(username string) *Session\n```\nDefaultIDPSession creates a default OpenID Connect session for the IDP. See DefaultOpenIDConnectSession for why this returns \\*Session.\n\n```go\nfunc DefaultOpenIDConnectSession(username string) *Session\n```\nDefaultOpenIDConnectSession creates a default OpenID Connect session.\n\nThe concrete type is \\*Session, not \\*openid.DefaultSession: grants issued by this server must carry the group list and auth time that reauthorizeRefreshGrant re-checks when the grant is later refreshed.\n\n```go\nfunc (s *Session) Clone() fosite.Session\n```\nClone deep-copies the session, including the fields declared above.\n\nThis override is load-bearing; do not delete it. openid.DefaultSession has its own Clone that reflection-copies its receiver, and if that method were left to promote through the embedded pointer it would return a bare \\*openid.DefaultSession and silently drop Groups, AuthTime and LastUsed. fosite's refresh handler rebuilds every refreshed request via originalRequest.GetSession().Clone(), so a promoted Clone would erase exactly the data the refresh path exists to consult — and erase it quietly, because the result still satisfies fosite.Session and a missing group list is indistinguishable from \"this user has no groups\".\n\nTestSessionClonedeepPreservesFields guards this.\n\n```go\nfunc (s *Session) WithAuthorizedScopes(scopes []string) *Session\n```\nWithAuthorizedScopes records what this authorization ended with, which is the bound on what an operator may later re-enable. See AuthorizedScopes.\n\nCalled at every site that grants scopes, so that a grant made through a path which forgets is visible as a grant nothing can be restored to, rather than one an operator can quietly widen.\n\n```go\nfunc (s *Session) WithGroups(groups []string) *Session\n```\nWithGroups records the group memberships that authorized this grant and returns the session, for chaining at the consent call sites.\n\n```go\ntype SessionData struct {\n\tUsername  string    // Authenticated username\n\tGroups    []string  // User groups from IDP (for scope filtering)\n\tCreatedAt time.Time // When the session was created\n\tExpiresAt time.Time // When the session expires\n\t// PlacementIdentity is the identity this session presents to\n\t// condor_placementd, derived from the provider's claims at login\n\t// (placement_identity.go). Empty when none could be derived. It is\n\t// the ONLY identity the user-facing placement endpoints ever send.\n\tPlacementIdentity string\n\t// DisplayName is what the provider called the person, for greeting.\n\tDisplayName string\n\t// Email is the address the provider gave at sign-in, kept for a\n\t// session with a placement identity: it goes on an access request,\n\t// for the administrators deciding it.\n\tEmail string\n\t// Scope is sessionScopeFull for an ordinary session, or\n\t// sessionScopePlacement for one whose person maps to no local\n\t// account. A placement session has an empty Username and reaches only\n\t// the placement onboarding pages; see placement_session_gate.go.\n\tScope string\n\t// IdentitySource is identitySourcePlacementd when the session's\n\t// HTCondor identity is the account condor_placementd assigned to\n\t// PlacementIdentity (HTTP_API_IDENTITY_MAP = placementd). Username is\n\t// then that account, verbatim, and Placement describes it.\n\tIdentitySource string\n\t// Placement is the placementd account behind the session, for\n\t// IdentitySource == identitySourcePlacementd; nil otherwise.\n\tPlacement *PlacementAccountInfo\n\t// IDPSubject is the provider's subject for the sign-in, kept on a\n\t// placement-only session so the sign-in's identity mapping can be\n\t// re-run for it (placement_session_upgrade.go). Empty on other\n\t// sessions.\n\tIDPSubject string\n}\n```\nSessionData represents the data stored in a session.\n\nNote: this struct used to carry a Token field that was reserved for per-session HTCondor token storage. The column was never written to and the field is gone — the schema migration in 0002\\_envelope\\_encryption.sql drops \\`http\\_sessions.token\\` to remove the unused secret-shaped column. Per-user tokens, when needed, flow through the OAuth2 / IDP storage tables instead.\n\n```go\nfunc (sd *SessionData) IsPlacementOnly() bool\n```\nIsPlacementOnly reports whether the session is restricted to placement onboarding.\n\n```go\nfunc (sd *SessionData) IsPlacementd() bool\n```\nIsPlacementd reports whether the session's HTCondor identity came from condor\\_placementd.\n\n```go\ntype SessionStore struct {\n\t// contains filtered or unexported fields\n}\n```\nSessionStore manages HTTP sessions with SQLite persistence\n\n```go\nfunc NewSessionStore(db *sql.DB, ttl time.Duration) (*SessionStore, error)\n```\nNewSessionStore creates a new session store with database persistence The db parameter should be the same database connection used by OAuth2Storage\n\n```go\nfunc (s *SessionStore) Cleanup()\n```\nCleanup removes expired sessions\n\n```go\nfunc (s *SessionStore) Create(username string, groups ...[]string) (string, *SessionData, error)\n```\nCreate creates a new session for the given username and groups\n\n```go\nfunc (s *SessionStore) CreateSession(data SessionData) (string, *SessionData, error)\n```\nCreateSession stores a new session carrying data's Username, Groups, PlacementIdentity, DisplayName, Email, Scope and IDPSubject; the times are set here. A non-zero data.ExpiresAt caps the expiry. A placement-only session must have no Username: it is not a local user, and nothing may mistake it for one.\n\n```go\nfunc (s *SessionStore) Delete(sessionID string)\n```\nDelete removes a session\n\n```go\nfunc (s *SessionStore) Get(sessionID string) *SessionData\n```\nGet retrieves a session by ID Returns nil if session doesn't exist or has expired\n\n```go\nfunc (s *SessionStore) Rotate(oldID string, data SessionData) (string, *SessionData, error)\n```\nRotate replaces the placement-only session oldID with a new session carrying data, under a new id: the new row is stored and the old one deleted in one transaction, so exactly one of them exists afterwards. It fails, storing nothing, when oldID is not a placement-only session -- including when a concurrent Rotate already replaced it.\n\n```go\nfunc (s *SessionStore) Size() int\n```\nSize returns the number of active sessions\n\n```go\nfunc (s *SessionStore) UpdatePlacement(sessionID string, info *PlacementAccountInfo, expiresAt time.Time) error\n```\nUpdatePlacement stores a placementd session's re-read account and its expiry. The caller never moves the expiry later than it was.\n\n```go\ntype ShareInputResponse struct {\n\tClusterID      int                `json:\"cluster_id\"`\n\tOwner          string             `json:\"owner\"`\n\tExpiresAt      time.Time          `json:\"expires_at\"`\n\tTTLSeconds     int                `json:\"ttl_seconds\"`\n\tCount          int                `json:\"count\"`\n\tProcsRemaining int                `json:\"procs_remaining,omitempty\"`\n\tUploads        []ShareInputUpload `json:\"uploads\"`\n\tNote           string             `json:\"note,omitempty\"`\n}\n```\nShareInputResponse is what a mint call returns. Always a list, even for a single proc: HTCondor spools per proc, so \"the upload URL for this submission\" is inherently plural, and one shape is easier to consume than a response that changes with the request.\n\nOwner and the expiry are shared by every URL in one response; only the URL and its allow-set vary per proc.\n\n```go\ntype ShareInputUpload struct {\n\tJobID         string   `json:\"job_id\"`\n\tURL           string   `json:\"url\"`\n\tExpectedFiles []string `json:\"expected_files\"`\n}\n```\nShareInputUpload is one job's upload URL.\n\nExpectedFiles is the load-bearing field: the schedd accepts only the names in a job's allow-set and drops the rest of the tar in silence, and whoever redeems this URL is often not the person who wrote the submit file. Without the list they have no way to learn which names are expected until the job fails at execute time on a missing file. It is per-proc because the allow-set is: procs of one cluster can list different inputs.\n\n```go\ntype ShareOutputRequest struct {\n\tTTLSeconds int `json:\"ttl_seconds,omitempty\"`\n}\n```\nShareOutputRequest is the body for POST /api/v1/jobs/{id}/output/share.\n\n```go\ntype ShareOutputResponse struct {\n\tURL        string    `json:\"url\"`\n\tExpiresAt  time.Time `json:\"expires_at\"`\n\tTTLSeconds int       `json:\"ttl_seconds\"`\n\tOwner      string    `json:\"owner\"`\n}\n```\nShareOutputResponse is what the SPA gets back. Owner is echoed for UX so the share preview can label the URL with \"downloads as \\\u003cowner\u003e\".\n\n```go\ntype ShareWatchRequest struct {\n\tTTLSeconds int `json:\"ttl_seconds,omitempty\"`\n}\n```\nShareWatchRequest is the body for POST /api/v1/watches/{id}/share.\n\n```go\ntype ShareWatchResponse struct {\n\tURL        string    `json:\"url\"`\n\tWatchID    string    `json:\"watch_id\"`\n\tOwner      string    `json:\"owner\"`\n\tExpiresAt  time.Time `json:\"expires_at\"`\n\tTTLSeconds int       `json:\"ttl_seconds\"`\n\t// MaxWaitSeconds is what the redeem endpoint will block for, so a\n\t// poller can size its own client timeout from the answer rather than\n\t// from a number hard-coded on its side.\n\tMaxWaitSeconds     int `json:\"max_wait_seconds\"`\n\tDefaultWaitSeconds int `json:\"default_wait_seconds\"`\n}\n```\nShareWatchResponse is what a mint call returns.\n\n```go\ntype SharedInputResult struct {\n\tMessage       string   `json:\"message\"`\n\tJobID         string   `json:\"job_id\"`\n\tExpectedFiles []string `json:\"expected_files\"`\n\tIgnoredFiles  []string `json:\"ignored_files,omitempty\"`\n\tWarning       string   `json:\"warning,omitempty\"`\n}\n```\nSharedInputResult is what a redeemed upload returns. Unexpected names the schedd dropped are reported rather than swallowed -- see ShareInputResponse.ExpectedFiles.\n\n```go\ntype SimilarJob struct {\n\tID        string  `json:\"id\"`\n\tCluster   int64   `json:\"cluster\"`\n\tProc      int64   `json:\"proc\"`\n\tSubmitted *int64  `json:\"submitted\"`\n\tCompleted int64   `json:\"completed\"`\n\tRuntime   float64 `json:\"runtime\"`\n\tExitCode  int     `json:\"exit_code\"`\n\t// PeakMemoryMiB is the most memory it used, as the estimator reads\n\t// it (runtimeest.PeakMemoryMiB); null when the record has none.\n\tPeakMemoryMiB *float64 `json:\"peak_memory_mib\"`\n}\n```\nSimilarJob is one finished job in the group.\n\n```go\ntype SimilarJobsResponse struct {\n\tJobID         string                     `json:\"job_id\"`\n\tLevel         string                     `json:\"level\"`\n\tDescription   string                     `json:\"description\"`\n\tEstimateLevel *string                    `json:\"estimate_level\"`\n\tLevels        []SimilarLevel             `json:\"levels\"`\n\tWindow        SimilarWindow              `json:\"window\"`\n\tRuntimes      *runtimeest.RuntimeSummary `json:\"runtimes\"`\n\tMemory        *runtimeest.MemorySummary  `json:\"memory\"`\n\tTotal         int                        `json:\"total\"`\n\tOffset        int                        `json:\"offset\"`\n\tNextOffset    *int                       `json:\"next_offset\"`\n\tJobs          []SimilarJob               `json:\"jobs\"`\n}\n```\nSimilarJobsResponse is GET /api/v1/jobs/{id}/similar.\n\n```go\ntype SimilarLevel struct {\n\tLevel       string `json:\"level\"`\n\tDescription string `json:\"description\"`\n\tApplies     bool   `json:\"applies\"`\n\tCount       *int   `json:\"count\"`\n}\n```\nSimilarLevel is one level a job can be grouped at.\n\n```go\ntype SimilarWindow struct {\n\tDays    float64 `json:\"days\"`\n\tMaxJobs int     `json:\"max_jobs\"`\n}\n```\nSimilarWindow is the estimator's recency window and sample bound.\n\n```go\ntype SiteAppSummary struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tURL  string `json:\"url\"`\n\t// Home reports that members land here instead of the dashboard.\n\t// More than one app may say so for the same caller, which is a\n\t// supported state and the reason the switcher exists.\n\tHome        bool   `json:\"home,omitempty\"`\n\tDescription string `json:\"description,omitempty\"`\n\tIcon        string `json:\"icon,omitempty\"`\n}\n```\nSiteAppSummary is one app as /api/v1/auth/me reports it.\n\n```go\ntype SuperuserModeRequest struct {\n\tEnabled bool `json:\"enabled\"`\n}\n```\nSuperuserModeRequest toggles superuser mode for the calling session.\n\n```go\ntype SuperuserModeResponse struct {\n\tActive    bool       `json:\"active\"`\n\tExpiresAt *time.Time `json:\"expires_at,omitempty\"`\n\t// Identity is what the server will authenticate to the schedd as while\n\t// the mode is on, and ActorIsQueueSuperUser whether that is the caller\n\t// themselves. Surfaced because the two differ in how well the action\n\t// can be attributed: as themselves, the schedd records the human; via\n\t// the shared account, only this server and the job's reason string do.\n\tIdentity              string `json:\"identity,omitempty\"`\n\tActorIsQueueSuperUser bool   `json:\"actor_is_queue_superuser,omitempty\"`\n\t// Note explains a fallback when one happened, including how to fix it.\n\t// Empty when the operator is acting as themselves.\n\tNote string `json:\"note,omitempty\"`\n\t// Scope is \"global\" or \"project\"; Projects lists the projects a\n\t// project-scoped session may act in.\n\tScope    string   `json:\"scope,omitempty\"`\n\tProjects []string `json:\"projects,omitempty\"`\n}\n```\nSuperuserModeResponse reports the resulting state.\n\n```go\ntype TokenCache struct {\n\t// contains filtered or unexported fields\n}\n```\nTokenCache manages validated tokens and their associated session caches.\n\nBounded: at most maxEntries, with entries nobody has verified evicted first (least recently used) and kept at most tokenCacheUnvalidatedResidency. A flood of unverified bearers therefore displaces other unverified bearers -- each of which just re-handshakes -- and not a verified one.\n\n```go\nfunc NewTokenCache() *TokenCache\n```\nNewTokenCache creates a new token cache that accepts a token from any issuer.\n\n```go\nfunc (tc *TokenCache) Add(token string) (*TokenCacheEntry, error)\n```\nAdd caches a token, with a session cache of its own, without validating it. If the token is already cached, returns the existing entry.\n\n```go\nfunc (tc *TokenCache) AddValidated(token, username string, expiration time.Time) (*TokenCacheEntry, error)\n```\nAddValidated adds a pre-validated token (e.g. opaque token) to the cache\n\n```go\nfunc (tc *TokenCache) Get(token string) (*TokenCacheEntry, bool)\n```\nGet retrieves a token cache entry if it exists and is not expired\n\n```go\nfunc (tc *TokenCache) MarkValidated(token, authoritativeUsername string)\n```\nMarkValidated promotes a cached token to \"validated\" status, with authoritativeUsername (if non-empty) replacing the JWT-claimed username.\n\nThe only acceptable evidence is an identity a CEDAR handshake reported for a connection that authenticated with this token. A successful HTTP response is not evidence: plenty of endpoints answer 2xx without ever presenting the token to a daemon.\n\nIdempotent: safe to call repeatedly per request.\n\n```go\nfunc (tc *TokenCache) Remove(token string)\n```\nRemove removes a token from the cache\n\n```go\nfunc (tc *TokenCache) SetCondorCredential(token, credential string, scopes []string)\n```\nSetCondorCredential records the credential and scopes resolved for a bearer, so later requests for it do not have to resolve them again -- and, more to the point, do not proceed without them. The bearer is recorded as scoped whatever scopes says, empty included.\n\n```go\nfunc (tc *TokenCache) Size() int\n```\nSize returns the number of cached tokens that have not expired\n\n```go\nfunc (tc *TokenCache) ValidatedUsername(token string) string\n```\nValidatedUsername returns the username for a token only if it has been validated (see TokenCacheEntry.Validated). Use this in code paths that must rely on authoritative identity (job-owner filtering, share-URL minting, audit logs). For loose use cases (rate-limit bucket key) the Get-and-read-Username pattern is fine.\n\nReturns \"\" if the token is unknown, expired, or not yet validated.\n\n```go\ntype TokenCacheEntry struct {\n\tToken     string\n\tUsername  string // sub from the JWT — unverified until Validated == true\n\tValidated bool   // true once the identity was established other than from the token's claims\n\n\t// CondorCredential is what CEDAR should authenticate with for this\n\t// bearer, when that is not the bearer itself.\n\t//\n\t// An opaque access token this server issued carries no signature\n\t// the schedd knows, so one is minted from it. Minting happens once,\n\t// on the request that first sees the token; without somewhere to\n\t// keep the result, every later request for the same bearer hands\n\t// CEDAR the opaque string instead -- which it cannot use, and which\n\t// leaves it to fall through to whatever credential the daemon\n\t// itself has.\n\t//\n\t// Empty for a bearer that is already a credential HTCondor can\n\t// verify, where the bearer is used directly.\n\tCondorCredential string\n\n\t// Scopes are the scopes the grant behind this bearer carries, for\n\t// the handlers that gate on them. Kept here for the same reason as\n\t// CondorCredential: they are resolved once, and a later request\n\t// that could not see them would read an approved-for-less grant as\n\t// carrying no restriction at all.\n\tScopes []string\n\t// Scoped is whether the bearer is a scoped credential at all, which\n\t// Scopes cannot say by itself: a grant approved for nothing has no\n\t// scopes, and is still not a bearer with no scope model.\n\tScoped bool\n\n\tExpiration   time.Time\n\tSessionCache *security.SessionCache\n\t// contains filtered or unexported fields\n}\n```\nTokenCacheEntry represents a cached token with its expiration and associated session cache.\n\nIdentity-trust note: Username is parsed from the JWT WITHOUT verifying the signature (we have no local way to verify — the only authoritative validator is the schedd's CEDAR handshake, which happens later when we make a schedd call). Until that handshake succeeds, the Username reflects whatever the client put in the token's \\`sub\\` claim and MUST NOT be used as authoritative identity (e.g. for filtering jobs to \"owned by me\", recording the Owner when minting a share URL, or any other authorization decision).\n\nValidated reports whether the identity has been established by something other than the token's own claims: this server verified the bearer itself (AddValidated), or a CEDAR handshake reported who it is (MarkValidated). Code paths that need authoritative identity should gate on Validated; code paths that only need a stable bucket key (rate-limit per-token / per-username) can use Username directly.\n\n```go\ntype UpstreamRefreshMode string\n```\nUpstreamRefreshMode decides whether that credential is kept and used.\n\n```go\nconst (\n\t// UpstreamRefreshAuto asks the provider for offline_access, then\n\t// keeps and uses the credential when it hands one over and does\n\t// nothing when it does not.\n\t//\n\t// The default, because without the request there is nothing to keep:\n\t// a provider releases a refresh token only to a client that asked,\n\t// so a mode that would store one but never asks is a mode that never\n\t// stores one. Whether the request is granted stays the provider's\n\t// decision and not every one will grant it.\n\t//\n\t// Asking can itself be refused -- a provider that approves scopes per\n\t// client may reject the whole authorization over a scope the client\n\t// does not hold. That is recoverable rather than fatal: the first\n\t// such refusal is absorbed and every sign-in after it asks without\n\t// the scope. See dropOfflineAccessAndRetry in oauth2_sso.go. A\n\t// deployment that would rather not ask at all sets off.\n\tUpstreamRefreshAuto UpstreamRefreshMode = \"auto\"\n\n\t// UpstreamRefreshOn is auto plus a complaint: a provider that returns\n\t// no refresh token is a misconfiguration the operator asked to hear\n\t// about, rather than a silent fallback to never checking.\n\tUpstreamRefreshOn UpstreamRefreshMode = \"on\"\n\n\t// UpstreamRefreshOff neither asks for offline_access nor stores the\n\t// credential. For a deployment that would rather not hold one at\n\t// all, which is a defensible position: it is a long-lived key to\n\t// somebody else's identity provider, and the account-database path\n\t// covers the same ground where an account database exists.\n\tUpstreamRefreshOff UpstreamRefreshMode = \"off\"\n)\n```\n\n```go\nfunc ParseUpstreamRefreshMode(raw string) (UpstreamRefreshMode, error)\n```\nParseUpstreamRefreshMode reads HTTP\\_API\\_UPSTREAM\\_REFRESH.\n\n```go\ntype UserInfo struct {\n\tSubject string                 `json:\"sub\"`\n\tEmail   string                 `json:\"email\"`\n\tName    string                 `json:\"name\"`\n\tGroups  interface{}            `json:\"groups\"` // Can be []string or string\n\tClaims  map[string]interface{} // Additional claims\n}\n```\nUserInfo represents user information from the IDP\n\n```go\ntype UserRecordLookup interface {\n\tGetUserRecord(ctx context.Context, user string) (*htcondor.UserRecord, error)\n}\n```\nUserRecordLookup is the slice of the schedd client that UserRecordOracle needs. It exists so the oracle's semantics — above all what a missing record means — can be tested without a live schedd, since that distinction is the difference between \"new user\" and \"locked out\".\n\n```go\ntype UserRecordOracle struct {\n\t// Lookup supplies the current schedd client. It is a function rather\n\t// than a value because the handler re-creates its Schedd when the\n\t// daemon's address changes.\n\tLookup func() UserRecordLookup\n\t// UIDDomain qualifies bare usernames before the lookup; schedd records\n\t// are keyed on the fully-qualified \"user@domain\" form.\n\tUIDDomain string\n\tLogger    *logging.Logger\n\t// Strict makes \"no record at all\" a revocation instead of no opinion.\n\t//\n\t// Off by default, because the schedd creates records lazily on first\n\t// submit: in an ordinary pool \"no record\" means \"has never submitted\n\t// here\", and revoking on it would cut off every new user.\n\t//\n\t// It becomes correct — and much stronger — in a pool that provisions a\n\t// record for every user up front, since `condor_qusers -add \u003cuser\u003e`\n\t// (ENABLE_USERREC with the create option) creates one without the user\n\t// submitting anything. There, absence really does mean \"not a user of\n\t// this AP\", and `condor_qusers -delete` becomes a revocation an admin\n\t// can perform. Do not enable it otherwise.\n\tStrict bool\n}\n```\nUserRecordOracle reports a user revoked when the schedd's per-user record says so — that is, when an admin has run \\`condor\\_qusers -disable \\\u003cuser\u003e -reason \"...\"\\`.\n\nThis is the stronger of the two schedd-backed oracles, because it reads an explicit administrative act rather than inferring one from an ACL. The record's DisableReason is carried through to the OAuth2 error, so the operator's note reaches whoever is looking at the failure.\n\nAbsence of a record is deliberately NOT a denial. The schedd creates a record the first time a user submits, so \"no record\" routinely means \"this user has never submitted here\" — denying on it would lock out every new user and everyone on a freshly built pool. Set Strict only where every user is provisioned up front with \\`condor\\_qusers -add\\`.\n\n```go\nfunc (o *UserRecordOracle) Check(ctx context.Context, username string, _ []string) (ReauthDecision, error)\n```\nCheck implements RevocationOracle.\n\n```go\nfunc (o *UserRecordOracle) CheckAccount(ctx context.Context, account string, _ ...string) (ReauthDecision, error)\n```\nCheckAccount is Check for a fully qualified account -- one the placementd assigned, whose domain need not be UID\\_DOMAIN -- used as given.\n\n```go\nfunc (o *UserRecordOracle) Name() string\n```\nName implements RevocationOracle.\n\n```go\ntype UserStatus int\n```\nUserStatus is an oracle's verdict on whether a user is still entitled to hold a grant issued to them earlier.\n\n```go\nconst (\n\t// UserStatusUnknown means the oracle has no opinion — it could not\n\t// reach its backing store, or the backing store has no record of this\n\t// user. It is NOT a denial: absence of a record is routinely\n\t// indistinguishable from \"this user has simply never been seen here\",\n\t// and denying on it would lock out every user of a fresh pool.\n\tUserStatusUnknown UserStatus = iota\n\t// UserStatusActive means the oracle affirmatively vouches for the user.\n\tUserStatusActive\n\t// UserStatusRevoked means the oracle affirmatively says this user may\n\t// no longer hold a grant. Only this verdict revokes.\n\tUserStatusRevoked\n)\n```\n\n```go\nfunc (s UserStatus) String() string\n```\n\n```go\ntype UtilizationApplyRequest struct {\n\tW          string   `json:\"w\"`\n\tAdvice     []string `json:\"advice\"`\n\tDays       *int     `json:\"days,omitempty\"`\n\tOwnedByMe  *bool    `json:\"owned_by_me,omitempty\"`\n\tConstraint string   `json:\"constraint,omitempty\"`\n\tOwners     string   `json:\"owners,omitempty\"`\n\tLimit      *int     `json:\"limit,omitempty\"`\n\tSchedd     string   `json:\"schedd,omitempty\"`\n}\n```\nUtilizationApplyRequest is POST /api/v1/utilization/apply.\n\n```go\ntype UtilizationApplyResponse struct {\n\tEdited   int                `json:\"edited\"`\n\tSet      map[string]float64 `json:\"set\"`\n\tDeclined []AdviceDeclined   `json:\"declined\"`\n\tSkipped  []JobOutcome       `json:\"skipped\"`\n\tFailed   []JobOutcome       `json:\"failed\"`\n}\n```\nUtilizationApplyResponse is what an apply did.\n\n```go\ntype UtilizationForJob struct {\n\tJobID      string `json:\"job_id\"`\n\tKey        string `json:\"key\"`\n\tName       string `json:\"name\"`\n\tExecutable string `json:\"executable\"`\n\tOwner      string `json:\"owner\"`\n\t// HasHistory says whether the workflow has finished jobs in the\n\t// window the link opens with; nil when that could not be told within\n\t// the read's bound.\n\tHasHistory *bool `json:\"has_history\"`\n}\n```\nUtilizationForJob is GET /api/v1/utilization/for-job/{id}.\n\n```go\ntype UtilizationJobsResponse struct {\n\tKey        string               `json:\"key\"`\n\tTotal      int                  `json:\"total\"`\n\tOffset     int                  `json:\"offset\"`\n\tNextOffset *int                 `json:\"next_offset\"`\n\tSort       string               `json:\"sort\"`\n\tOrder      string               `json:\"order\"`\n\tTruncated  bool                 `json:\"truncated\"`\n\tJobs       []utilization.JobRow `json:\"jobs\"`\n}\n```\nUtilizationJobsResponse is one page of a workflow's jobs.\n\n```go\ntype UtilizationWorkflowDetail struct {\n\tSince     int64           `json:\"since\"`\n\tUntil     int64           `json:\"until\"`\n\tDays      int             `json:\"days\"`\n\tTruncated bool            `json:\"truncated\"`\n\tLimit     int             `json:\"limit\"`\n\tWorkflow  json.RawMessage `json:\"workflow\"`\n\t// WaitingJobs is the caller's idle jobs of this workflow in the queue\n\t// now; nil in multi-AP mode or when the queue could not be read.\n\tWaitingJobs *int `json:\"waiting_jobs\"`\n\t// WaitingAdaptive names the requests (\"memory\", \"cpus\", \"disk\",\n\t// \"gpus\") that every one of those waiting jobs writes as a formula,\n\t// so apply would leave them all as written.\n\tWaitingAdaptive []string `json:\"waiting_adaptive,omitempty\"`\n}\n```\nUtilizationWorkflowDetail is GET /api/v1/utilization/workflow.\n\n```go\ntype VersionResponse struct {\n\tVersion string `json:\"version\"`\n\tCommit  string `json:\"commit\"`\n\t// StartTime is when this server process came up, RFC3339 in UTC.\n\tStartTime string `json:\"start_time\"`\n\t// UptimeSeconds is StartTime expressed as an elapsed duration, so a\n\t// caller does not have to trust its own clock to agree with ours.\n\tUptimeSeconds int64 `json:\"uptime_seconds\"`\n}\n```\nVersionResponse represents a build-info response.\n\n```go\ntype WhoAmIResponse struct {\n\tAuthenticated bool   `json:\"authenticated\"`\n\tUser          string `json:\"user,omitempty\"` // Omit if not authenticated\n\t// Assignment is where the caller's new work goes (multi-AP mode).\n\tAssignment *APAssignmentInfo `json:\"assignment,omitempty\"`\n}\n```\nWhoAmIResponse represents a whoami response\n\n","path":"github.com/htcondor/golang-htcondor/webapi/httpserver","name":"httpserver","synopsis":"Package httpserver provides HTTP API handlers for HTCondor operations.","isRedistributable":true}
