snix/tvix/nix-compat/src
Florian Klink e03ea11bad feat(nix-compat/nix_http): init parse_nar[info]_str
This moves the URL component parsing code we had in nar-bridge to
nix-compat.

We change the function signature to return an Option, not a
Result<_, StatusCode>.

This allows returning more appropriate error codes, as we can
ok_or(…) at the callsite, which we now do: on an upload to an
invalid path, we now return "unauthorized", while on a GET/HEAD, we
return "not found".

This also adds support to parse compression suffixes. While not
supported in nar-bridge, other users of nix-compat might very well want
to parse these paths.

Also fix the error message when parsing NAR urls, it mentioned 32, not
52, which is a copypasta error from the narinfo URL parsing code.

Change-Id: Id1be9a8044814b54ce68b125c52dfe933c9c4f74
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12260
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-08-21 09:40:32 +00:00
..
aterm refactor(nix-compat/aterm): update function names a bit 2024-08-20 15:14:27 +00:00
bin feat(tvix): Jemalloc -> MiMalloc 2024-08-08 08:06:23 +00:00
derivation refactor(nix-compat/store_path): make StorePath generic on S 2024-08-20 15:14:27 +00:00
nar feat(tvix/nix-compat): entry locator in listing structures 2024-08-19 22:32:09 +00:00
narinfo feat(nix-compat/narinfo/signature): generalize name field 2024-08-19 19:46:34 +00:00
nix_daemon chore(nix-compat): Document daemon protocol version 2024-05-02 16:04:13 +00:00
nix_http feat(nix-compat/nix_http): init parse_nar[info]_str 2024-08-21 09:40:32 +00:00
nixcpp refactor(tvix/nix-compat): rename PubKey to VerifyingKey 2024-07-21 21:41:54 +00:00
nixhash refactor(tvix/nix-compat): introduce CaHash::algo_str 2024-07-27 10:53:56 +00:00
store_path refactor(nix-compat/store_path): make StorePath generic on S 2024-08-20 15:14:27 +00:00
wire fix(tvix/nix-compat): use buf.filled() to track read bytes 2024-07-18 22:13:44 +00:00
lib.rs feat(nix-compat/nix_http): init parse_nar[info]_str 2024-08-21 09:40:32 +00:00
nixbase32.rs fix(tvix/nix-compat): Fix panic in nixbase32 decoding 2024-07-28 20:55:51 +00:00
path_info.rs feat(tvix/nix-compat/path_info): derive Hash for ExportedPathInfo 2024-04-13 21:41:47 +00:00