From fe2bfe443dfcf3251ebe39002325f604634dfa1f Mon Sep 17 00:00:00 2001 From: t Date: Sat, 13 Jun 2026 11:55:59 -0600 Subject: auth: HTTP helper + token storage (C3, C4) 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. --- libpanto/src/public.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libpanto/src/public.zig') diff --git a/libpanto/src/public.zig b/libpanto/src/public.zig index 2ee44dd..aa2f7e8 100644 --- a/libpanto/src/public.zig +++ b/libpanto/src/public.zig @@ -84,8 +84,19 @@ pub const ExchangeConfig = auth_mod.ExchangeConfig; pub const DeviceDialect = auth_mod.DeviceDialect; pub const TokenRequestFormat = auth_mod.TokenRequestFormat; pub const TokenSet = auth_mod.TokenSet; +pub const ParsedTokenSet = auth_mod.ParsedTokenSet; pub const ResolvedCredential = auth_mod.ResolvedCredential; +/// Token persistence under an embedder-chosen auth directory +/// (`$PANTO_HOME/auth`). Files are written owner-only. +pub const loadTokenSet = auth_mod.loadTokenSet; +pub const saveTokenSet = auth_mod.saveTokenSet; +pub const deleteTokenSet = auth_mod.deleteTokenSet; + +/// Non-streaming HTTP helper over the process-global client, plus JSON +/// path readers — the building blocks of the OAuth flows. +pub const http = @import("http_helper.zig"); + // =========================================================================== // Conversation construction (data, aliased) // =========================================================================== @@ -222,6 +233,7 @@ test { // tests must still run). std.testing.refAllDecls(config_mod); std.testing.refAllDecls(auth_mod); + std.testing.refAllDecls(@import("http_helper.zig")); std.testing.refAllDecls(conversation_mod); std.testing.refAllDecls(agent_mod); std.testing.refAllDecls(stream_mod); -- cgit v1.3