atproto utils for zig zat.dev

fix oauth client compile errors on zig 0.16 #29

Merged linji.at
targeting main from linji.at/zat:fix-oauth-client-zig-016
Merged opened by and assigned to linji.at
targeting main from linji.at/zat:fix-oauth-client-zig-016

The OAuth client ceremony paths fail to compile on the zig 0.16.0 release:

  1. sendParRequest binds the fetchWithDpopNonceRetry result as const, but DpopResponse.deinit takes *DpopResponse.
  2. dpopHtu and originFromUrl format std.Uri.Component with {s}; on the 0.16.0 release Component is union(enum){ raw, percent_encoded } and {s} is rejected for it.

These paths are client-only, so server-side consumers (e.g. zds) never analyze them; any downstream client trips both. Hit while building a Zig atproto CLI client against zds.

Fix: var result, and a small uriComponentText helper that unwraps the union. Compiles on both the 0.16.0 release and current dev toolchains.

Verified: zig build test -Dtarget=x86_64-linux-gnu.2.36 passes on the 0.16.0 release (the target flag works around an unrelated local GCC-16 crt1.o .sframe linker issue).

Commits 1

fix oauth client compile errors on zig 0.16