74 Commits

Author SHA1 Message Date
Zeke Fast
f8c4871b61 Add "rstest" as dev-dependency to hagrid's Cargo.toml.
Additional changes:
- Update Cargo.lock: `just build`
2025-09-28 01:27:27 +00:00
Vincent Breitmoser
8b89ab112a version 2.1.0 2025-08-01 10:05:50 +02:00
Vincent Breitmoser
7d3194dd25 cargo: cargo update 2025-08-01 10:01:20 +02:00
Zeke Fast
ca7d0406cf Upgrade rocket and related crates.
Changes:
- Upgrade the following crate dependencies in Cargo.toml:
  - log: 0.4.22 -> 0.4.27
  - rocket_dyn_templates: 0.1.0 -> 0.2.0
  - rocket_prometheus: 0.10.0 -> 0.10.1
  - handlebars: 4.5.0 -> 5.1.2 (indirect dependency of rocket_dyn_templates)
- Update Cargo.lock.
2025-05-12 08:15:44 +00:00
Zeke Fast
9c4b51fa61 Merge "hagrid-delete" binary into "hagridctl" crate.
Code review issue: https://gitlab.com/keys.openpgp.org/hagrid/-/merge_requests/214#note_2482960066

Changes:
- Remove "hagrid-delete" bin declaration from Cargo.toml.
- Remove "clap" dependency for "hagrid" crate in Cargo.toml as after
  moving "hagrid-delete" to "hagridctl" "hagrid" crate does not use
  "clap" any more.
- Remove "run-hagrid-delete" recipe with its "hagrid-delete" and
  "delete" aliases from justfile.
- Update Cargo.lock.
- Create "delete" command for "hagridctl" by adding cli::Command::Delete
  variant which previously were hagrid-delete::cli::Cli struct.
- Move "delete" module with command handler ("run" function) from
  "hagrid" crate to hagridctl::delete.
- Extend hagridctl::cli::dispatch_cmd() function with processing of
  cli::Command::Delete variant and call to hagridctl::delete::run.
- Move print_errors() from hagrid::delete::cli module to hagrdictl::cli.
- Move KeyDatabase instantiation from hagrid/src/main.rs into
  hagridctl::delete::run command handler as this way of database
  instantiation is specific to "delete" command.
  Probably later we have to reconsider how we instantiate database for
  all the commands to avoid reimplementing that functionality every time
  and duplicating the code.
  That move caused change in signature of hagridctl::delete::run
  function. Now we pass base path instead of db reference.
2025-05-04 20:19:02 +02:00
Zeke Fast
5757ac2819 Migrate "hagrid-delete" from StructOpt to Clap v4 derive based API. Clean up code along the way.
Changes:
- Add "derive" and "unicode" features for "clap" in Cargo.toml.
- Remove dependency on "structopt" crate from Cargo.toml.
- Update Cargo.lock.
- Rename crate::delete::cli::Opt struct to Cli.
- Replace usage of #[structopt()] macros with #[derive(Parser)].
- Rename variables and function parameters from "opt" to "cli"
  accordingly.
- Don't parse opt.query in dispatch_cmd function. As Opt.query field
  type was replaced from String to Query in Cli.query new version of
  Clap automatically determines value_parser and calls FromStr::from_str
  implementation to convert str slice into field of type Query.
- Replace improrts of structopt::StructOpt with clap::Parser.
2025-05-04 11:02:01 +02:00
Zeke Fast
48ef918d51 Migrate "hagrid-tester" to Clap v4 derive based API. Clean up code along the way.
Changes:
- Add "derive" feature for "clap" in tester/Cargo.toml.
- Move about description from tester/src/cli.rs to "description" field in
  tester/Cargo.toml. So, "clap" can access it via #[command(about)]
  macro configuration.
- Update Cargo.lock.
- Replace in tester/src/cli.rs usage of clap::App from Clap 2.34.0
  with clap::Parser derive macro based API, cli::Cli struct and cli::Command
  enum.
- Remove "--config/-c <FILE>" option for "tester" as it wasn't used and
  I believe it was a copy-paste from "hagridctl".
- Omit explicit specification of args name which resulted in upper
  casing cmd option's parameters, e.g. "<cert count>" -> "<CERT_COUNT>".
- Replace in cli::dispatch_cmd() "if let" based logic with simple match
  on cli::Command enum variants.
- Get rid of manual parsing of options' and commands' values in
  cli::dispatch_cmd(). As it is hadled by derived
  value_parser (https://docs.rs/clap/latest/clap/_derive/index.html#arg-attributes)
  based on field types.
- Make "fprs_path" parameter of tester::generate::do_generate function
  obligatory (previously it was Option<&Path>) as this argument has a
  default value to "fingerprints.txt" which is populated by clap. So, it
  never be None.
  In addition, clean up logic related to optional "fprs_path" parameter
  in tester::generate::do_generate function.
- Change signatures of the following functions to accept
  "impl AsRef<Path>" instead of &Path or Option<&Path>:
  - tester::generate::do_generate()
  - tester::genreqs::do_genreqs()
  That allows us to pass as function arguments anything from which Path
  can be borrowed, e.g. PathBuf without the need to explicitly transform
  the value at call site with calls like .as_path() or .as_deref().
- Replace in tester/src/main.rs cli::app().get_matches() (which is Clap
  v2 API) with cli::Cli::parse() (Clap v4 API).
2025-05-04 10:58:49 +02:00
Zeke Fast
333727a6dc Bump "clap" dependency version in Cargo.toml: "2" -> ">= 4.5.37".
Commands:

    cargo update clap@2.34.0

Additional Changes:
- Update Cargo.lock.
2025-05-04 10:58:49 +02:00
Zeke Fast
37e6b2cb09 Remove "lazy_static" crate dependency from Cargo.toml.
Additional Changes:
- Update Cargo.lock.
2025-04-29 23:28:30 +02:00
Zeke Fast
e72c647505 Upgrade set explicit version requirement for "multipart" dependency in Cargo.toml: "0" -> "0.18".
`cargo build` gives the following warnings:

    warning: the following packages contain code that will be rejected by a future version of Rust: buf_redux v0.8.4, multipart v0.18.0, traitobject v0.1.0, typemap v0.3.3
    note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`

which is when run with `cargo build --future-incompat-report` gives the
following:

    warning: `hagrid` (bin "hagrid") generated 9 warnings
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.91s
    warning: the following packages contain code that will be rejected by a future version of Rust: buf_redux v0.8.4, multipart v0.18.0, traitobject v0.1.0, typemap v0.3.3
    note:
    To solve this problem, you can try the following approaches:

    - Some affected dependencies have newer versions available.
    You may want to consider updating them to a newer version to see if the issue has been fixed.

    traitobject v0.1.0 has the following newer versions available: 0.1.1

    - If the issue is not solved by updating the dependencies, a fix has to be
    implemented by those dependencies. You can help with that by notifying the
    maintainers of this problem (e.g. by creating a bug report) or by proposing a
    fix to the maintainers (e.g. by creating a pull request):

      - buf_redux@0.8.4
      - Repository: https://github.com/abonander/buf_redux
      - Detailed warning command: `cargo report future-incompatibilities --id 3 --package buf_redux@0.8.4`

      - multipart@0.18.0
      - Repository: http://github.com/abonander/multipart
      - Detailed warning command: `cargo report future-incompatibilities --id 3 --package multipart@0.18.0`

      - traitobject@0.1.0
      - Repository: https://github.com/reem/rust-traitobject.git
      - Detailed warning command: `cargo report future-incompatibilities --id 3 --package traitobject@0.1.0`

      - typemap@0.3.3
      - Repository: https://github.com/reem/rust-typemap
      - Detailed warning command: `cargo report future-incompatibilities --id 3 --package typemap@0.3.3`

    - If waiting for an upstream fix is not an option, you can use the `[patch]`
    section in `Cargo.toml` to use your own version of the dependency. For more
    information, see:
    https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section

    note: this report can be shown with `cargo report future-incompatibilities --id 1`

In attempt to fix the warning I set explict dependency for "multipart"
crate.

Changes:
- Set explicit version of "multipart" dependency in Cargo.toml: "0" -> "0.18.0".
- Update Cargo.lock: `cargo build`
2025-04-27 11:03:04 +02:00
Vincent Breitmoser
871cae1e24 version 2.0.1 2025-03-25 09:23:57 +01:00
Vincent Breitmoser
3293dd8f78 version 2.0 2025-02-28 22:07:16 +01:00
Vincent Breitmoser
b5b5879474 db: add DatabaseTransaction abstraction 2025-02-28 22:05:32 +01:00
Vincent Breitmoser
e0aeef7ddc mail: support sending via local smtp server 2025-02-28 21:53:25 +01:00
Vincent Breitmoser
44db398a1c cargo: downgrade sequoia-openpgp to 1.17.0 (for now)
Starting with 1.18.0, the retain_userids method starts working
differently, returning an empty cert if no signed user ids or direct key
signature is left. Since we need this, we'll stay on 1.17.0 for now.
2024-11-17 19:08:23 +01:00
Vincent Breitmoser
dca8afa1e6 cargo: cargo update 2024-11-17 13:47:22 +01:00
Vincent Breitmoser
13ddd4ff3a tester: add tester workspace, adding tools for testing 2024-03-24 13:09:04 +01:00
Vincent Breitmoser
7c7b15e37c version 1.3.0 2024-01-26 15:35:37 +01:00
Vincent Breitmoser
dfafe5cdb7 cargo: use openssl crypo backend 2024-01-26 15:35:37 +01:00
Vincent Breitmoser
da4665306e cargo: cargo update
This update requires a forked version of rocket_i18n to accommodate for
a trivial renaming in rocket v0.5.0. Can be changed back to upstream if
https://github.com/Plume-org/rocket_i18n/pull/24 is merged.
2023-12-28 13:37:45 +01:00
Vincent Breitmoser
ed624da4a4 cargo: cargo update 2023-06-10 16:16:04 +02:00
Vincent Breitmoser
5e08a7086e cargo: cargo update and fix for some deps 2022-12-10 17:42:50 +01:00
Justus Winter
dc2d67d9eb Bump sequoia-openpgp to 1.11 and synchronize src/dump.rs. 2022-12-09 12:59:42 +01:00
Vincent Breitmoser
aca0cdcdff version 1.2.1 2022-04-09 13:37:51 +02:00
Vincent Breitmoser
aa6474fd29 cargo: cargo update 2022-04-09 13:36:33 +02:00
Vincent Breitmoser
55ec155b30 mail: update to lettre-0.10.0-rc.5 and adapt 2022-04-09 13:36:33 +02:00
Vincent Breitmoser
39fae28f53 version 1.2.0 2022-03-12 15:30:51 +01:00
Vincent Breitmoser
329a9c09b0 update gettext-macros to 0.6.1 2022-02-26 16:34:57 +01:00
Nora Widdecke
8eb3984560 cargo: use rocket_prometheus 0.10.0-rc.1
Fixes #167
2022-02-15 11:35:13 +01:00
Justus Winter
fec0cc4852 web: port to handlebars 3, the version used in rocket's dyn templates 2022-02-06 22:58:29 +01:00
Justus Winter
a31d69d111 web: enable prometheus again 2022-02-06 22:58:29 +01:00
Justus Winter
f50ce6912a cargo: use published rocket_i18n, hyperx 2022-02-06 22:58:29 +01:00
Vincent Breitmoser
3f156ec8c2 cargo: update, and use rocket v0.5-rc1 2022-02-06 22:58:22 +01:00
Vincent Breitmoser
0e0b5c160a cargo: cargo update, and use recent nightly 2022-01-04 12:24:44 +01:00
Vincent Breitmoser
9d5ec287a9 cargo: update gettext-macros to patched 0.6
This should work with rust stable, once we update rocket.

Uses a patched version of gettext-macros with a bugfix for
https://github.com/Plume-org/gettext-macros/issues/16
2022-01-04 12:06:16 +01:00
Justus Winter
b8ddf58977 update sequoia-openpgp to 1.5 2021-10-25 16:04:12 +02:00
Justus Winter
8dabd2c37a update sequoia-openpgp to 1.4 2021-10-11 10:23:45 +02:00
Vincent Breitmoser
90356ddb28 update changed files from rebuild 2021-07-21 09:44:43 +02:00
Justus Winter
39c0e12ac6 database: serve first-party attested third-party certifications
This implements support for third-party userid certifications.  To
prevent denial-of-service attacks, we only merge those certifications
that are attested by the key holder.

The key holder attests the certifications using an Attested Key
Signature containing the digests of the certifications in an Attested
Certifications subpacket as specified in RFC4880bis-10.

Fixes #124.
2021-06-13 13:30:53 +02:00
Justus Winter
c98c588064 update sequoia-openpgp to 1.3 2021-06-13 10:48:59 +00:00
Vincent Breitmoser
1022e1797b version 1.0 2021-02-20 13:51:05 +01:00
Justus Winter
422cacfc9c update to Sequoia 1.0.0 2021-01-07 13:18:08 +01:00
Vincent Breitmoser
606acdde39 hagridctl: update to sequoia-0.20 2020-11-05 15:26:57 +01:00
Vincent Breitmoser
860bd6e552 update to sequoia-0.20 2020-11-04 22:21:00 +01:00
Vincent Breitmoser
2131bb1753 cargo update 2020-11-04 19:42:50 +01:00
Vincent Breitmoser
ea18c94d6e cargo update 2020-07-04 14:15:22 +02:00
Vincent Breitmoser
f0aaee2a9d update sequoia to 0.14 2020-02-28 15:13:48 +01:00
Vincent Breitmoser
deb3a0373b wkd: add support 2020-01-31 12:36:48 +01:00
Vincent Breitmoser
fa6d34384e fix runtime-fmt for nightly build 2020-01-30 01:25:48 +01:00
Vincent Breitmoser
7332e0c0f0 cargo update 2020-01-30 01:25:48 +01:00