Skip to content

Connect from a data.all front page URL (client(dataall_url=...)), 0.6.0 - #55

Merged
TejasRGitHub merged 2 commits into
data-dot-all:mainfrom
TejasRGitHub:feat/client-from-frontend
Sep 25, 2026
Merged

TejasRGitHub merged 2 commits into
data-dot-all:mainfrom
TejasRGitHub:feat/client-from-frontend

Conversation

@TejasRGitHub

Copy link
Copy Markdown
Contributor

Feature or Bugfix

  • Feature

Detail

Lets the SDK connect with nothing but the data.all front page URL:

import dataall_sdk as dataall
client = dataall.client(dataall_url="https://dataall.example.com")
client.list_organizations()
  • New dataall_core.discovery: fetches the front page, finds the static/js/main.*.js bundle and reads the REACT_APP_* values the frontend build inlines. REACT_APP_CUSTOM_AUTH* means an OIDC deployment (OidcBrowserAuth, loopback redirect defaults, openid offline_access); REACT_APP_COGNITO_* means Cognito (client id, hosted UI domain, sign-in redirect). profile_from_frontend() turns that into a Profile and raises MissingParametersException naming anything that could not be read. This is the discovery the CLI added in configure: add OidcBrowserAuth and --dataall_url front-page discovery dataall-cli#53, moved here so both packages share it; the CLI will import it from core.
  • DataallClient.client() gains dataall_url. If the profile exists in config.yaml it is used as is (with a warning when it points at a different front page). Otherwise the profile is discovered and saved under the page's host name, or under profile= when given, so later calls skip the lookup and tokens persist between runs. The first API call then triggers the normal OidcBrowserAuth login.
  • DEFAULT_FALLBACK_REDIRECT_URI added next to the other OidcBrowserAuth defaults.
  • Version 0.5.0 -> 0.6.0 (new public module and parameter).
  • Tests: discovery for OIDC and Cognito bundles, partial and missing values, HTTP errors; profile_from_frontend defaults; client(dataall_url=...) discovers and saves, reuses an existing profile without a lookup, honours profile=, and surfaces missing values. Existing tests unchanged.

Relates

Security

  • Input: two httpx GETs against the URL the caller supplies (front page, then the bundle it references); values are extracted with anchored regular expressions on known variable names and only populate profile fields the user could type by hand. Nothing is executed or deserialized beyond response.text. No eval.
  • AuthN/AuthZ: unchanged; the discovered profile uses the existing auth classes and token validation stays with the deployment's API.
  • Cryptography: none added.
  • No new policies, roles or users.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

🤖 Generated with Claude Code

- dataall_core.discovery: read auth type, identity provider, client id,
  redirect URI and API endpoint from the deployed frontend bundle and build
  a Profile from them (moved here from the CLI so the SDK can use it)
- DataallClient.client(dataall_url=...): discover and save the profile,
  named after the page host, when it is not configured yet
- Version 0.6.0

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Deep links such as /console/environments resolve to the same index.html.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@TejasRGitHub
TejasRGitHub merged commit 5a6d1b4 into data-dot-all:main Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant