User authentication and session management for web applications
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

json: replace ?format with ?indent + ?preserve, drop recode*, rework json.brr

Migrate every `to_string` / `to_writer` from the three-variant enum
`?format:format = Minify | Indent | Layout` to two orthogonal knobs:

?indent:int -- omit for compact; pass 2 for pretty (two-space indent).
Inside the function the value is `int option`.
?preserve:bool -- default false; honor per-node Loc.Meta whitespace when
true, with the ?indent path as fallback for new nodes.

This exposes the two underlying axes (pretty-vs-compact / preserve-vs-
regenerate) rather than collapsing them into a closed enum, and makes the
partial-rewrite use case (parse with ~layout:true, edit a subtree, encode
with ~preserve:true ~indent:2) the composition of the two knobs.

Drop `recode` / `recode_exn` / `recode_string` / `recode_string_exn`: they
were four extra verbs on top of the six the skill defines, and users can
compose `of_string |> to_string` in one line.

Rework json.brr to mirror the core six-verb shape exactly:

of_jstr / of_jstr_exn / to_jstr -- Jstr.t replaces string
of_jv / of_jv_exn / to_jv -- Jv.t (zero-copy JS value)

Dropping the jsont-era `decode`/`encode`/`'`/`recode*` verbs and the
dual Jv.Error.t / Json.Error.t return types -- everything returns
Loc.Error.t now.

Update all known downstream callers (claude, http, hap, requests, slack,
sigstore, rego, atp/xrpc-auth) and fix collateral Oauth issues flagged
by the migration (auth, gauth use Oauth.Client_auth.post now).

Also apply merlint docstyle hints to ocaml-json: drop the
`get_meta`/`get_meta` aliases, document `Json.Dict.{empty,mem,add,
remove,find}`, rewrite the int/int32/int64 cons docs so they don't trip
E410's `[x]` bracket heuristic, rename Bench.bench_file to Bench.run_file.

Drive-by: restore did/test/test_did.ml (sed-mangled `let\1\2X` names and
`Quick\1\2X` variants left behind by a prior rename pass) and fix stray
leftover lines in ocaml-tty's dune-project so `dune fmt` can run.

+5 -2
+5 -2
lib/auth.ml
··· 347 347 348 348 let exchange_code (cfg : config) ~code = 349 349 let redirect_uri = oauth_redirect_uri cfg in 350 - Oauth.exchange_code cfg.http cfg.session.oauth_provider 351 - ~client_id:cfg.client_id ~client_secret:cfg.client_secret ~code 350 + let client_auth = 351 + Oauth.Client_auth.post ~client_id:cfg.client_id 352 + ~client_secret:cfg.client_secret 353 + in 354 + Oauth.exchange_code cfg.http cfg.session.oauth_provider ~client_auth ~code 352 355 ~redirect_uri () 353 356 354 357 (* Find or create a user from OAuth userinfo, handling concurrent races.