Skip to content

Commit 87717bc

Browse files
authored
Replace auth with oberon proof scheme in CLI (#188)
1 parent 617a215 commit 87717bc

File tree

12 files changed

+99
-254
lines changed

12 files changed

+99
-254
lines changed

cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ toml = "0.5"
1919
dirs = "3.0"
2020
yaml-rust = "0.3"
2121
colored = "2"
22+
blake3 = "1.2"
2223

2324
[build-dependencies]
2425
tonic-build = { version = "0.6", features = ["prost", "rustfmt"] }

cli/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ fn main() {
88

99
config
1010
.compile_well_known_types(true)
11+
.type_attribute(
12+
"WalletProfile",
13+
"#[derive(::serde::Serialize, ::serde::Deserialize, Copy)]",
14+
)
1115
.type_attribute(
1216
"JsonPayload",
1317
"#[derive(::serde::Serialize, ::serde::Deserialize)]",

cli/src/cli.yaml

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -8,138 +8,6 @@ about: >-
88
┴ ┴└─┴┘└┘└─┘┴└─┘
99
1010
subcommands:
11-
- didkey:
12-
about: didkey commands
13-
subcommands:
14-
- generate:
15-
about: Generates a Json Web Key
16-
version: "0.1"
17-
args:
18-
- out:
19-
long: out
20-
value_name: STRING
21-
help: File to save Json Web Key in
22-
takes_value: true
23-
- kty:
24-
long: kty
25-
value_name: STRING
26-
help: >-
27-
Specify key type. Defaults to X25519. Options are Ed25519,
28-
X25519, P256, Bls12381_G2, and secp256k1.
29-
takes_value: true
30-
possible_values:
31-
- Ed25519
32-
- X25519
33-
- P-256
34-
- Bls12381_G2
35-
- Secp256k1
36-
- resolve:
37-
about: Resolve a DID
38-
version: "0.1"
39-
args:
40-
- uri:
41-
value_name: STRING
42-
help: DID URI to resolve
43-
takes_value: true
44-
required: true
45-
- didcomm:
46-
about: didcomm commands
47-
subcommands:
48-
- pack:
49-
about: Packs a plaintext message
50-
version: "0.1"
51-
short: p
52-
args:
53-
- sender_key:
54-
value_name: FILE
55-
help: Sender's Json Web Key
56-
takes_value: true
57-
required: true
58-
- receiver_key:
59-
value_name: FILE
60-
help: Receiver's Json Web Key
61-
takes_value: true
62-
required: true
63-
- associated_data:
64-
value_name: FILE
65-
help: Associated data to be packed
66-
takes_value: true
67-
long: data
68-
- plaintext:
69-
value_name: FILE
70-
help: Plaintext message to be packed
71-
takes_value: true
72-
long: text
73-
- encryption_mode:
74-
value_name: STRING
75-
long: mode
76-
help: >-
77-
Encryption mode. Default is direct. Options are direct and
78-
content_encryption_key
79-
possible_values:
80-
- direct
81-
- content_encryption_key
82-
- encryption_algorithm:
83-
value_name: STRING
84-
long: alg
85-
help: >-
86-
Encryption algorithm. Default is xchacha20poly1305. Options
87-
are xchacha20poly1305 and aes_gcm
88-
possible_values:
89-
- xchacha20poly1305
90-
- aes_gcm
91-
- out:
92-
long: out
93-
value_name: FILE
94-
help: output file for your packed message
95-
- unpack:
96-
about: Unpacks an encrypted message
97-
version: "0.1"
98-
short: up
99-
args:
100-
- sender_key:
101-
value_name: FILE
102-
help: Sender's Json Web Key
103-
takes_value: true
104-
- receiver_key:
105-
value_name: FILE
106-
help: Receiver's Json Web Key
107-
takes_value: true
108-
- encrypted_message:
109-
value_name: FILE
110-
help: Encrypted message to be unpacked
111-
takes_value: true
112-
- verify:
113-
about: Verify a signed message
114-
version: "0.1"
115-
short: v
116-
args:
117-
- key:
118-
value_name: FILE
119-
help: Recepient's Json Web Key
120-
takes_value: true
121-
- signed_message:
122-
value_name: FILE
123-
help: Signed message to be verified
124-
takes_value: true
125-
- sign:
126-
about: Sign a message
127-
version: "0.1"
128-
args:
129-
- key:
130-
value_name: FILE
131-
help: Signer's Json Web Key
132-
takes_value: true
133-
required: true
134-
- payload:
135-
value_name: FILE
136-
help: Bytes to be signed
137-
takes_value: true
138-
long: payload
139-
- out:
140-
long: out
141-
value_name: FILE
142-
help: output file for your packed message
14311
- config:
14412
about: Commands to set configuration parameters
14513
args:
@@ -165,9 +33,6 @@ subcommands:
16533
- wallet:
16634
about: Wallet Service
16735
subcommands:
168-
- provider-configuration:
169-
about: Get the provider configuration
170-
version: "0.1"
17136
- create:
17237
about: Create a new wallet
17338
version: "0.1"

cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod services;
55
extern crate clap;
66
use clap::{App, ArgMatches};
77
use parser::Service;
8-
use services::config::Config;
8+
use services::config::DefaultConfig;
99
use yaml_rust::Yaml;
1010

1111
#[allow(unused_must_use)]
@@ -17,7 +17,7 @@ fn main() {
1717
}
1818

1919
fn process(yaml: &Yaml, matches: ArgMatches) {
20-
let config = Config::from(&matches);
20+
let config = DefaultConfig::from(&matches);
2121
let service = parser::parse(&matches);
2222

2323
if service == Service::Unknown {

cli/src/parser/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::ArgMatches;
22

3-
use crate::services::config::Config;
3+
use crate::services::config::DefaultConfig;
44

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

3333
command

cli/src/proto/services/universalwallet/v1/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub mod invitation_token {
6969
///Stores profile data for accessing a wallet.
7070
///This result should be stored somewhere safe,
7171
///as it contains private key information.
72-
#[derive(Clone, PartialEq, ::prost::Message)]
72+
#[derive(::serde::Serialize, ::serde::Deserialize, Copy, Clone, PartialEq, ::prost::Message)]
7373
pub struct WalletProfile {
7474
#[prost(string, tag = "1")]
7575
pub name: ::prost::alloc::string::String,

0 commit comments

Comments
 (0)