Skip to content

feat: fix auth login validation and add auth whoami command#2

Merged
caballeto merged 3 commits into
mainfrom
feat/auth-whoami
Apr 10, 2026
Merged

feat: fix auth login validation and add auth whoami command#2
caballeto merged 3 commits into
mainfrom
feat/auth-whoami

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

  • Fixes auth login — validates against GET /api/v1/auth/me (API-key-compatible) instead of /platform/me (JWT-only, always failed)
  • Shows org name, key name, and plan tier on successful login
  • New auth whoami command — displays full API key identity, org, plan tier, entitlements with usage, and live rate-limit quota

Dependencies

Requires mono#174 to be deployed first — the /api/v1/auth/me endpoint must exist on the API before this CLI version is released.

Test plan

  • devhelm auth login --token dh_live_... succeeds and shows org/key/plan info
  • devhelm auth whoami displays identity, plan, usage, and rate limits
  • devhelm auth whoami --output json returns full JSON response
  • devhelm auth login with invalid token fails with proper error message

Made with Cursor

- auth login now validates against /api/v1/auth/me (works with API keys)
  instead of /platform/me (JWT-only, always failed for CLI users)
- Shows org name, key name, and plan tier on successful login
- New auth whoami command displays full identity, plan, usage, and rate limits

Made-with: Cursor
Tries /api/v1/auth/me first (rich identity for API keys), falls back
to /api/v1/dashboard/overview for dev tokens and JWTs.

Made-with: Cursor
@caballeto caballeto merged commit cbbf29b into main Apr 10, 2026
3 checks passed
@caballeto caballeto deleted the feat/auth-whoami branch April 10, 2026 11:37
caballeto added a commit that referenced this pull request Apr 20, 2026
…s from spec, enable noUncheckedIndexedAccess

Phase 2 cleanup across the CLI codegen pipeline:

- Wire `parseSingle`/`parsePage`/`parseCursorPage` response validation
  through `apiGetSingle` so commands no longer rely on `data as T` casts
  in `checkedFetch` (Bug #5, P1 strict-fail on response envelopes).
- Generate `MATCH_RULE_TYPES`, `WEBHOOK_EVENT_TYPES`, and
  `STATUS_PAGE_VISIBILITIES` from the OpenAPI spec via
  `spec-facts.generated.ts` instead of hardcoding them in
  `yaml/zod-schemas.ts` and command flags (Bug #14).
- Drive the imperative `--visibility` flag for `status-pages` from the
  spec-derived `STATUS_PAGE_VISIBILITIES` tuple instead of a hardcoded
  one-element array (Bugs #1, #2).
- Drop the `@ts-nocheck` pragma on `api-zod.generated.ts` (now
  preprocessed for Zod-3 compatibility during generation) and fix the
  type fallout in command files.
- Enable `noUncheckedIndexedAccess: true` in `tsconfig.json` and refactor
  index-loop sites in YAML resolver / validator / interpolation /
  child-reconciler / parser / state show to satisfy it.

Made-with: Cursor
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