interloper-api 0.24.0__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.
Files changed (24) hide show
  1. {interloper_api-0.24.0 → interloper_api-0.24.1}/PKG-INFO +1 -1
  2. {interloper_api-0.24.0 → interloper_api-0.24.1}/pyproject.toml +1 -1
  3. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/oauth.py +11 -10
  4. {interloper_api-0.24.0 → interloper_api-0.24.1}/README.md +0 -0
  5. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/__init__.py +0 -0
  6. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/app.py +0 -0
  7. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/dependencies.py +0 -0
  8. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/email.py +0 -0
  9. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/__init__.py +0 -0
  10. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/admin.py +0 -0
  11. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/agent.py +0 -0
  12. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/assets.py +0 -0
  13. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/auth.py +0 -0
  14. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/backfills.py +0 -0
  15. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/catalog.py +0 -0
  16. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/destinations.py +0 -0
  17. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/external/__init__.py +0 -0
  18. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/external/resolve.py +0 -0
  19. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/jobs.py +0 -0
  20. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/organisations.py +0 -0
  21. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/resources.py +0 -0
  22. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/runs.py +0 -0
  23. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/sources.py +0 -0
  24. {interloper_api-0.24.0 → interloper_api-0.24.1}/src/interloper_api/routes/ws.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: interloper-api
3
- Version: 0.24.0
3
+ Version: 0.24.1
4
4
  Summary: Interloper FastAPI routes
5
5
  Author: Guillaume Onfroy
6
6
  Author-email: Guillaume Onfroy <guillaume@digitlcloud.com>
@@ -3,7 +3,7 @@
3
3
  # ###############
4
4
  [project]
5
5
  name = "interloper-api"
6
- version = "0.24.0"
6
+ version = "0.24.1"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -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 connector *app* credentials (``client_id`` / ``client_secret`` /
9
+ The in-house *OAuth* credentials (``client_id`` / ``client_secret`` /
10
10
  ``redirect_uri``) are read from provider-scoped environment variables
11
- (``<PROVIDER>_CLIENT_ID``, …) and injected into the token response so they
12
- can be stored alongside the tokens.
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
- """Connector app credentials resolved from environment variables."""
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 connector app credentials.
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 app
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 app credentials are never included — connections resolve them
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)