Skip to content
Snippets Groups Projects

Wizard key structopts

Merged inso requested to merge wizard_key_structopts into dev
1 unresolved thread

Implements the following command using new structopts paramters style :

durs keys modify member --salt [salt] --password [password]
durs keys modify network --salt [salt] --password [password]
durs keys delete member # remove the member key
durs keys delete network # reset the network key to a new random one
durs keys show
durs keys wizard

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Éloïs
  • inso added 3 commits

    added 3 commits

    Compare with previous version

  • inso resolved all discussions

    resolved all discussions

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • Éloïs
  • @Insoleet I detect a bug in show subcommand :

    I used the wizard command to create a member keypair for myself, it worked very well, my member keypair was well written in the file.
    But the show command says No member key configured. Can you reproduce this ?

    In addition, keep in mind that warning clippies will have to be fixed before they can be merged :)

    Edited by Éloïs
  • inso added 1 commit

    added 1 commit

    • 92440d9e - Load member keypair on startup

    Compare with previous version

  • Author Contributor

    I thought it was intended because it was the behaviour before I started working on these commands.

    Fixed in latest commit.

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • @Insoleet i find a bug in show command :

    ./target/debug/durs keys show
    Network key : (BoZP6aqtErHjiKLosLrQxBafi4ATciyDZQ6XRQkNefqG, hidden)
    Member key : (BoZP6aqtErHjiKLosLrQxBafi4ATciyDZQ6XRQkNefqG, hidden)

    My keypairs file content :

    {
      "network_sec": "(hidden for security reason)",
      "network_pub": "BoZP6aqtErHjiKLosLrQxBafi4ATciyDZQ6XRQkNefqG",
      "member_sec": "(hidden for security reason)",
      "member_pub": "D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx"
    }

    So, at member key line we expected D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx instead of BoZP6aqtErHjiKLosLrQxBafi4ATciyDZQ6XRQkNefqG.

    Edited by Éloïs
  • inso added 18 commits

    added 18 commits

    Compare with previous version

  • Author Contributor

    The bug and the clippy warnings should be fixed. I rebased from latest dev branch too.

  • inso added 15 commits

    added 15 commits

    Compare with previous version

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • inso added 8 commits

    added 8 commits

    Compare with previous version

  • Author Contributor

    It should be better now ?

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • It should be better now ?

    Yes, but not yet mergeable :

    Edited by Éloïs
  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • inso added 1 commit

    added 1 commit

    Compare with previous version

  • conf/keys.rs 0 → 100644
    57
    58 /// Modify member keys command
    59 pub fn modify_member_keys(
    60 salt: &str,
    61 password: &str,
    62 mut key_pairs: DuniterKeyPairs,
    63 ) -> DuniterKeyPairs {
    64 let generator = ed25519::KeyPairFromSaltedPasswordGenerator::with_default_parameters();
    65 key_pairs.member_keypair = Some(KeyPairEnum::Ed25519(
    66 generator.generate(salt.as_bytes(), password.as_bytes()),
    67 ));
    68 key_pairs
    69 }
    70
    71 /// Clear keys command
    72 pub fn clear_keys(network: bool, member: bool, mut key_pairs: DuniterKeyPairs) -> DuniterKeyPairs {
    • To modify DuniterKeyPairs you need to get a mutable reference &mut. Here the mut keyword alone does not transform your parameter into a reference, so the function gets a copy... that's why the clean command doesn't work!

    • Author Contributor

      No, the clean command does work, but you have to specify which key to clear (either --all or --member or --network).

    • Please register or sign in to reply
  • inso added 1 commit

    added 1 commit

    • 40aac9d0 - Add a text message to clear command

    Compare with previous version

  • Éloïs added 1 commit

    added 1 commit

    • 53c73c6f - [ref] core/cli: add short name for clear options & author all keys sub

    Compare with previous version

  • Éloïs added 12 commits

    added 12 commits

    Compare with previous version

  • Éloïs enabled an automatic merge when the pipeline for d6b4642a succeeds

    enabled an automatic merge when the pipeline for d6b4642a succeeds

  • merged

  • Éloïs mentioned in commit f016ab94

    mentioned in commit f016ab94

  • added C-crypto label

  • Please register or sign in to reply
    Loading