feat(framework): Implement OAuth connector Control API#7597
Draft
charlesbvll wants to merge 28 commits into
Draft
feat(framework): Implement OAuth connector Control API#7597charlesbvll wants to merge 28 commits into
charlesbvll wants to merge 28 commits into
Conversation
…orestate-methods # Conflicts: # framework/proto/flwr/proto/control.proto # framework/py/flwr/proto/control_pb2.py # framework/py/flwr/proto/control_pb2.pyi # framework/py/flwr/supercore/corestate/corestate_test.py # framework/py/flwr/supercore/corestate/sql_corestate.py # framework/py/flwr/supercore/state/alembic/versions/rev_2026_07_09_add_oauth_connector_tables.py
Contributor
There was a problem hiding this comment.
Pull request overview
Implements the Control API surface for OAuth-based connectors (list, disconnect, begin OAuth, complete OAuth) by wiring new connector handler logic into the Control servicer, adding a minimal provider interface, and extending error-code/catalog support and tests.
Changes:
- Wire
ListConnectors,DisconnectConnector,BeginConnectorOAuth, andCompleteConnectorOAuthto new connector handler functions and add injectable OAuth provider registration. - Add connector OAuth provider protocol/types plus handler implementations (PKCE, expiry/state validation, single-use sessions, account isolation) and comprehensive tests.
- Add new connector-related API error codes/specs (but see critical issue below).
Critical issues
ApiErrorCodeandApiErrorCatalogremovedACCOUNT_AUTHENTICATION_*entries that are still referenced elsewhere in the repo, and the enum reuses their previous integer values for new connector codes. This will break runtime lookups and can break backwards compatibility for clients relying on stable error-code integers. (Comments added with concrete inline fixes.)complete_connector_oauthvalidatesrequest.code.strip()but passes the unstripped code to the provider exchange, allowing whitespace-padded codes to pass validation but fail during exchange. (Comment added with inline fix.)
Simplicity/readability suggestions
- None blocking beyond the targeted fixes above.
Consistency concerns
corestate_test.pyadds unusedUTC/timezoneimports (likely lint failure). (Comment added with inline fix.)
Whether the PR should be split
- No; the changes are cohesive around the OAuth connector Control API.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| framework/py/flwr/superlink/servicer/control/control_servicer.py | Wire connector RPCs to new connector handlers and inject provider map. |
| framework/py/flwr/superlink/servicer/control/control_grpc.py | Thread connector OAuth providers into gRPC server construction. |
| framework/py/flwr/superlink/servicer/control/connectors/provider.py | Add provider protocol and provider-map construction helpers. |
| framework/py/flwr/superlink/servicer/control/connectors/handlers.py | Implement connector OAuth business logic (PKCE, session validation/claiming, persistence). |
| framework/py/flwr/superlink/servicer/control/connectors/handlers_test.py | Add end-to-end tests for connector OAuth flows and servicer wiring. |
| framework/py/flwr/superlink/servicer/control/connectors/init.py | Export connector OAuth public types/helpers. |
| framework/py/flwr/supercore/error/base.py | Add connector error codes (currently breaks existing auth codes; needs adjustment). |
| framework/py/flwr/supercore/error/catalog.py | Add connector error specs (currently drops auth error specs; needs restoration). |
| framework/py/flwr/supercore/corestate/corestate_test.py | Update datetime imports (currently includes unused imports). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Follow up to #7591
Implements
ListConnectors,DisconnectConnector,BeginConnectorOAuth, andCompleteConnectorOAuth