summaryrefslogtreecommitdiff
path: root/libpanto/src/auth.zig
AgeCommit message (Collapse)Author
2026-06-23libpanto ponytail-audit simplificationst
2026-06-15auth: flatten [auth.<name>] config + ${...} substitutiont
Collapse the auth schema: infer `type` from keys, replace key/key_env_var with a single `key` (resolved via substitution), flatten the exchange to flat `exchange_*` keys, and drop the auth-level headers tables in favor of reusing the provider's `extra_headers` on the auth HTTP calls. Add `${sibling}` and `${env:VAR}` substitution over auth values (GitHub Enterprise = set `domain`). Restore api_key-empty → provider-drop. Update default config, docs, and tests.
2026-06-15auth: OAuth device flows, refresh, and Copilot exchange (C5)t
Implement the device-authorization flow for both dialects (GitHub `token` direct-poll; Codex `codex` poll→authorization-code→PKCE exchange), refresh_token grant, Copilot secondary token exchange, JWT exp parsing, Codex account-id extraction, and pure credential-building/refresh predicates. Adds a Presenter hook for rendering the device-code prompt. Exported from public.zig.
2026-06-15auth: HTTP helper + token storage (C3, C4)t
Add libpanto http_helper (non-streaming request/response over the global client, plus dotted-JSON-path readers) and token persistence in auth.zig (load/save/delete TokenSet under an embedder-chosen auth dir, owner-only files). Add $PANTO_HOME/auth to the panto_home layout.
2026-06-15auth: clean-break named [auth.<name>] sessions + extra_headerst
Replace provider-level api_key/api_key_env_var with named auth sessions: providers now reference `auth = "<name>"` and credentials live under `[auth.<name>]`. Adds the libpanto auth type surface (AuthConfig, TokenSet, ResolvedCredential), a Header type and provider `extra_headers`, and rewires the CLI config loader (parse [auth.<name>], require auth=, providers always survive, eager api_key resolution). Updates the shipped default config.