Skip to content
Snippets Groups Projects
  1. Apr 08, 2025
    • poka's avatar
      feat: Can choose between ed25519 ans sr25519 (!44) · bb54cc00
      poka authored and Nicolas80's avatar Nicolas80 committed
      * * Updated CHANGELOG.md
      
      * * Updated CHANGELOG.md with `vault inspect` changes
      
      * * Added extra data in `vault inspect` command
        * Secret seed/mini-secret (if no soft derivation is used)
        * Public key (hex)
        * SS58 Address
        * (potential G1v1 public key if inspecting a <Base> account with ed25519 crypto-scheme)
      * Does most changes mentioned in Issue #28 (except the network id)
      
      * * Small change to be in line with the adapted parameter descriptions
      
      * * Refactored method get_keypair_from_secret_provider into SecretProvider internal method get_keypair
      * Added long_about for `LinkAccount` and `ChangeOwnerKey` to explain the target identity/account is provided with the options of those commands.
      * Applied cargo fmt
      
      * * Renamed AccountLinkParams to SecretProvider and adapted descriptions to "target account" instead of "account to link" which makes it a bit more generic
      * Added generic method get_keypair_from_secret_provider that returns the keypair or an error
      * Adapted `LinkAccount` & `ChangeOwnerKey` to use those
      * Not sure the best place for the SecretProvider and new method - leaving in identity for now
      
      * * Small refactoring to move method to vault.rs
      
      * * Small change to show the linked `<Base>` account if different from the one we inspect.
      
      * * Updated CHANGELOG.md
      
      * Code review:
      
      * Adapted commands identity `LinkAccount` & `ChangeOwnerKey`
        * Added possibility to provide
          * `-a` address of vault account to link
          * `-v` name of vault account to link
        * `-S` (secret_format) doesn't have a default anymore since it conflicts with using `-a` or `-v`
        * Added an error message if none of the params are provided
      
      * * Small clippy cleanup
      
      * * Changed sorting of children account so that they are sorted by Path value (makes more sense when viewing derivations of one account)
      * Added display of "Crypto scheme" when making `vault inspect` so that it is more coherent
      
      * Code review:
      
      * Cleanup of keys.rs get_keypair method since it always gets a crypto_scheme.
        * Removed "default" values in the method
        * Relying on "default" value of `-c` / `--crypto-scheme` argument (present in several places) which is ed25519
      
      * Code review:
      
      * Small comment cleanup
      * Code cleanup removed unnecessary empty cells in "g1v1" row
      * Added doc on prompt_secret_substrate_and_compute_keypair method to explain the values returned in the tuple.
      
      * * Updated version to 0.4.1
      * Added Changelog entry for the new version
      * Adapted some of the examples in config.md to take into account the new `-c` argument
      ** Did a simple addition of "-c sr25519" so that current examples still make sense and link to the same SS58 addresses
      
      * Added extra message when the DB parsing of DbAccountId fails, so we know for which string it failed.
      
      * * reverted most of the commit e9cd6a99: "Add secret format in database and display"
      
      * * Adapted catch_known of predefined derivations to properly handle both sr25519 and ed25519 versions of those keys.
      
      * * Added some logic between arguments of `vault import`; can't provide both `password` and `no-password`
      ** Added extra validation of non-interactive `name` argument value (same validation as when interactive: no '<', '>', '/' characters)
      * Added possibility to make a non-interactive derivation (given proper arguments are given and there is no issue found during the process)
      ** Added same validation for non-interactive `derivation_path` argument as when interactive
      ** If the same resulting address is already in the vault; interaction is still mandatory to make a choice
      * Had to change the name of argument AddressOrVaultNameGroup.name => vault_name to avoid conflict in `vault derive`
      ** Not changing the `-v` shortcut so no impact on existing commands
      * Allowing to pass "" empty string as non-interactive `name` argument and considering it as None (does a trim before checking empty; so only spaces will be considered as None as well)
      
      * * Adding `-c` crypto scheme parameter (with default ed25519) in different places
      ** as global parameter (taken into account if `-S` parameter is given
      ** as extra parameter for identity.rs commands LinkAccount & ChangeOwnerKey
      *** Also added a simple display of "target" address and crypto-scheme when performing those commands
      
      * * Fix for `vault migrate` that should use sr25519 scheme to be consistent
      
      * * Small fix in doc of function
      * Applied `cargo fmt`
      
      * add non interactive mode
      
      * remove unused methods
      
      * Add secret format in database and display
      
      * apply nico review
      
      * feat: Can choose between ed25519 ans sr25519
      0.4.1
      bb54cc00
  2. Feb 13, 2025
    • Moul's avatar
      Adapt linux build now depending on libssl-dev. Introduce tests job (#45, #46)... · 5dd41657
      Moul authored
      Adapt linux build now depending on libssl-dev. Introduce tests job (#45, #46) (!42)
      
      * Adapt linux build now depending on libssl-dev (#45)
      
      native-tls transitive dependency introduced in !41
      which requires libssl-dev package installed
      for the build to find ssl components
      
      Switching to non-slim Debian image which comes
      with libssl-dev pre-installed
      
      Introduce linux tests job: to run tests (#46)
      and prevent similar issue in the future
      
      Update changelog
      0.4.0
      5dd41657
  3. Feb 09, 2025
  4. Feb 08, 2025
    • Nicolas80's avatar
      * Re-did the mapping of DbAccountId so that we don't have to rely on derive... · 89bde1dd
      Nicolas80 authored
      * Re-did the mapping of DbAccountId so that we don't have to rely on derive macro FromJsonQueryResult that resulted in using JSON_TEXT in database column instead of VARCHAR
         * Tricky part I missed the first time was in impl of sea_orm::TryGetable::try_get_by where we should return Err TryGetError::Null in case the value is not present
         * Was otherwise throwing an exception whenever `parent` field (Option<DbAccountId>) was None when trying to persist the case in DB.
      89bde1dd
    • Nicolas80's avatar
      * Adapted data::keypair() method so it doesn't block the user's terminal anymore · 07ea8692
      Nicolas80 authored
         * Now checking if GcliError Input message was for doing "ctrl+c" or "Esc" key in a prompt; in wich case we terminate the execution with the message.
         * Small correction in vault_account::compute_suri_account_tree_node where it's better to return GcliError instead of panic using unwrap if the password was incorrect.
      * Renamed `clap` arguments "value_name" in different places where it wasn't clear what kind of value was expected.
         * Using "ADDRESS" everytime we expect an AccountId
         * Using "USERNAME" everytime we expect a Username (most were requesting "TARGET")
      * Small corrections in `clap` help messages for `vault derive`
      * Added print of selected Vault item when using vault::try_fetch_key_pair method; just before requesting it's associated password (whenever we will try to sign for an action mostly)
      07ea8692
    • Nicolas80's avatar
      * Added support to show g1v1 base58 public key from (ed25519) ss58 address,... · 66c7c2a8
      Nicolas80 authored
      * Added support to show g1v1 base58 public key from (ed25519) ss58 address, AccountId, ed25519::Public with tests for those
      * Renamed SecretFormat.Cesium to SecretFormat.G1v1
         * Adapted `clap` display help to reflect the change
         * Still supporting using "cesium" as "-S" secret format argument and mapping it to SecretFormat.G1v1
      * Adapted display of vault
         * Changed column "Format" into "Crypto", showing either "ed25519" or "sr25519" instead of "cesium" or "substrate"
         * Adapted 1st row header to "SS58 Address/G1v1 public key"
         * For "ed25519" account, showing a 2nd row just below containing "└ G1v1: <base58 public key value>"
         * Adapted test cases and added a G1v1 account example
      * Adapted (String) Display of vault_account to include "g1v1_pub_key" value when crypto_scheme is Ed25519
      66c7c2a8
  5. Feb 05, 2025
  6. Feb 03, 2025
  7. Feb 01, 2025
    • Nicolas80's avatar
      * Small clean up of `clap` arguments · ab6169b1
      Nicolas80 authored
         * Put back simple `address` and `name` arguments in main.rs (with conflicts_with statement to prevent their usage at the same time)
         * Declared conflicts between indexer <=> no-indexer, indexer <=> network, url <=> network
         * Kept AddressOrVaultNameGroup args for vault usage since it's the only way to define one required arg within a group cleanly
      ab6169b1
    • Nicolas80's avatar
      * Small cleanup refactoring · 0b9222c2
      Nicolas80 authored
      0b9222c2
  8. Jan 31, 2025
  9. Jan 26, 2025
    • Nicolas80's avatar
      * Added sc_cli::arg_enums::CryptoScheme partial copy in keys.rs · 3d7b15c0
      Nicolas80 authored
      * Started to investigate being able to make subkey command and trying to use sp_core::crypto::CryptoType instead of custom KeyPair
      * Big refactoring to have all in one vault_account db table; using recursion through `parent` property
      * Added AccountTreeNode object and related methods to be able to more easily handle whole tree of accounts
      * Removed now unused vault_derivation
      * Replaced remaining usages of `rpassword` and removed the dependency
      * Added `indoc` dependency to support cleaner display of multi-line strings in tests
      3d7b15c0
  10. Jan 18, 2025
  11. Jan 15, 2025
  12. Jan 06, 2025
  13. Jan 04, 2025
  14. Jan 03, 2025
  15. Jan 02, 2025
  16. Jan 01, 2025
  17. Dec 31, 2024
    • Nicolas80's avatar
      * Adapted to have more coherent commands descriptions and added `long_about`... · cf7a4292
      Nicolas80 authored
      * Adapted to have more coherent commands descriptions and added `long_about` more detailed description for `import` and `derivation`
      * Added the `vault list for` command
      * Added display of "format" of <Root> derivations in all `vault list` commands
      * Only allowing derivations for format "substrate" and "seed"
      cf7a4292
  18. Dec 29, 2024
  19. Dec 28, 2024
    • Nicolas80's avatar
      Adding db persistence for all SecretFormat of vault keys as well as supporting derivations · badf52ce
      Nicolas80 authored
      * Added "/.idea" exclusion in .gitignore (for when using JetBrains IDEs)
      * Added dialoguer dependency for easier user input handling (see in inputs.rs)
      * Added sea-orm dependency to allow having DB entity mappings and use a local sqlite file database
      * Added rstest test dependency for parameterized tests support
      * Added derivation tests for each SecretFormat (including cesium v1 key derivation, using sp_core::ed25519::Pair)
      * Made a lot of changes to add vault_account and vault_derivation db tables to persist vault keys & derivations
      * Added support for KeyPair::Ed25519 linking to sp_core::ed25519::Pair which can be created from secret seed retrieved from nacl::sign::Keypair (which is created from cesium id + secret)
      ** This was necessary to allow deriving keys from "cesium v1" keys (to be reviewed - it might be a bad idea to permit that from a security point of view)
      * Only kept original (substrate) keyfiles support for migration (use "vault list-files" and "vault migrate")
      * Added possibility to give either "-a" Address or "-v" Vault Name as general option
      * Added extra commands in Vault
      ** list-files: (deprecated)List available key files (needs to be migrated with command "vault migrate" in order to use them)
      ** migrate: (deprecated)Migrate old key files into db (will have to provide password for each key)
      ** 'list' now has sub-commands 'all' or 'root' to show all keys or only root keys (without derivation path)
      ** use: "Use specific vault key (changes the config address)", which will have the same behaviour as `gcli <-a <Address>|-v <VaultName>> config save` (left a FIXME in there to review)
      ** derivation: Add a derivation to an existing (root) vault key
      ** rename: Give a meaningful vault name to a vault key or derivation
      ** remove: Remove a vault key (and potential derivations if it's a root key)
      * Had to bubble up "await" and "async" in a lot of places
      * ...
      badf52ce
  20. Dec 08, 2024
  21. Oct 23, 2024
  22. Oct 10, 2024
Loading