feat(auth): add pluggable authenticator support via registry and entry_points#3445
Merged
Merged
Conversation
9652fa7 to
40fc1db
Compare
…y_points Currently, flytekit's auth system only supports a fixed set of built-in authentication modes (PKCE, ClientSecret, ExternalCommand, DeviceFlow). Adding a new mode requires modifying flytekit core. This makes it impossible for downstream consumers to provide custom authenticators (e.g., native GCP ID token auth) without forking flytekit or shelling out to external processes. This change makes the authenticator system extensible: 1. `register_authenticator_plugin(name, factory)` — explicit registration that works in every environment (pip, Bazel, vendored mono-repos). 2. `flytekit.auth` entry_point group — automatic discovery for pip-installed plugins. When `auth_mode` is set to a value that doesn't match any built-in AuthType, the function checks the explicit registry first, then falls back to entry_point discovery. Names are compared case-insensitively for consistency with the built-in auth mode handling. Plugin contract: a callable `(PlatformConfig, ClientConfigStore) -> Authenticator`. Signed-off-by: Hongxin Liang <honnix@users.noreply.github.com>
40fc1db to
c4e5fac
Compare
pingsutw
approved these changes
Jun 22, 2026
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
Currently, flytekit's auth system only supports a fixed set of built-in authentication modes (PKCE, ClientSecret, ExternalCommand, DeviceFlow). Adding a new mode requires modifying flytekit core. This makes it impossible for downstream consumers to provide custom authenticators without forking or shelling out to external processes via
ExternalCommand.This PR makes the authenticator system extensible via two mechanisms:
register_authenticator_plugin(name, factory)works in every environment (pip, Bazel, vendored mono-repos). This is the primary mechanism.flytekit.authentry_point group for automatic discovery in pip-installed environments.When
auth_modeis set to a value that doesn't match any built-inAuthType,get_authenticator()checks the explicit registry first, then falls back to entry_point discovery. Names are compared case-insensitively for consistency with the built-in auth mode handling.Motivation
At Spotify we use GCP ID token auth with Flyte. Today this requires
ExternalCommandmode shelling out togcloud auth print-identity-token, which is slow and cannot run in parallel (gcloud's SQLite config database locks). A pluggable auth system lets us register an in-process authenticator usinggoogle-authdirectly — no subprocess, no gcloud, fully parallel-safe.Plugin contract
A callable (class or factory function) with the signature:
Usage
Explicit registration (Bazel / mono-repo):
Entry_point (pip):
Config:
Test plan
ValueError🤖 Generated with Claude Code