Skip to content

Commit

Permalink
Replace auth with oberon proof scheme in CLI (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarkovski authored Nov 8, 2021
1 parent 617a215 commit 87717bc
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 254 deletions.
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ toml = "0.5"
dirs = "3.0"
yaml-rust = "0.3"
colored = "2"
blake3 = "1.2"

[build-dependencies]
tonic-build = { version = "0.6", features = ["prost", "rustfmt"] }
Expand Down
4 changes: 4 additions & 0 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ fn main() {

config
.compile_well_known_types(true)
.type_attribute(
"WalletProfile",
"#[derive(::serde::Serialize, ::serde::Deserialize, Copy)]",
)
.type_attribute(
"JsonPayload",
"#[derive(::serde::Serialize, ::serde::Deserialize)]",
Expand Down
135 changes: 0 additions & 135 deletions cli/src/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,138 +8,6 @@ about: >-
┴ ┴└─┴┘└┘└─┘┴└─┘
subcommands:
- didkey:
about: didkey commands
subcommands:
- generate:
about: Generates a Json Web Key
version: "0.1"
args:
- out:
long: out
value_name: STRING
help: File to save Json Web Key in
takes_value: true
- kty:
long: kty
value_name: STRING
help: >-
Specify key type. Defaults to X25519. Options are Ed25519,
X25519, P256, Bls12381_G2, and secp256k1.
takes_value: true
possible_values:
- Ed25519
- X25519
- P-256
- Bls12381_G2
- Secp256k1
- resolve:
about: Resolve a DID
version: "0.1"
args:
- uri:
value_name: STRING
help: DID URI to resolve
takes_value: true
required: true
- didcomm:
about: didcomm commands
subcommands:
- pack:
about: Packs a plaintext message
version: "0.1"
short: p
args:
- sender_key:
value_name: FILE
help: Sender's Json Web Key
takes_value: true
required: true
- receiver_key:
value_name: FILE
help: Receiver's Json Web Key
takes_value: true
required: true
- associated_data:
value_name: FILE
help: Associated data to be packed
takes_value: true
long: data
- plaintext:
value_name: FILE
help: Plaintext message to be packed
takes_value: true
long: text
- encryption_mode:
value_name: STRING
long: mode
help: >-
Encryption mode. Default is direct. Options are direct and
content_encryption_key
possible_values:
- direct
- content_encryption_key
- encryption_algorithm:
value_name: STRING
long: alg
help: >-
Encryption algorithm. Default is xchacha20poly1305. Options
are xchacha20poly1305 and aes_gcm
possible_values:
- xchacha20poly1305
- aes_gcm
- out:
long: out
value_name: FILE
help: output file for your packed message
- unpack:
about: Unpacks an encrypted message
version: "0.1"
short: up
args:
- sender_key:
value_name: FILE
help: Sender's Json Web Key
takes_value: true
- receiver_key:
value_name: FILE
help: Receiver's Json Web Key
takes_value: true
- encrypted_message:
value_name: FILE
help: Encrypted message to be unpacked
takes_value: true
- verify:
about: Verify a signed message
version: "0.1"
short: v
args:
- key:
value_name: FILE
help: Recepient's Json Web Key
takes_value: true
- signed_message:
value_name: FILE
help: Signed message to be verified
takes_value: true
- sign:
about: Sign a message
version: "0.1"
args:
- key:
value_name: FILE
help: Signer's Json Web Key
takes_value: true
required: true
- payload:
value_name: FILE
help: Bytes to be signed
takes_value: true
long: payload
- out:
long: out
value_name: FILE
help: output file for your packed message
- config:
about: Commands to set configuration parameters
args:
Expand All @@ -165,9 +33,6 @@ subcommands:
- wallet:
about: Wallet Service
subcommands:
- provider-configuration:
about: Get the provider configuration
version: "0.1"
- create:
about: Create a new wallet
version: "0.1"
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod services;
extern crate clap;
use clap::{App, ArgMatches};
use parser::Service;
use services::config::Config;
use services::config::DefaultConfig;
use yaml_rust::Yaml;

#[allow(unused_must_use)]
Expand All @@ -17,7 +17,7 @@ fn main() {
}

fn process(yaml: &Yaml, matches: ArgMatches) {
let config = Config::from(&matches);
let config = DefaultConfig::from(&matches);
let service = parser::parse(&matches);

if service == Service::Unknown {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/parser/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::ArgMatches;

use crate::services::config::Config;
use crate::services::config::DefaultConfig;

#[derive(Debug, PartialEq, Default)]
pub struct Command<'a> {
Expand All @@ -27,7 +27,7 @@ pub fn parse<'a>(args: &'a ArgMatches<'_>) -> Command<'a> {
command.server.address = args.value_of("server-address")
}
if args.is_present("show") {
Config::init().unwrap().print().unwrap();
DefaultConfig::init().unwrap().print().unwrap();
}

command
Expand Down
2 changes: 1 addition & 1 deletion cli/src/proto/services/universalwallet/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub mod invitation_token {
///Stores profile data for accessing a wallet.
///This result should be stored somewhere safe,
///as it contains private key information.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::serde::Serialize, ::serde::Deserialize, Copy, Clone, PartialEq, ::prost::Message)]
pub struct WalletProfile {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
Expand Down
Loading

0 comments on commit 87717bc

Please sign in to comment.