Repository navigation
Document connections use fixed provider OAuth clients - #863
Merged
Merged
Conversation
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Read provider wait and response caps from the settings catalog so operators can tune them. Preserve the existing defaults and caller deadline, generate the configuration outputs, and verify both overrides at the HTTP boundary. Signed-off-by: zlareb1 <[email protected]>
This was referenced Nov 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #860
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Document connections have provider-specific OAuth clients with bounded requests, exact scope checks and credential-redacted failures.
Why
Document ingestion clients accept service-account keys, integration tokens or API keys. Connected accounts need separate OAuth exchange and rotation contracts. The existing shared token helper follows redirects and reads an unbounded response, so it cannot supply this credential boundary unchanged.
Scope and risk
One server-side client implements Google, Notion and Linear consent URLs, code exchange, identity metadata, refresh and revocation. Provider origins are fixed. Consent uses the configured public base, browser-state input and S256 where documented. Google requests only Drive read plus identity scopes; Linear requests read access as the user. Notion's read-content registration remains an external permission bound; opaque scope text supplies no capability proof.
Requests refuse redirects, share the caller's remaining deadline, cap metadata bodies and perform no retries. Request duration and response size come from document-connection settings, preserving the 30-second and 64 KiB defaults. Token pairs and account grants have redacted representations; provider bodies and network exception text do not reach rendered failures. Google can retain an omitted replacement refresh token, while Notion and Linear require replacement material. Notion display email and expiry remain optional rather than being invented.
This is the provider HTTP boundary. It exposes no connection route, credential-return operation or usable source binding. Its caller must consume browser-bound state, authorize the canonical Loom owner and source, serialize account generations, seal refresh material and clear local access before revocation. Those lifecycle handlers remain separate implementation work; no account, mirror, capability or live-search path is enabled here.
The architecture defines the provider contract required by this helper. Source entry points describe the implemented helper and its caller obligations.
Compatibility, rollout and rollback
LOOM_KNOWLEDGE_CONNECTED_OAUTH_TIMEOUT_SandLOOM_KNOWLEDGE_CONNECTED_OAUTH_RESPONSE_MAX_BYTESbound provider requests. The caller deadline still applies. Provider registrations remain required for the complete connected-account feature.Tests
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex wrote the change; fresh independent whole-diff review and final-head CI are required before merge.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist