back interdiff of round #3 and #2

Implement OAuth #2

closed
opened by futur.blue targeting main

𝒴𝑜𝓊 𝒸𝒶𝓃 𝓃𝑜𝓌 use pdsls

ERROR
.ocamlformat

Failed to calculate interdiff for this file.

ERROR
bin/main.ml

Failed to calculate interdiff for this file.

ERROR
dune

Failed to calculate interdiff for this file.

ERROR
dune-project

Failed to calculate interdiff for this file.

ERROR
kleidos/kleidos.ml

Failed to calculate interdiff for this file.

REBASED
mist/lib/mst.ml

This patch was likely rebased, as context lines do not match.

ERROR
pegasus.opam

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/account_/login.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/account_/logout.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/actor/putPreferences.ml

Failed to calculate interdiff for this file.

REBASED
pegasus/lib/api/identity/updateHandle.ml

This patch was likely rebased, as context lines do not match.

ERROR
pegasus/lib/api/oauth_/authorize.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/oauth_/par.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/oauth_/token.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/server/createSession.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/server/getServiceAuth.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/api/well_known.ml

Failed to calculate interdiff for this file.

REBASED
pegasus/lib/auth.ml

This patch was likely rebased, as context lines do not match.

REBASED
pegasus/lib/data_store.ml

This patch was likely rebased, as context lines do not match.

ERROR
pegasus/lib/dune

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/env.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/errors.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/id_resolver.ml

Failed to calculate interdiff for this file.

REBASED
pegasus/lib/jwt.ml

This patch was likely rebased, as context lines do not match.

ERROR
pegasus/lib/oauth/client.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/oauth/constants.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/oauth/dpop.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/oauth/queries.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/oauth/types.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/plc.ml

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/components/button.mlx

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/components/input.mlx

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/icons/circle_alert.mlx

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/layout.mlx

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/login.mlx

Failed to calculate interdiff for this file.

ERROR
pegasus/lib/templates/oauth_authorize.mlx

Failed to calculate interdiff for this file.

REBASED
pegasus/lib/util.ml

This patch was likely rebased, as context lines do not match.

REBASED
pegasus/lib/xrpc.ml

This patch was likely rebased, as context lines do not match.

ERROR
public/fonts/Fragment.woff

Failed to calculate interdiff for this file.

ERROR
public/fonts/Fragment.woff2

Failed to calculate interdiff for this file.

ERROR
public/main.css

Failed to calculate interdiff for this file.

ERROR
tailwindcss.opam

Failed to calculate interdiff for this file.

ERROR
tools/tailwindcss/dune

Failed to calculate interdiff for this file.

NEW
ipld/lib/dag_cbor.ml
··· 197 197 write_type_and_argument t 5 (Int64.of_int len) ; 198 198 ordered_map_keys m 199 199 |> List.iter (fun k -> 200 - write_string t k ; 201 - write_value t (String_map.find k m) ) 200 + write_string t k ; 201 + write_value t (String_map.find k m) ) 202 202 | `Link cid -> 203 203 write_cid t cid 204 204
NEW
ipld/test/test_dag_cbor.ml
··· 3 3 let rec stringify_map m = 4 4 String_map.bindings m 5 5 |> List.map (fun (k, v) -> 6 - Format.sprintf "\"%s\": %s" k (stringify_ipld_value v) ) 6 + Format.sprintf "\"%s\": %s" k (stringify_ipld_value v) ) 7 7 |> String.concat ", " |> Format.sprintf "{%s}" 8 8 9 9 and stringify_ipld_value (value : Dag_cbor.value) = ··· 109 109 Hashtbl.add cases (to_base_16 (Dag_cbor.encode `Null)) (Bytes.of_string "f6") ; 110 110 cases 111 111 |> Hashtbl.iter (fun key value -> 112 - Alcotest.(check bytes) 113 - ("encoded bytes for " ^ key) 114 - value (Bytes.of_string key) ) 112 + Alcotest.(check bytes) 113 + ("encoded bytes for " ^ key) 114 + value (Bytes.of_string key) ) 115 115 116 116 let test_round_trip () = 117 117 let test_cid =
NEW
mist/test/test_util.ml
··· 8 8 Hashtbl.add cases "app.bsky.feed.post/9adeb165882c" 8 ; 9 9 cases 10 10 |> Hashtbl.iter (fun key value -> 11 - Alcotest.(check int) 12 - ("leading zeros on hash " ^ key) 13 - value 14 - (leading_zeros_on_hash key) ) 11 + Alcotest.(check int) 12 + ("leading zeros on hash " ^ key) 13 + value 14 + (leading_zeros_on_hash key) ) 15 15 16 16 let test_shared_prefix_length () = 17 17 let cases = Hashtbl.create 5 in ··· 22 22 Hashtbl.add cases ("2653ae71", "0653ae71") 0 ; 23 23 cases 24 24 |> Hashtbl.iter (fun (a, b) value -> 25 - Alcotest.(check int) 26 - ("prefix length between " ^ a ^ " and " ^ b) 27 - value (shared_prefix_length a b) ) 25 + Alcotest.(check int) 26 + ("prefix length between " ^ a ^ " and " ^ b) 27 + value (shared_prefix_length a b) ) 28 28 29 29 let () = 30 30 Alcotest.run "util"
NEW
pegasus/lib/api/identity/resolveHandle.ml
··· 14 14 Dream.json @@ Yojson.Safe.to_string 15 15 @@ response_to_yojson {did= actor.did} 16 16 | None -> ( 17 - match%lwt Id_resolver.Handle.resolve handle with 18 - | Ok did -> 19 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {did} 20 - | Error e -> 21 - Errors.log_exn (Failure e) ; 22 - Errors.internal_error ~msg:"could not resolve handle" () ) ) 17 + match%lwt Id_resolver.Handle.resolve handle with 18 + | Ok did -> 19 + Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {did} 20 + | Error e -> 21 + Errors.log_exn (Failure e) ; 22 + Errors.internal_error ~msg:"could not resolve handle" () ) )
NEW
pegasus/lib/api/repo/createAccount.ml
··· 57 57 let%lwt did = 58 58 match input.did with 59 59 | Some did -> ( 60 - match%lwt Data_store.get_actor_by_identifier did ctx.db with 61 - | Some _ -> 62 - Errors.invalid_request "an account with that did already exists" 63 - | None -> 64 - Lwt.return did ) 60 + match%lwt Data_store.get_actor_by_identifier did ctx.db with 61 + | Some _ -> 62 + Errors.invalid_request "an account with that did already exists" 63 + | None -> 64 + Lwt.return did ) 65 65 | None -> ( 66 66 let sk_did = Kleidos.K256.pubkey_to_did_key signing_pubkey in 67 67 let rotation_did_keys = ··· 79 79 let%lwt _ = 80 80 match input.invite_code with 81 81 | Some code -> ( 82 - match%lwt Data_store.use_invite ~code ctx.db with 83 - | Some _ -> 84 - Lwt.return () 85 - | None -> 86 - failwith "failed to use invite code" ) 82 + match%lwt Data_store.use_invite ~code ctx.db with 83 + | Some _ -> 84 + Lwt.return () 85 + | None -> 86 + failwith "failed to use invite code" ) 87 87 | None -> 88 88 Lwt.return () 89 89 in
NEW
pegasus/lib/repository.ml
··· 180 180 let%lwt map = get_map t in 181 181 String_map.bindings map 182 182 |> List.filter (fun (path, _) -> 183 - String.starts_with ~prefix:(path ^ "/") collection ) 183 + String.starts_with ~prefix:(path ^ "/") collection ) 184 184 |> Lwt_list.fold_left_s 185 185 (fun acc (path, cid) -> 186 186 match%lwt User_store.get_record t.db path with ··· 320 320 let%lwt () = 321 321 match old_cid with 322 322 | Some _ -> ( 323 - match%lwt User_store.get_record t.db path with 324 - | Some record -> 325 - let refs = 326 - Util.find_blob_refs record.value 327 - |> List.map (fun (r : Mist.Blob_ref.t) -> r.ref) 328 - in 329 - let%lwt () = User_store.clear_blob_refs t.db path refs in 330 - Lwt.return_unit 331 - | None -> 332 - Lwt.return_unit ) 323 + match%lwt User_store.get_record t.db path with 324 + | Some record -> 325 + let refs = 326 + Util.find_blob_refs record.value 327 + |> List.map (fun (r : Mist.Blob_ref.t) -> r.ref) 328 + in 329 + let%lwt () = User_store.clear_blob_refs t.db path refs in 330 + Lwt.return_unit 331 + | None -> 332 + Lwt.return_unit ) 333 333 | None -> 334 334 Lwt.return_unit 335 335 in
NEW
pegasus/lib/sequencer.ml
··· 330 330 let blobs = 331 331 j |> member "blobs" |> to_list 332 332 |> List.filter_map (fun x -> 333 - match Cid.of_yojson x with Ok c -> Some c | _ -> None ) 333 + match Cid.of_yojson x with Ok c -> Some c | _ -> None ) 334 334 in 335 335 let prev_data = 336 336 match j |> member "prevData" with ··· 342 342 let ops = 343 343 j |> member "ops" |> to_list 344 344 |> List.map (fun opj -> 345 - let action = 346 - match opj |> member "action" |> to_string with 347 - | "create" -> 348 - `Create 349 - | "update" -> 350 - `Update 351 - | "delete" -> 352 - `Delete 353 - | _ -> 354 - `Create 355 - in 356 - let path = opj |> member "path" |> to_string in 357 - let cid = 358 - match opj |> member "cid" with 359 - | `Null -> 360 - None 361 - | v -> ( 362 - match Cid.of_yojson v with Ok c -> Some c | _ -> None ) 363 - in 364 - let prev = 365 - match opj |> member "prev" with 366 - | `Null -> 367 - None 368 - | v -> ( 369 - match Cid.of_yojson v with Ok c -> Some c | _ -> None ) 370 - in 371 - {action; path; cid; prev} ) 345 + let action = 346 + match opj |> member "action" |> to_string with 347 + | "create" -> 348 + `Create 349 + | "update" -> 350 + `Update 351 + | "delete" -> 352 + `Delete 353 + | _ -> 354 + `Create 355 + in 356 + let path = opj |> member "path" |> to_string in 357 + let cid = 358 + match opj |> member "cid" with 359 + | `Null -> 360 + None 361 + | v -> ( 362 + match Cid.of_yojson v with Ok c -> Some c | _ -> None ) 363 + in 364 + let prev = 365 + match opj |> member "prev" with 366 + | `Null -> 367 + None 368 + | v -> ( 369 + match Cid.of_yojson v with Ok c -> Some c | _ -> None ) 370 + in 371 + {action; path; cid; prev} ) 372 372 in 373 373 Ok 374 374 { rebase
NEW
pegasus/lib/user_store.ml
··· 386 386 let get_record t path : record option Lwt.t = 387 387 Util.use_pool t.db @@ Queries.get_record ~path 388 388 >|= Option.map (fun (cid, data, since) -> 389 - {path; cid; value= Lex.of_cbor data; since} ) 389 + {path; cid; value= Lex.of_cbor data; since} ) 390 390 391 391 let list_records t ?(limit = 100) ?(cursor = "") ?(reverse = false) collection : 392 392 record list Lwt.t = ··· 395 395 in 396 396 Util.use_pool t.db @@ fn ~collection ~limit ~cursor 397 397 >|= List.map (fun (path, cid, data, since) -> 398 - {path; cid; value= Lex.of_cbor data; since} ) 398 + {path; cid; value= Lex.of_cbor data; since} ) 399 399 400 400 let put_record t record path : (Cid.t * bytes) Lwt.t = 401 401 let cid, data = Lex.to_cbor_block record in