Commit Graph
71 Commits
Author SHA1 Message Date
Jannik Peters 907a63438c Fix error without keys 2024-11-21 16:42:28 +01:00
Jannik Peters 32ca8f7ca0 Fix writing to stdout or file 2024-11-21 16:40:41 +01:00
Jannik Peters f46fdd9683 Format 2024-11-20 12:53:29 +01:00
Jannik Peters 9cdba55750 Merge branch 'main' into add-ldns-like-sign-zone-support 2024-11-20 12:39:23 +01:00
Terts DiepraamandGitHub 511c8f1f6a Implement Key2ds (#2) 2024-11-19 13:45:18 +01:00
Terts DiepraamandGitHub a014f13c09 Make the output of Env::std{out, err} a concrete type (#27)
* make the output of Env::std{out, err} a concrete type

* document why the unwrap in write_fmt is okay
2024-11-15 16:13:35 +01:00
18d56a6431 Introduce an Env trait to mock the outside world (#23)
* introduce and Env trait to mock the outside world

* make argument parsing unit-testable

* add get_stderr to FakeEnv

* fakecmd and print errors into the env

* change ExitCode::from to into

Co-authored-by: Ximon Eighteen <3304436+ximon18@users.noreply.github.com>

* update some comments

* cargo fmt

* document some more of the testing utilities

* use exit_code method on clap errors

* bump minimal clap version

* reexport RealEnv

* remove .lock() calls for stdout and stderr

* remove args field from FakeCmd

* improve docs for Env

* cargo fmt

* use mutex in FakeStream

* improve FmtWriter implementation for a tiny bit more performance

* car go ffffffmmmmmmtttttt

---------

Co-authored-by: Ximon Eighteen <3304436+ximon18@users.noreply.github.com>
2024-11-15 13:47:18 +01:00
Terts DiepraamandGitHub 5874f11dcc Add ldns binary for easier testing of ldns tools (#20) 2024-11-12 16:34:08 +01:00
Ximon Eighteen edd863826b Update ldns-signzone to use new lexopt parser. Change dnst signzone default number of NSEC3 iterations to zero to match RFC 9276. 2024-11-11 23:11:00 +01:00
Ximon Eighteen 01dba27868 Merge branch 'main' into add-ldns-like-sign-zone-support 2024-11-11 23:02:04 +01:00
8dc82c7ff6 Add context tracking for errors (#18)
* [error] Introduce context tracking

* [error] Add an extension trait to 'Result'

* [error] Move pretty-printing to explicit function

* Pretty-print errors on exit

* [erro] Fix primary field documentation

---------

Co-authored-by: arya dradjica <arya@nlnetlabs.nl>
2024-11-11 19:55:46 +01:00
bae3b00041 Separate ldns parsing from clap parsing (#19)
* Separate ldns parsing from clap parsing

Co-authored-by: Jannik Peters <jannik@nlnetlabs.nl>

* nsec3-hash: sort ldns argument parsing alphabetically

* abort ldns parsing early on malfored argv[0]

* add 'Error' prefix to ldns parsing errors

* use clap default exit code of 2 for dnst versions of commands

* remove args_overide_self from nsec3hash

* move parse_os and parse_os_with out of LdnsCommand

---------

Co-authored-by: Jannik Peters <jannik@nlnetlabs.nl>
2024-11-11 15:52:26 +01:00
Ximon Eighteen df8426976d Remove guidance concerning key files in help text which is correct for ldns-signzone but not yet supported by dnst signzone.
Also, remove hard-coded line breaks in the help tetx so that the terminal can wrap the text as it will the rest of the help.
2024-11-08 13:30:04 +01:00
Ximon Eighteen a82778af0b Use new domain key size support to output size = 256b or similar in DNSKEY RR comments to match ldns-signzone behaviour. 2024-11-08 13:25:06 +01:00
Ximon Eighteen 44c9a25a81 Also output DNSKEY RR comments when -b is not provided, to match ldns-signzone behaviour. 2024-11-07 22:12:46 +01:00
Ximon Eighteen 8d6b807a1f Add support for -u including its undocumented +1 behaviour. 2024-11-07 14:32:03 +01:00
Ximon Eighteen 231f0c74ec Cleanup imports. 2024-11-07 13:19:53 +01:00
Ximon Eighteen da4737f423 Make -f <zonefile>.signed the default behaviour. 2024-11-07 13:18:32 +01:00
Ximon Eighteen 3e11af384c Add '-f' support.
Add multiple '-b' support to override disabling of '-b' when '-f -' is used.
2024-11-07 13:05:02 +01:00
Ximon Eighteen 4ff8107ebe Add '-f' support.
Add multiple '-b' support to override disabling of '-b' when '-f -' is used.
2024-11-07 13:03:52 +01:00
Ximon Eighteen 4a2bca8bd1 Move long help comments to after help to better match ldns-signzone. 2024-11-07 13:01:57 +01:00
Ximon Eighteen 76df433ad7 Cargo fmt. 2024-11-07 11:40:04 +01:00
Ximon Eighteen bb97b000fd Add long help for timestamp command line arguments indicating the supported formats. 2024-11-07 11:39:53 +01:00
Ximon Eighteen 6ec558f6bc Override the default origin command line argument shown value name. 2024-11-07 11:37:48 +01:00
Ximon Eighteen f1e3a465d4 Fix CLI help text for inception and expiration date, change the value name shown and show better default value text. 2024-11-07 11:35:24 +01:00
Ximon Eighteen fe7dbda14d Add inception and expiration command line argument support. 2024-11-07 11:30:08 +01:00
Ximon Eighteen 1f1b7efff5 Add a comment about spacing and compatibility. 2024-11-07 10:52:35 +01:00
Ximon Eighteen 581d4e612f Fix incorrect comment output: {{ was doubled to escape it when using write! but Stdout doesn't implement the required traits for write!. 2024-11-07 10:51:14 +01:00
Ximon Eighteen a886428c17 Caro fmt. 2024-11-07 10:17:38 +01:00
Ximon Eighteen 0d9289e105 Prepare to add missing ldns-signzone command line options. 2024-11-07 10:13:31 +01:00
Ximon Eighteen 0d1c7c33c7 Missing > bracket in comments. 2024-11-07 00:39:06 +01:00
Ximon Eighteen e860ec8c1b Clippy. 2024-11-07 00:38:00 +01:00
Ximon Eighteen 3de9a514e2 Clippy. 2024-11-07 00:30:18 +01:00
Ximon Eighteen 178f5546a8 Even closer -b output to that of ldns-signzone. 2024-11-07 00:27:03 +01:00
Ximon Eighteen 16cbd2218d Even closer -b output to that of ldns-signzone. 2024-11-06 23:56:20 +01:00
Ximon Eighteen b7a7ef3988 Even closer -b output to that of ldns-signzone. 2024-11-06 23:54:24 +01:00
Ximon Eighteen a433f4cc3c Update domain and align -b output more closely to that of ldns-signzone. 2024-11-06 23:47:17 +01:00
Ximon Eighteen 52f390215e Cargo fmt. 2024-11-05 17:03:32 +01:00
Ximon Eighteen 54c8397aa0 Add missing blank line. 2024-11-05 17:01:26 +01:00
Ximon Eighteen bd7f9472fa Finish incomplete RustDoc comment. 2024-11-05 17:01:12 +01:00
Ximon Eighteen c2251dbca5 Review feedback: Use let ... map_err. 2024-11-05 16:58:52 +01:00
Ximon Eighteen f64050c32a Typo correction. 2024-11-05 16:57:40 +01:00
Ximon Eighteen ce3f792b8c Review feedback: Return crate error type. 2024-11-05 16:57:11 +01:00
Ximon Eighteen 3ef74b2685 Clippy. 2024-11-05 16:56:47 +01:00
Ximon Eighteen c487776354 Review feedback: Don't panic on invalid zone content. 2024-11-05 16:54:42 +01:00
Ximon Eighteen 3f39d2f25d Review feedback: & instead of .as_path(). 2024-11-05 16:51:57 +01:00
Ximon Eighteen 91df226171 Review feedback: clone() instead of to_owned(). 2024-11-05 16:51:41 +01:00
Ximon Eighteen 1410cccdce Review feedback: extract key loading to helper function. 2024-11-05 16:48:18 +01:00
Ximon Eighteen b9e3c5dc10 Review feedback: clone() instead of to_owned(). 2024-11-05 15:44:09 +01:00
Ximon Eighteen 96a1a28b21 Review feedback: Import more types. 2024-11-05 15:42:54 +01:00