interloper-api 0.23.1__tar.gz → 0.24.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {interloper_api-0.23.1 → interloper_api-0.24.1}/PKG-INFO +1 -1
- {interloper_api-0.23.1 → interloper_api-0.24.1}/pyproject.toml +1 -1
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/oauth.py +11 -10
- {interloper_api-0.23.1 → interloper_api-0.24.1}/README.md +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/__init__.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/app.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/dependencies.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/email.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/__init__.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/admin.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/agent.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/assets.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/auth.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/backfills.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/catalog.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/destinations.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/external/__init__.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/external/resolve.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/jobs.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/organisations.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/resources.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/runs.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/sources.py +0 -0
- {interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/ws.py +0 -0
|
@@ -6,10 +6,11 @@ encoding, parameter names), so the exchange is performed generically —
|
|
|
6
6
|
adding a provider is an ``interloper.oauth_providers`` entry point, not a
|
|
7
7
|
new route.
|
|
8
8
|
|
|
9
|
-
The
|
|
9
|
+
The in-house *OAuth* credentials (``client_id`` / ``client_secret`` /
|
|
10
10
|
``redirect_uri``) are read from provider-scoped environment variables
|
|
11
|
-
(
|
|
12
|
-
|
|
11
|
+
(``INTERLOPER_<PROVIDER>_CLIENT_ID``, …) and used to perform the exchange. They are
|
|
12
|
+
never returned to the browser; connections resolve them from the same env
|
|
13
|
+
at runtime (see ``OAuthCredentialField``).
|
|
13
14
|
|
|
14
15
|
The ``GET /providers`` endpoint returns metadata for all providers that
|
|
15
16
|
have credentials configured, so the frontend knows which "Sign in with X"
|
|
@@ -42,14 +43,14 @@ router = APIRouter(prefix="/oauth", tags=["oauth"])
|
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
class _ProviderConfig:
|
|
45
|
-
"""
|
|
46
|
+
"""In-house OAuth credentials resolved from environment variables."""
|
|
46
47
|
|
|
47
48
|
def __init__(self, key: str, *, env_prefix: str | None = None) -> None:
|
|
48
49
|
prefix = (env_prefix or key).upper()
|
|
49
50
|
self.key = key
|
|
50
|
-
self.client_id = os.environ.get(f"{prefix}_CLIENT_ID", "")
|
|
51
|
-
self.client_secret = os.environ.get(f"{prefix}_CLIENT_SECRET", "")
|
|
52
|
-
self.redirect_uri = os.environ.get(f"{prefix}_REDIRECT_URI", "")
|
|
51
|
+
self.client_id = os.environ.get(f"INTERLOPER_{prefix}_CLIENT_ID", "")
|
|
52
|
+
self.client_secret = os.environ.get(f"INTERLOPER_{prefix}_CLIENT_SECRET", "")
|
|
53
|
+
self.redirect_uri = os.environ.get(f"INTERLOPER_{prefix}_REDIRECT_URI", "")
|
|
53
54
|
|
|
54
55
|
@property
|
|
55
56
|
def configured(self) -> bool:
|
|
@@ -76,11 +77,11 @@ async def _exchange(
|
|
|
76
77
|
Args:
|
|
77
78
|
client: The HTTP client to use.
|
|
78
79
|
spec: The provider's token-exchange spec.
|
|
79
|
-
cfg: The
|
|
80
|
+
cfg: The in-house OAuth credentials.
|
|
80
81
|
code: The authorization code.
|
|
81
82
|
|
|
82
83
|
Returns:
|
|
83
|
-
The provider's raw token response (e.g. ``refresh_token``). The
|
|
84
|
+
The provider's raw token response (e.g. ``refresh_token``). The OAuth
|
|
84
85
|
credentials are *not* injected: they are the in-house per-provider
|
|
85
86
|
values resolved from env at runtime, so the secret never leaves the
|
|
86
87
|
server.
|
|
@@ -165,7 +166,7 @@ async def exchange_token(
|
|
|
165
166
|
"""Exchange an authorization code for tokens. Requires authentication.
|
|
166
167
|
|
|
167
168
|
Returns only the provider's token response (e.g. ``refresh_token``); the
|
|
168
|
-
in-house
|
|
169
|
+
in-house OAuth credentials are never included — connections resolve them
|
|
169
170
|
from env at runtime.
|
|
170
171
|
"""
|
|
171
172
|
spec = providers().get(provider)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/external/__init__.py
RENAMED
|
File without changes
|
{interloper_api-0.23.1 → interloper_api-0.24.1}/src/interloper_api/routes/external/resolve.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|