feat(file-sources): map connectors to file-source adapters (PR 2/4)#367
Merged
Conversation
Lets an admin mark a connector as a file source by mapping it to a registered file-source adapter. Builds on the PR #366 adapter framework. Backend: - OAuthProvider gains a nullable file_source_adapter_id (dataclass + DynamoDB round-trip + Create/Update/Response models + repository apply_metadata_update). - Admin create/update routes validate the mapping against the adapter registry — the adapter must exist and its compatible_provider_types must include the connector's type. Validation lives in the app_api route (apis.shared cannot import the registry). - New read-only GET /admin/file-source-adapters exposes the registry so the admin form can populate its dropdown. Frontend: - Admin connector form gains a "File Source" section: an adapter dropdown filtered by provider-type compatibility, with a scope- coverage warning when the connector's scopes don't cover what the adapter needs. Selecting an adapter is the opt-in; clearing it removes the mapping. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
colinmxs
added a commit
that referenced
this pull request
May 22, 2026
Merges 16 commits from origin/develop into the stack-simplification branch. Two modify/delete conflicts resolved (mcp-sandbox-stack.ts and its test — both deleted by us, modified by develop's PRs #352–#360). Ported the dynamic per-resource CSP changes from develop into constructs/mcp-sandbox/mcp-sandbox-distribution-construct.ts: - Removed buildMcpSandboxProxyCsp() (static CSP is gone) - Added loadMcpSandboxCspFunctionCode() — loads csp-function.js from assets/mcp-sandbox/, substitutes the FRAME_ANCESTORS placeholder with the real source list via JSON.stringify (handles quote-escaping for 'none' correctly) - Added McpSandboxCspFunction (CloudFront Function, JS_2_0 runtime) associated at VIEWER_RESPONSE on the default behavior — composes per-resource CSP from ?csp= query param - Removed contentSecurityPolicy from the ResponseHeadersPolicy (CSP is now dynamic via the function; other security headers stay on RHP) - Shortened RHP comment to fit 128-char AWS cap The mcp-sandbox-csp-function.test.ts that came in from develop passes against our construct (88 tests green). Also merged: file-sources adapter framework (#366, #367), frontend test fix (#368), beta.27 release merges (#365, #369), kaizen doc (#370), backup tool (#361 — already cherry-picked earlier).
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.
Summary
Second PR in the file source connectors series. Builds on the adapter framework from #366 to let an admin mark a connector as a file source by mapping it to a registered adapter.
Backend
OAuthProvidergains a nullablefile_source_adapter_id— dataclass field, DynamoDBto/from_dynamo_itemround-trip,OAuthProviderCreate/Update/Response, andprovider_repository.apply_metadata_update. Legacy records without the field default toNone.compatible_provider_typesmust include the connector's type. Validation lives in the app_api route —apis.sharedcannot import the app_api registry.GET /admin/file-source-adaptersexposes the registry so the admin form can populate a dropdown.Frontend
"") removes the mapping.Design notes
file_source_adapter_idis the opt-in — there's no separate "is file source" boolean. Set = file source; null = not.Test plan
GET /admin/file-source-adaptersendpoint, plus connectors + oauth + architecture regression suitesruffclean;mypyclean apart from the repo-wide pre-existingimport-untypednoiseKnown issue (pre-existing, not introduced here)
connectors.service.spec.tsfails on a cleandevelopcheckout — itsTestBedsetup chokes on a nullHttpClientTestingModule(Angular test-infra version drift). The newfetchFileSourceAdapterstest was added in the same style and will pass once that environment issue is fixed. Flagged separately.🤖 Generated with Claude Code