Skip to content

feat: headless auth via env + client_credentials service token#2

Open
irresi wants to merge 1 commit into
mainfrom
feature/headless-service-credentials
Open

feat: headless auth via env + client_credentials service token#2
irresi wants to merge 1 commit into
mainfrom
feature/headless-service-credentials

Conversation

@irresi

@irresi irresi commented Jul 3, 2026

Copy link
Copy Markdown

What

Lets hermes-membase authenticate headlessly (CI/Docker) — no browser login, no pre-seeded token file — so it can be verified end-to-end in an automated pipeline. This is the connector-side enablement for the Docker "Tier 4" e2e.

Env support (all take precedence over config/token files)

Env Effect
MEMBASE_API_URL Override API base (point at staging/preview)
MEMBASE_ACCESS_TOKEN / MEMBASE_REFRESH_TOKEN Inject tokens directly
MEMBASE_SERVICE_CLIENT_ID / MEMBASE_SERVICE_CLIENT_SECRET Mint a short-lived access token via client_credentials (aristoapp/membase#318)

How

  • resolve_auth_state(config) centralizes precedence: explicit access token → service-credential exchange → fall back to existing (browser-login) tokens. Used by both the CLI (_build_client_from_config) and the memory provider.
  • oauth.exchange_client_credentials() performs the grant (access token only; no refresh — re-exchanges on expiry).
  • parse_config() reads the new env vars; config-file fallbacks (serviceClientId/serviceClientSecret) included for symmetry.

Verified

  • Live against staging with env only: minted a token via client_credentialsingest + search succeeded, no browser, no refresh token.
  • 26 unit tests pass (7 new: env precedence + auth resolution incl. mint / short-circuit / no-op). ruff clean.
  • Backward compatible: with no env set, behavior is unchanged (file/browser login).

Bumps 0.1.5 → 0.1.6.

🤖 Generated with Claude Code

Enables CI/headless use without a browser login or token file:
- MEMBASE_API_URL overrides the API base (point at staging/preview).
- MEMBASE_ACCESS_TOKEN / MEMBASE_REFRESH_TOKEN inject tokens directly.
- MEMBASE_SERVICE_CLIENT_ID / MEMBASE_SERVICE_CLIENT_SECRET mint a
  short-lived access token via the client_credentials grant (membase#318).

Env takes precedence over the config file / token file. resolve_auth_state()
centralizes the precedence (explicit token → service-credential exchange →
fall back to browser-login tokens) and is used by both the CLI and the
provider. Adds oauth.exchange_client_credentials(). Config-file fallbacks
(serviceClientId/serviceClientSecret) included for symmetry.

Verified live against staging: env-only → minted token → ingest + search
succeed, no browser, no refresh token. Adds unit tests for env precedence
and auth resolution. Bumps 0.1.5 → 0.1.6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
irresi added a commit to aristoapp/membase that referenced this pull request Jul 13, 2026
…oup B)

Pure copy-in (option a): bring the working hermes-membase Python runtime in
AS-IS, then refactor toward a shared core later. Replaces the disabled "review
scaffold" with the real provider/client/oauth/capture/mirror/cli runtime,
including the headless client_credentials auth (aristoapp/hermes-membase#2).

- clients/hermes/python/src/membase_hermes/: real runtime (17 files). Adopts
  the source package name `membase_hermes` (dropped the `hermes_membase` stub).
- pyproject: real deps (httpx, PyYAML) + entry points; version pinned to the
  repo-wide 0.0.0; plugin.yaml synced to the adapter-generated manifest.
- Rewrote the guards that were purpose-built to assert "runtime NOT copied yet"
  to instead verify the runtime IS present (source inspection only — no import,
  so CI needs no Python deps; live behavior stays covered by the e2e tiers):
  check-hermes-python-parity (real tools, no scaffold markers),
  check-hermes-native-artifacts (policy -> "ported", assert modules present),
  version-parity + review-readiness path renames.
- docs/consolidation-execution-plan-group-b.md.

Group A adapter untouched. No publishing (private package, no PyPI). pnpm check
green. OpenClaw copy-in is next; shared-core refactor + test migration later.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Source: https://github.com/aristoapp/hermes-membase
Co-authored-by: Seunghyun00Kim <151034001+Seunghyun00Kim@users.noreply.github.com>
Co-authored-by: Joshua Park <inyoung@aristo.so>
Co-authored-by: Shinhyeok Hwang <shinhyeok@aristo.so>
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