upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2023-09-01 00:00:00 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2023-09-13 09:24:49 +0000
commit6423baebd92e45c9be85157c443dff42e65d8d14 (patch)
tree6548edfd80d0cd9d1267378ebe816ec95e394137
parent5c5feaa732363e32e2a980a887fa42b4394b1a5e (diff)
refactor: rebuild app skeleton
Create skeleton for a complete rebuild of the prototype as a production ready product. Includes design patterns for: - dependency injection - unit testing with dependency mocking - integration testing - error handling - config storage BREAKING-CHANGE: ground-up redesign with incompatible protocol standards
-rw-r--r--.envrc1
-rw-r--r--.github/workflows/check_test_rustfmt_clippy.yaml40
-rw-r--r--.github/workflows/release.yml45
-rw-r--r--.gitignore3
-rw-r--r--.vscode/settings.json6
-rw-r--r--Cargo.lock1584
-rw-r--r--Cargo.toml28
-rw-r--r--LICENSE.md21
-rw-r--r--README.md3
-rw-r--r--flake.lock130
-rw-r--r--flake.nix52
-rwxr-xr-xgit_hooks/commit-msg35
-rwxr-xr-xgit_hooks/pre-commit24
-rw-r--r--rustfmt.toml13
-rw-r--r--shell.nix1
-rw-r--r--src/cli_interactor.rs34
-rw-r--r--src/config.rs152
-rw-r--r--src/key_handling/mod.rs1
-rw-r--r--src/key_handling/users.rs124
-rw-r--r--src/login.rs16
-rw-r--r--src/main.rs35
-rw-r--r--src/sub_commands/login.rs11
-rw-r--r--src/sub_commands/mod.rs1
-rw-r--r--test_utils/Cargo.toml12
-rw-r--r--test_utils/src/lib.rs280
-rw-r--r--tests/login.rs145
26 files changed, 1580 insertions, 1217 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..8392d15
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
use flake \ No newline at end of file
diff --git a/.github/workflows/check_test_rustfmt_clippy.yaml b/.github/workflows/check_test_rustfmt_clippy.yaml
new file mode 100644
index 0000000..9cb63c1
--- /dev/null
+++ b/.github/workflows/check_test_rustfmt_clippy.yaml
@@ -0,0 +1,40 @@
1on: push
2
3name: check test rustfmt clippy
4
5jobs:
6 ci:
7 runs-on: ubuntu-latest
8 strategy:
9 matrix:
10 rust:
11 - stable
12 - nightly
13
14 steps:
15 - uses: actions/checkout@v2
16
17 - uses: actions-rs/toolchain@v1
18 with:
19 profile: minimal
20 toolchain: ${{ matrix.rust }}
21 override: true
22 components: rustfmt, clippy
23
24 - uses: actions-rs/cargo@v1
25 with:
26 command: build
27
28 - uses: actions-rs/cargo@v1
29 with:
30 command: test
31
32 - uses: actions-rs/cargo@v1
33 with:
34 command: fmt
35 args: --all -- --check
36
37 - uses: actions-rs/cargo@v1
38 with:
39 command: clippy
40 args: -- -D warnings
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..7e64456
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,45 @@
1name: Release
2
3permissions:
4 contents: write
5
6on:
7 push:
8 tags:
9 - v[0-9]+.*
10
11jobs:
12 create-release:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v3
16 - uses: taiki-e/create-gh-release-action@v1
17 with:
18 # (required) GitHub token for creating GitHub Releases.
19 token: ${{ secrets.GITHUB_TOKEN }}
20
21 upload-assets:
22 strategy:
23 matrix:
24 os:
25 - ubuntu-latest
26 - macos-latest
27 - windows-latest
28 runs-on: ${{ matrix.os }}
29 steps:
30 - uses: actions/checkout@v3
31 - uses: taiki-e/upload-rust-binary-action@v1
32 with:
33 # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
34 # Note that glob pattern is not supported yet.
35 bin: ngit
36 # (optional) On which platform to distribute the `.tar.gz` file.
37 # [default value: unix]
38 # [possible values: all, unix, windows, none]
39 tar: unix
40 # (optional) On which platform to distribute the `.zip` file.
41 # [default value: windows]
42 # [possible values: all, unix, windows, none]
43 zip: windows
44 # (required) GitHub token for uploading assets to GitHub Releases.
45 token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 58c050e..cb8c9e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
1.ngit 1/target
2.direnv \ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..17edf5d
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
1{
2 "[rust]": {
3 "editor.defaultFormatter": "rust-lang.rust-analyzer",
4 },
5 "rust-analyzer.check.command": "clippy",
6} \ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index a37e592..3471bc3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,42 +3,39 @@
3version = 3 3version = 3
4 4
5[[package]] 5[[package]]
6name = "aes" 6name = "aho-corasick"
7version = "0.8.2" 7version = "1.0.5"
8source = "registry+https://github.com/rust-lang/crates.io-index" 8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" 9checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783"
10dependencies = [ 10dependencies = [
11 "cfg-if", 11 "memchr",
12 "cipher",
13 "cpufeatures",
14] 12]
15 13
16[[package]] 14[[package]]
17name = "anstream" 15name = "anstream"
18version = "0.3.1" 16version = "0.5.0"
19source = "registry+https://github.com/rust-lang/crates.io-index" 17source = "registry+https://github.com/rust-lang/crates.io-index"
20checksum = "6342bd4f5a1205d7f41e94a41a901f5647c938cdfa96036338e8533c9d6c2450" 18checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c"
21dependencies = [ 19dependencies = [
22 "anstyle", 20 "anstyle",
23 "anstyle-parse", 21 "anstyle-parse",
24 "anstyle-query", 22 "anstyle-query",
25 "anstyle-wincon", 23 "anstyle-wincon",
26 "colorchoice", 24 "colorchoice",
27 "is-terminal",
28 "utf8parse", 25 "utf8parse",
29] 26]
30 27
31[[package]] 28[[package]]
32name = "anstyle" 29name = "anstyle"
33version = "1.0.0" 30version = "1.0.2"
34source = "registry+https://github.com/rust-lang/crates.io-index" 31source = "registry+https://github.com/rust-lang/crates.io-index"
35checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" 32checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea"
36 33
37[[package]] 34[[package]]
38name = "anstyle-parse" 35name = "anstyle-parse"
39version = "0.2.0" 36version = "0.2.1"
40source = "registry+https://github.com/rust-lang/crates.io-index" 37source = "registry+https://github.com/rust-lang/crates.io-index"
41checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" 38checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333"
42dependencies = [ 39dependencies = [
43 "utf8parse", 40 "utf8parse",
44] 41]
@@ -54,94 +51,40 @@ dependencies = [
54 51
55[[package]] 52[[package]]
56name = "anstyle-wincon" 53name = "anstyle-wincon"
57version = "1.0.1" 54version = "2.1.0"
58source = "registry+https://github.com/rust-lang/crates.io-index" 55source = "registry+https://github.com/rust-lang/crates.io-index"
59checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" 56checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd"
60dependencies = [ 57dependencies = [
61 "anstyle", 58 "anstyle",
62 "windows-sys 0.48.0", 59 "windows-sys 0.48.0",
63] 60]
64 61
65[[package]] 62[[package]]
66name = "async_io_stream" 63name = "anyhow"
67version = "0.3.3" 64version = "1.0.75"
68source = "registry+https://github.com/rust-lang/crates.io-index"
69checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c"
70dependencies = [
71 "futures",
72 "pharos",
73 "rustc_version",
74]
75
76[[package]]
77name = "autocfg"
78version = "1.1.0"
79source = "registry+https://github.com/rust-lang/crates.io-index"
80checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
81
82[[package]]
83name = "base64"
84version = "0.13.1"
85source = "registry+https://github.com/rust-lang/crates.io-index"
86checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
87
88[[package]]
89name = "base64"
90version = "0.21.0"
91source = "registry+https://github.com/rust-lang/crates.io-index"
92checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
93
94[[package]]
95name = "bech32"
96version = "0.9.1"
97source = "registry+https://github.com/rust-lang/crates.io-index" 65source = "registry+https://github.com/rust-lang/crates.io-index"
98checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" 66checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
99 67
100[[package]] 68[[package]]
101name = "bip39" 69name = "assert_cmd"
102version = "2.0.0" 70version = "2.0.12"
103source = "registry+https://github.com/rust-lang/crates.io-index" 71source = "registry+https://github.com/rust-lang/crates.io-index"
104checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" 72checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6"
105dependencies = [ 73dependencies = [
106 "bitcoin_hashes 0.11.0", 74 "anstyle",
107 "serde", 75 "bstr",
108 "unicode-normalization", 76 "doc-comment",
109] 77 "predicates 3.0.3",
110 78 "predicates-core",
111[[package]] 79 "predicates-tree",
112name = "bitcoin" 80 "wait-timeout",
113version = "0.30.0"
114source = "registry+https://github.com/rust-lang/crates.io-index"
115checksum = "b36f4c848f6bd9ff208128f08751135846cc23ae57d66ab10a22efff1c675f3c"
116dependencies = [
117 "bech32",
118 "bitcoin-private",
119 "bitcoin_hashes 0.12.0",
120 "hex_lit",
121 "secp256k1",
122] 81]
123 82
124[[package]] 83[[package]]
125name = "bitcoin-private" 84name = "autocfg"
126version = "0.1.0" 85version = "1.1.0"
127source = "registry+https://github.com/rust-lang/crates.io-index"
128checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
129
130[[package]]
131name = "bitcoin_hashes"
132version = "0.11.0"
133source = "registry+https://github.com/rust-lang/crates.io-index"
134checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4"
135
136[[package]]
137name = "bitcoin_hashes"
138version = "0.12.0"
139source = "registry+https://github.com/rust-lang/crates.io-index" 86source = "registry+https://github.com/rust-lang/crates.io-index"
140checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" 87checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
141dependencies = [
142 "bitcoin-private",
143 "serde",
144]
145 88
146[[package]] 89[[package]]
147name = "bitflags" 90name = "bitflags"
@@ -150,57 +93,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
150checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 93checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
151 94
152[[package]] 95[[package]]
153name = "block-buffer" 96name = "bitflags"
154version = "0.10.4" 97version = "2.4.0"
155source = "registry+https://github.com/rust-lang/crates.io-index"
156checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
157dependencies = [
158 "generic-array",
159]
160
161[[package]]
162name = "block-padding"
163version = "0.3.3"
164source = "registry+https://github.com/rust-lang/crates.io-index"
165checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
166dependencies = [
167 "generic-array",
168]
169
170[[package]]
171name = "bumpalo"
172version = "3.12.1"
173source = "registry+https://github.com/rust-lang/crates.io-index"
174checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"
175
176[[package]]
177name = "byteorder"
178version = "1.4.3"
179source = "registry+https://github.com/rust-lang/crates.io-index"
180checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
181
182[[package]]
183name = "bytes"
184version = "1.4.0"
185source = "registry+https://github.com/rust-lang/crates.io-index" 98source = "registry+https://github.com/rust-lang/crates.io-index"
186checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 99checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
187 100
188[[package]] 101[[package]]
189name = "cbc" 102name = "bstr"
190version = "0.1.2" 103version = "1.6.2"
191source = "registry+https://github.com/rust-lang/crates.io-index" 104source = "registry+https://github.com/rust-lang/crates.io-index"
192checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" 105checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a"
193dependencies = [ 106dependencies = [
194 "cipher", 107 "memchr",
108 "regex-automata",
109 "serde",
195] 110]
196 111
197[[package]] 112[[package]]
198name = "cc" 113name = "cc"
199version = "1.0.79" 114version = "1.0.83"
200source = "registry+https://github.com/rust-lang/crates.io-index" 115source = "registry+https://github.com/rust-lang/crates.io-index"
201checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 116checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
202dependencies = [ 117dependencies = [
203 "jobserver", 118 "libc",
204] 119]
205 120
206[[package]] 121[[package]]
@@ -210,56 +125,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
210checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 125checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
211 126
212[[package]] 127[[package]]
213name = "cipher"
214version = "0.4.4"
215source = "registry+https://github.com/rust-lang/crates.io-index"
216checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
217dependencies = [
218 "crypto-common",
219 "inout",
220]
221
222[[package]]
223name = "clap" 128name = "clap"
224version = "4.2.5" 129version = "4.4.2"
225source = "registry+https://github.com/rust-lang/crates.io-index" 130source = "registry+https://github.com/rust-lang/crates.io-index"
226checksum = "8a1f23fa97e1d1641371b51f35535cb26959b8e27ab50d167a8b996b5bada819" 131checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6"
227dependencies = [ 132dependencies = [
228 "clap_builder", 133 "clap_builder",
229 "clap_derive", 134 "clap_derive",
230 "once_cell",
231] 135]
232 136
233[[package]] 137[[package]]
234name = "clap_builder" 138name = "clap_builder"
235version = "4.2.5" 139version = "4.4.2"
236source = "registry+https://github.com/rust-lang/crates.io-index" 140source = "registry+https://github.com/rust-lang/crates.io-index"
237checksum = "0fdc5d93c358224b4d6867ef1356d740de2303e9892edc06c5340daeccd96bab" 141checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08"
238dependencies = [ 142dependencies = [
239 "anstream", 143 "anstream",
240 "anstyle", 144 "anstyle",
241 "bitflags",
242 "clap_lex", 145 "clap_lex",
243 "strsim", 146 "strsim",
244] 147]
245 148
246[[package]] 149[[package]]
247name = "clap_derive" 150name = "clap_derive"
248version = "4.2.0" 151version = "4.4.2"
249source = "registry+https://github.com/rust-lang/crates.io-index" 152source = "registry+https://github.com/rust-lang/crates.io-index"
250checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" 153checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873"
251dependencies = [ 154dependencies = [
252 "heck", 155 "heck",
253 "proc-macro2", 156 "proc-macro2",
254 "quote", 157 "quote",
255 "syn 2.0.15", 158 "syn 2.0.32",
256] 159]
257 160
258[[package]] 161[[package]]
259name = "clap_lex" 162name = "clap_lex"
260version = "0.4.1" 163version = "0.5.1"
261source = "registry+https://github.com/rust-lang/crates.io-index" 164source = "registry+https://github.com/rust-lang/crates.io-index"
262checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" 165checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961"
263 166
264[[package]] 167[[package]]
265name = "colorchoice" 168name = "colorchoice"
@@ -268,47 +171,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
268checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 171checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
269 172
270[[package]] 173[[package]]
271name = "confy" 174name = "comma"
272version = "0.5.1" 175version = "1.0.0"
273source = "registry+https://github.com/rust-lang/crates.io-index" 176source = "registry+https://github.com/rust-lang/crates.io-index"
274checksum = "e37668cb35145dcfaa1931a5f37fde375eeae8068b4c0d2f289da28a270b2d2c" 177checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
275dependencies = [
276 "directories",
277 "serde",
278 "thiserror",
279 "toml",
280]
281 178
282[[package]] 179[[package]]
283name = "console" 180name = "console"
284version = "0.15.5" 181version = "0.15.7"
285source = "registry+https://github.com/rust-lang/crates.io-index" 182source = "registry+https://github.com/rust-lang/crates.io-index"
286checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" 183checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8"
287dependencies = [ 184dependencies = [
288 "encode_unicode", 185 "encode_unicode",
289 "lazy_static", 186 "lazy_static",
290 "libc", 187 "libc",
291 "unicode-width", 188 "unicode-width",
292 "windows-sys 0.42.0", 189 "windows-sys 0.45.0",
293]
294
295[[package]]
296name = "cpufeatures"
297version = "0.2.7"
298source = "registry+https://github.com/rust-lang/crates.io-index"
299checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58"
300dependencies = [
301 "libc",
302] 190]
303 191
304[[package]] 192[[package]]
305name = "crypto-common" 193name = "dashmap"
306version = "0.1.6" 194version = "5.5.3"
307source = "registry+https://github.com/rust-lang/crates.io-index" 195source = "registry+https://github.com/rust-lang/crates.io-index"
308checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 196checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
309dependencies = [ 197dependencies = [
310 "generic-array", 198 "cfg-if",
311 "typenum", 199 "hashbrown",
200 "lock_api",
201 "once_cell",
202 "parking_lot_core",
312] 203]
313 204
314[[package]] 205[[package]]
@@ -324,61 +215,71 @@ dependencies = [
324] 215]
325 216
326[[package]] 217[[package]]
327name = "digest" 218name = "difflib"
328version = "0.10.6" 219version = "0.4.0"
329source = "registry+https://github.com/rust-lang/crates.io-index" 220source = "registry+https://github.com/rust-lang/crates.io-index"
330checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 221checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
331dependencies = [
332 "block-buffer",
333 "crypto-common",
334]
335 222
336[[package]] 223[[package]]
337name = "directories" 224name = "directories"
338version = "4.0.1" 225version = "5.0.1"
339source = "registry+https://github.com/rust-lang/crates.io-index" 226source = "registry+https://github.com/rust-lang/crates.io-index"
340checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" 227checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35"
341dependencies = [ 228dependencies = [
342 "dirs-sys", 229 "dirs-sys",
343] 230]
344 231
345[[package]] 232[[package]]
346name = "dirs-sys" 233name = "dirs-sys"
347version = "0.3.7" 234version = "0.4.1"
348source = "registry+https://github.com/rust-lang/crates.io-index" 235source = "registry+https://github.com/rust-lang/crates.io-index"
349checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 236checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
350dependencies = [ 237dependencies = [
351 "libc", 238 "libc",
239 "option-ext",
352 "redox_users", 240 "redox_users",
353 "winapi", 241 "windows-sys 0.48.0",
354] 242]
355 243
356[[package]] 244[[package]]
357name = "either" 245name = "doc-comment"
358version = "1.8.1" 246version = "0.3.3"
359source = "registry+https://github.com/rust-lang/crates.io-index" 247source = "registry+https://github.com/rust-lang/crates.io-index"
360checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 248checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
361 249
362[[package]] 250[[package]]
363name = "encode_unicode" 251name = "downcast"
364version = "0.3.6" 252version = "0.11.0"
365source = "registry+https://github.com/rust-lang/crates.io-index" 253source = "registry+https://github.com/rust-lang/crates.io-index"
366checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 254checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1"
367 255
368[[package]] 256[[package]]
369name = "encoding_rs" 257name = "duplicate"
370version = "0.8.32" 258version = "1.0.0"
371source = "registry+https://github.com/rust-lang/crates.io-index" 259source = "registry+https://github.com/rust-lang/crates.io-index"
372checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 260checksum = "de78e66ac9061e030587b2a2e75cc88f22304913c907b11307bca737141230cb"
373dependencies = [ 261dependencies = [
374 "cfg-if", 262 "heck",
263 "proc-macro-error",
375] 264]
376 265
377[[package]] 266[[package]]
267name = "either"
268version = "1.9.0"
269source = "registry+https://github.com/rust-lang/crates.io-index"
270checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
271
272[[package]]
273name = "encode_unicode"
274version = "0.3.6"
275source = "registry+https://github.com/rust-lang/crates.io-index"
276checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
277
278[[package]]
378name = "errno" 279name = "errno"
379version = "0.3.1" 280version = "0.3.3"
380source = "registry+https://github.com/rust-lang/crates.io-index" 281source = "registry+https://github.com/rust-lang/crates.io-index"
381checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 282checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd"
382dependencies = [ 283dependencies = [
383 "errno-dragonfly", 284 "errno-dragonfly",
384 "libc", 285 "libc",
@@ -397,27 +298,24 @@ dependencies = [
397 298
398[[package]] 299[[package]]
399name = "fastrand" 300name = "fastrand"
400version = "1.9.0" 301version = "2.0.0"
401source = "registry+https://github.com/rust-lang/crates.io-index" 302source = "registry+https://github.com/rust-lang/crates.io-index"
402checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 303checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
403dependencies = [
404 "instant",
405]
406 304
407[[package]] 305[[package]]
408name = "fnv" 306name = "float-cmp"
409version = "1.0.7" 307version = "0.9.0"
410source = "registry+https://github.com/rust-lang/crates.io-index" 308source = "registry+https://github.com/rust-lang/crates.io-index"
411checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 309checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
310dependencies = [
311 "num-traits",
312]
412 313
413[[package]] 314[[package]]
414name = "form_urlencoded" 315name = "fragile"
415version = "1.1.0" 316version = "2.0.0"
416source = "registry+https://github.com/rust-lang/crates.io-index" 317source = "registry+https://github.com/rust-lang/crates.io-index"
417checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 318checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
418dependencies = [
419 "percent-encoding",
420]
421 319
422[[package]] 320[[package]]
423name = "futures" 321name = "futures"
@@ -468,17 +366,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
468checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 366checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
469 367
470[[package]] 368[[package]]
471name = "futures-macro"
472version = "0.3.28"
473source = "registry+https://github.com/rust-lang/crates.io-index"
474checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
475dependencies = [
476 "proc-macro2",
477 "quote",
478 "syn 2.0.15",
479]
480
481[[package]]
482name = "futures-sink" 369name = "futures-sink"
483version = "0.3.28" 370version = "0.3.28"
484source = "registry+https://github.com/rust-lang/crates.io-index" 371source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -499,7 +386,6 @@ dependencies = [
499 "futures-channel", 386 "futures-channel",
500 "futures-core", 387 "futures-core",
501 "futures-io", 388 "futures-io",
502 "futures-macro",
503 "futures-sink", 389 "futures-sink",
504 "futures-task", 390 "futures-task",
505 "memchr", 391 "memchr",
@@ -509,79 +395,21 @@ dependencies = [
509] 395]
510 396
511[[package]] 397[[package]]
512name = "generic-array"
513version = "0.14.7"
514source = "registry+https://github.com/rust-lang/crates.io-index"
515checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
516dependencies = [
517 "typenum",
518 "version_check",
519]
520
521[[package]]
522name = "getrandom" 398name = "getrandom"
523version = "0.2.9" 399version = "0.2.10"
524source = "registry+https://github.com/rust-lang/crates.io-index" 400source = "registry+https://github.com/rust-lang/crates.io-index"
525checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 401checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
526dependencies = [ 402dependencies = [
527 "cfg-if", 403 "cfg-if",
528 "js-sys",
529 "libc", 404 "libc",
530 "wasi", 405 "wasi",
531 "wasm-bindgen",
532]
533
534[[package]]
535name = "git2"
536version = "0.17.1"
537source = "registry+https://github.com/rust-lang/crates.io-index"
538checksum = "8b7905cdfe33d31a88bb2e8419ddd054451f5432d1da9eaf2ac7804ee1ea12d5"
539dependencies = [
540 "bitflags",
541 "libc",
542 "libgit2-sys",
543 "log",
544 "openssl-probe",
545 "openssl-sys",
546 "url",
547]
548
549[[package]]
550name = "gloo-timers"
551version = "0.2.6"
552source = "registry+https://github.com/rust-lang/crates.io-index"
553checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c"
554dependencies = [
555 "futures-channel",
556 "futures-core",
557 "js-sys",
558 "wasm-bindgen",
559]
560
561[[package]]
562name = "h2"
563version = "0.3.18"
564source = "registry+https://github.com/rust-lang/crates.io-index"
565checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
566dependencies = [
567 "bytes",
568 "fnv",
569 "futures-core",
570 "futures-sink",
571 "futures-util",
572 "http",
573 "indexmap",
574 "slab",
575 "tokio",
576 "tokio-util",
577 "tracing",
578] 406]
579 407
580[[package]] 408[[package]]
581name = "hashbrown" 409name = "hashbrown"
582version = "0.12.3" 410version = "0.14.0"
583source = "registry+https://github.com/rust-lang/crates.io-index" 411source = "registry+https://github.com/rust-lang/crates.io-index"
584checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 412checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
585 413
586[[package]] 414[[package]]
587name = "heck" 415name = "heck"
@@ -590,203 +418,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
590checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 418checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
591 419
592[[package]] 420[[package]]
593name = "hermit-abi" 421name = "itertools"
594version = "0.2.6" 422version = "0.10.5"
595source = "registry+https://github.com/rust-lang/crates.io-index"
596checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
597dependencies = [
598 "libc",
599]
600
601[[package]]
602name = "hermit-abi"
603version = "0.3.1"
604source = "registry+https://github.com/rust-lang/crates.io-index"
605checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
606
607[[package]]
608name = "hex_lit"
609version = "0.1.1"
610source = "registry+https://github.com/rust-lang/crates.io-index"
611checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd"
612
613[[package]]
614name = "http"
615version = "0.2.9"
616source = "registry+https://github.com/rust-lang/crates.io-index"
617checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
618dependencies = [
619 "bytes",
620 "fnv",
621 "itoa",
622]
623
624[[package]]
625name = "http-body"
626version = "0.4.5"
627source = "registry+https://github.com/rust-lang/crates.io-index"
628checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
629dependencies = [
630 "bytes",
631 "http",
632 "pin-project-lite",
633]
634
635[[package]]
636name = "httparse"
637version = "1.8.0"
638source = "registry+https://github.com/rust-lang/crates.io-index"
639checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
640
641[[package]]
642name = "httpdate"
643version = "1.0.2"
644source = "registry+https://github.com/rust-lang/crates.io-index"
645checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
646
647[[package]]
648name = "hyper"
649version = "0.14.26"
650source = "registry+https://github.com/rust-lang/crates.io-index"
651checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
652dependencies = [
653 "bytes",
654 "futures-channel",
655 "futures-core",
656 "futures-util",
657 "h2",
658 "http",
659 "http-body",
660 "httparse",
661 "httpdate",
662 "itoa",
663 "pin-project-lite",
664 "socket2",
665 "tokio",
666 "tower-service",
667 "tracing",
668 "want",
669]
670
671[[package]]
672name = "hyper-rustls"
673version = "0.23.2"
674source = "registry+https://github.com/rust-lang/crates.io-index"
675checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
676dependencies = [
677 "http",
678 "hyper",
679 "rustls",
680 "tokio",
681 "tokio-rustls",
682]
683
684[[package]]
685name = "idna"
686version = "0.3.0"
687source = "registry+https://github.com/rust-lang/crates.io-index"
688checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
689dependencies = [
690 "unicode-bidi",
691 "unicode-normalization",
692]
693
694[[package]]
695name = "indexmap"
696version = "1.9.3"
697source = "registry+https://github.com/rust-lang/crates.io-index"
698checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
699dependencies = [
700 "autocfg",
701 "hashbrown",
702]
703
704[[package]]
705name = "indicatif"
706version = "0.17.3"
707source = "registry+https://github.com/rust-lang/crates.io-index"
708checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729"
709dependencies = [
710 "console",
711 "number_prefix",
712 "portable-atomic 0.3.20",
713 "unicode-width",
714]
715
716[[package]]
717name = "inout"
718version = "0.1.3"
719source = "registry+https://github.com/rust-lang/crates.io-index"
720checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
721dependencies = [
722 "block-padding",
723 "generic-array",
724]
725
726[[package]]
727name = "instant"
728version = "0.1.12"
729source = "registry+https://github.com/rust-lang/crates.io-index"
730checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
731dependencies = [
732 "cfg-if",
733 "js-sys",
734 "wasm-bindgen",
735 "web-sys",
736]
737
738[[package]]
739name = "io-lifetimes"
740version = "1.0.10"
741source = "registry+https://github.com/rust-lang/crates.io-index"
742checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
743dependencies = [
744 "hermit-abi 0.3.1",
745 "libc",
746 "windows-sys 0.48.0",
747]
748
749[[package]]
750name = "ipnet"
751version = "2.7.2"
752source = "registry+https://github.com/rust-lang/crates.io-index"
753checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"
754
755[[package]]
756name = "is-terminal"
757version = "0.4.7"
758source = "registry+https://github.com/rust-lang/crates.io-index" 423source = "registry+https://github.com/rust-lang/crates.io-index"
759checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" 424checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
760dependencies = [ 425dependencies = [
761 "hermit-abi 0.3.1", 426 "either",
762 "io-lifetimes",
763 "rustix",
764 "windows-sys 0.48.0",
765] 427]
766 428
767[[package]] 429[[package]]
768name = "itoa" 430name = "itoa"
769version = "1.0.6" 431version = "1.0.9"
770source = "registry+https://github.com/rust-lang/crates.io-index"
771checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
772
773[[package]]
774name = "jobserver"
775version = "0.1.26"
776source = "registry+https://github.com/rust-lang/crates.io-index"
777checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
778dependencies = [
779 "libc",
780]
781
782[[package]]
783name = "js-sys"
784version = "0.3.61"
785source = "registry+https://github.com/rust-lang/crates.io-index" 432source = "registry+https://github.com/rust-lang/crates.io-index"
786checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 433checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
787dependencies = [
788 "wasm-bindgen",
789]
790 434
791[[package]] 435[[package]]
792name = "lazy_static" 436name = "lazy_static"
@@ -796,223 +440,159 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
796 440
797[[package]] 441[[package]]
798name = "libc" 442name = "libc"
799version = "0.2.142" 443version = "0.2.147"
800source = "registry+https://github.com/rust-lang/crates.io-index" 444source = "registry+https://github.com/rust-lang/crates.io-index"
801checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" 445checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
802 446
803[[package]] 447[[package]]
804name = "libgit2-sys" 448name = "linux-raw-sys"
805version = "0.15.1+1.6.4" 449version = "0.4.7"
806source = "registry+https://github.com/rust-lang/crates.io-index" 450source = "registry+https://github.com/rust-lang/crates.io-index"
807checksum = "fb4577bde8cdfc7d6a2a4bcb7b049598597de33ffd337276e9c7db6cd4a2cee7" 451checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
808dependencies = [
809 "cc",
810 "libc",
811 "libssh2-sys",
812 "libz-sys",
813 "openssl-sys",
814 "pkg-config",
815]
816 452
817[[package]] 453[[package]]
818name = "libssh2-sys" 454name = "lock_api"
819version = "0.3.0" 455version = "0.4.10"
820source = "registry+https://github.com/rust-lang/crates.io-index" 456source = "registry+https://github.com/rust-lang/crates.io-index"
821checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" 457checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
822dependencies = [ 458dependencies = [
823 "cc", 459 "autocfg",
824 "libc", 460 "scopeguard",
825 "libz-sys",
826 "openssl-sys",
827 "pkg-config",
828 "vcpkg",
829] 461]
830 462
831[[package]] 463[[package]]
832name = "libz-sys" 464name = "log"
833version = "1.1.9" 465version = "0.4.20"
834source = "registry+https://github.com/rust-lang/crates.io-index" 466source = "registry+https://github.com/rust-lang/crates.io-index"
835checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" 467checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
836dependencies = [
837 "cc",
838 "libc",
839 "pkg-config",
840 "vcpkg",
841]
842 468
843[[package]] 469[[package]]
844name = "linux-raw-sys" 470name = "memchr"
845version = "0.3.6" 471version = "2.6.3"
846source = "registry+https://github.com/rust-lang/crates.io-index" 472source = "registry+https://github.com/rust-lang/crates.io-index"
847checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" 473checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
848 474
849[[package]] 475[[package]]
850name = "log" 476name = "memoffset"
851version = "0.4.17" 477version = "0.7.1"
852source = "registry+https://github.com/rust-lang/crates.io-index" 478source = "registry+https://github.com/rust-lang/crates.io-index"
853checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 479checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
854dependencies = [ 480dependencies = [
855 "cfg-if", 481 "autocfg",
856] 482]
857 483
858[[package]] 484[[package]]
859name = "memchr" 485name = "mockall"
860version = "2.5.0" 486version = "0.11.4"
861source = "registry+https://github.com/rust-lang/crates.io-index" 487source = "registry+https://github.com/rust-lang/crates.io-index"
862checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 488checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96"
863 489dependencies = [
864[[package]] 490 "cfg-if",
865name = "mime" 491 "downcast",
866version = "0.3.17" 492 "fragile",
867source = "registry+https://github.com/rust-lang/crates.io-index" 493 "lazy_static",
868checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 494 "mockall_derive",
495 "predicates 2.1.5",
496 "predicates-tree",
497]
869 498
870[[package]] 499[[package]]
871name = "mio" 500name = "mockall_derive"
872version = "0.8.6" 501version = "0.11.4"
873source = "registry+https://github.com/rust-lang/crates.io-index" 502source = "registry+https://github.com/rust-lang/crates.io-index"
874checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 503checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb"
875dependencies = [ 504dependencies = [
876 "libc", 505 "cfg-if",
877 "log", 506 "proc-macro2",
878 "wasi", 507 "quote",
879 "windows-sys 0.45.0", 508 "syn 1.0.109",
880] 509]
881 510
882[[package]] 511[[package]]
883name = "ngit" 512name = "ngit"
884version = "0.0.1" 513version = "0.0.1"
885dependencies = [ 514dependencies = [
515 "anyhow",
516 "assert_cmd",
886 "clap", 517 "clap",
887 "confy",
888 "dialoguer", 518 "dialoguer",
889 "git2", 519 "directories",
890 "indicatif", 520 "duplicate",
891 "nostr", 521 "mockall",
892 "nostr-sdk",
893 "serde",
894 "serde_json",
895 "thiserror",
896]
897
898[[package]]
899name = "nostr"
900version = "0.21.0"
901source = "git+https://github.com/DanConwayDev/nostr.git#d2caf5521e06849ecf1b5663a4b70e3cc6c34a69"
902dependencies = [
903 "aes",
904 "base64 0.21.0",
905 "bech32",
906 "bip39",
907 "bitcoin",
908 "bitcoin_hashes 0.12.0",
909 "cbc",
910 "getrandom",
911 "instant",
912 "log",
913 "reqwest",
914 "secp256k1",
915 "serde", 522 "serde",
916 "serde_json", 523 "serde_json",
917 "thiserror", 524 "serial_test",
918 "url", 525 "test_utils",
919] 526]
920 527
921[[package]] 528[[package]]
922name = "nostr-sdk" 529name = "nix"
923version = "0.21.0" 530version = "0.26.4"
924source = "registry+https://github.com/rust-lang/crates.io-index" 531source = "registry+https://github.com/rust-lang/crates.io-index"
925checksum = "9d60df29fc0725e362c26e8b776dfa41ca23dc157fbb41ca81fdd6705268838c" 532checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
926dependencies = [ 533dependencies = [
927 "gloo-timers", 534 "bitflags 1.3.2",
928 "log", 535 "cfg-if",
929 "nostr", 536 "libc",
930 "nostr-sdk-net", 537 "memoffset",
931 "once_cell", 538 "pin-utils",
932 "thiserror",
933 "tokio",
934 "wasm-bindgen-futures",
935] 539]
936 540
937[[package]] 541[[package]]
938name = "nostr-sdk-net" 542name = "normalize-line-endings"
939version = "0.21.0" 543version = "0.3.0"
940source = "registry+https://github.com/rust-lang/crates.io-index" 544source = "registry+https://github.com/rust-lang/crates.io-index"
941checksum = "5669dfdfeae7c85cfafa59bca1fadedbd8e494450a7e7249d6ccdcd4c41dcd2a" 545checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
942dependencies = [
943 "futures-util",
944 "thiserror",
945 "tokio",
946 "tokio-rustls",
947 "tokio-socks",
948 "tokio-tungstenite",
949 "url",
950 "webpki",
951 "webpki-roots",
952 "ws_stream_wasm",
953]
954 546
955[[package]] 547[[package]]
956name = "num_cpus" 548name = "num-traits"
957version = "1.15.0" 549version = "0.2.16"
958source = "registry+https://github.com/rust-lang/crates.io-index" 550source = "registry+https://github.com/rust-lang/crates.io-index"
959checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 551checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
960dependencies = [ 552dependencies = [
961 "hermit-abi 0.2.6", 553 "autocfg",
962 "libc",
963] 554]
964 555
965[[package]] 556[[package]]
966name = "number_prefix"
967version = "0.4.0"
968source = "registry+https://github.com/rust-lang/crates.io-index"
969checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
970
971[[package]]
972name = "once_cell" 557name = "once_cell"
973version = "1.17.1" 558version = "1.18.0"
974source = "registry+https://github.com/rust-lang/crates.io-index" 559source = "registry+https://github.com/rust-lang/crates.io-index"
975checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 560checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
976 561
977[[package]] 562[[package]]
978name = "openssl-probe" 563name = "option-ext"
979version = "0.1.5" 564version = "0.2.0"
980source = "registry+https://github.com/rust-lang/crates.io-index" 565source = "registry+https://github.com/rust-lang/crates.io-index"
981checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 566checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
982 567
983[[package]] 568[[package]]
984name = "openssl-sys" 569name = "parking_lot"
985version = "0.9.87" 570version = "0.12.1"
986source = "registry+https://github.com/rust-lang/crates.io-index" 571source = "registry+https://github.com/rust-lang/crates.io-index"
987checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" 572checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
988dependencies = [ 573dependencies = [
989 "cc", 574 "lock_api",
990 "libc", 575 "parking_lot_core",
991 "pkg-config",
992 "vcpkg",
993] 576]
994 577
995[[package]] 578[[package]]
996name = "percent-encoding" 579name = "parking_lot_core"
997version = "2.2.0" 580version = "0.9.8"
998source = "registry+https://github.com/rust-lang/crates.io-index" 581source = "registry+https://github.com/rust-lang/crates.io-index"
999checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 582checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
1000
1001[[package]]
1002name = "pharos"
1003version = "0.5.3"
1004source = "registry+https://github.com/rust-lang/crates.io-index"
1005checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414"
1006dependencies = [ 583dependencies = [
1007 "futures", 584 "cfg-if",
1008 "rustc_version", 585 "libc",
586 "redox_syscall 0.3.5",
587 "smallvec",
588 "windows-targets 0.48.5",
1009] 589]
1010 590
1011[[package]] 591[[package]]
1012name = "pin-project-lite" 592name = "pin-project-lite"
1013version = "0.2.9" 593version = "0.2.13"
1014source = "registry+https://github.com/rust-lang/crates.io-index" 594source = "registry+https://github.com/rust-lang/crates.io-index"
1015checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 595checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
1016 596
1017[[package]] 597[[package]]
1018name = "pin-utils" 598name = "pin-utils"
@@ -1021,78 +601,87 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1021checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 601checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1022 602
1023[[package]] 603[[package]]
1024name = "pkg-config" 604name = "predicates"
1025version = "0.3.27" 605version = "2.1.5"
1026source = "registry+https://github.com/rust-lang/crates.io-index"
1027checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
1028
1029[[package]]
1030name = "portable-atomic"
1031version = "0.3.20"
1032source = "registry+https://github.com/rust-lang/crates.io-index" 606source = "registry+https://github.com/rust-lang/crates.io-index"
1033checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" 607checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
1034dependencies = [ 608dependencies = [
1035 "portable-atomic 1.3.1", 609 "difflib",
610 "float-cmp",
611 "itertools",
612 "normalize-line-endings",
613 "predicates-core",
614 "regex",
1036] 615]
1037 616
1038[[package]] 617[[package]]
1039name = "portable-atomic" 618name = "predicates"
1040version = "1.3.1" 619version = "3.0.3"
1041source = "registry+https://github.com/rust-lang/crates.io-index" 620source = "registry+https://github.com/rust-lang/crates.io-index"
1042checksum = "1bbda379e6e462c97ea6afe9f6233619b202bbc4968d7caa6917788d2070a044" 621checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9"
622dependencies = [
623 "anstyle",
624 "difflib",
625 "itertools",
626 "predicates-core",
627]
1043 628
1044[[package]] 629[[package]]
1045name = "ppv-lite86" 630name = "predicates-core"
1046version = "0.2.17" 631version = "1.0.6"
1047source = "registry+https://github.com/rust-lang/crates.io-index" 632source = "registry+https://github.com/rust-lang/crates.io-index"
1048checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 633checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174"
1049 634
1050[[package]] 635[[package]]
1051name = "proc-macro2" 636name = "predicates-tree"
1052version = "1.0.56" 637version = "1.0.9"
1053source = "registry+https://github.com/rust-lang/crates.io-index" 638source = "registry+https://github.com/rust-lang/crates.io-index"
1054checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" 639checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf"
1055dependencies = [ 640dependencies = [
1056 "unicode-ident", 641 "predicates-core",
642 "termtree",
1057] 643]
1058 644
1059[[package]] 645[[package]]
1060name = "quote" 646name = "proc-macro-error"
1061version = "1.0.26" 647version = "1.0.4"
1062source = "registry+https://github.com/rust-lang/crates.io-index" 648source = "registry+https://github.com/rust-lang/crates.io-index"
1063checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 649checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
1064dependencies = [ 650dependencies = [
651 "proc-macro-error-attr",
1065 "proc-macro2", 652 "proc-macro2",
653 "quote",
654 "syn 1.0.109",
655 "version_check",
1066] 656]
1067 657
1068[[package]] 658[[package]]
1069name = "rand" 659name = "proc-macro-error-attr"
1070version = "0.8.5" 660version = "1.0.4"
1071source = "registry+https://github.com/rust-lang/crates.io-index" 661source = "registry+https://github.com/rust-lang/crates.io-index"
1072checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 662checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
1073dependencies = [ 663dependencies = [
1074 "libc", 664 "proc-macro2",
1075 "rand_chacha", 665 "quote",
1076 "rand_core", 666 "version_check",
1077] 667]
1078 668
1079[[package]] 669[[package]]
1080name = "rand_chacha" 670name = "proc-macro2"
1081version = "0.3.1" 671version = "1.0.66"
1082source = "registry+https://github.com/rust-lang/crates.io-index" 672source = "registry+https://github.com/rust-lang/crates.io-index"
1083checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 673checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
1084dependencies = [ 674dependencies = [
1085 "ppv-lite86", 675 "unicode-ident",
1086 "rand_core",
1087] 676]
1088 677
1089[[package]] 678[[package]]
1090name = "rand_core" 679name = "quote"
1091version = "0.6.4" 680version = "1.0.33"
1092source = "registry+https://github.com/rust-lang/crates.io-index" 681source = "registry+https://github.com/rust-lang/crates.io-index"
1093checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 682checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
1094dependencies = [ 683dependencies = [
1095 "getrandom", 684 "proc-macro2",
1096] 685]
1097 686
1098[[package]] 687[[package]]
@@ -1101,7 +690,7 @@ version = "0.2.16"
1101source = "registry+https://github.com/rust-lang/crates.io-index" 690source = "registry+https://github.com/rust-lang/crates.io-index"
1102checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 691checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
1103dependencies = [ 692dependencies = [
1104 "bitflags", 693 "bitflags 1.3.2",
1105] 694]
1106 695
1107[[package]] 696[[package]]
@@ -1110,7 +699,7 @@ version = "0.3.5"
1110source = "registry+https://github.com/rust-lang/crates.io-index" 699source = "registry+https://github.com/rust-lang/crates.io-index"
1111checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 700checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
1112dependencies = [ 701dependencies = [
1113 "bitflags", 702 "bitflags 1.3.2",
1114] 703]
1115 704
1116[[package]] 705[[package]]
@@ -1125,178 +714,96 @@ dependencies = [
1125] 714]
1126 715
1127[[package]] 716[[package]]
1128name = "reqwest" 717name = "regex"
1129version = "0.11.17" 718version = "1.9.5"
1130source = "registry+https://github.com/rust-lang/crates.io-index" 719source = "registry+https://github.com/rust-lang/crates.io-index"
1131checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" 720checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47"
1132dependencies = [ 721dependencies = [
1133 "base64 0.21.0", 722 "aho-corasick",
1134 "bytes", 723 "memchr",
1135 "encoding_rs", 724 "regex-automata",
1136 "futures-core", 725 "regex-syntax",
1137 "futures-util",
1138 "h2",
1139 "http",
1140 "http-body",
1141 "hyper",
1142 "hyper-rustls",
1143 "ipnet",
1144 "js-sys",
1145 "log",
1146 "mime",
1147 "once_cell",
1148 "percent-encoding",
1149 "pin-project-lite",
1150 "rustls",
1151 "rustls-pemfile",
1152 "serde",
1153 "serde_json",
1154 "serde_urlencoded",
1155 "tokio",
1156 "tokio-rustls",
1157 "tokio-socks",
1158 "tower-service",
1159 "url",
1160 "wasm-bindgen",
1161 "wasm-bindgen-futures",
1162 "web-sys",
1163 "webpki-roots",
1164 "winreg",
1165] 726]
1166 727
1167[[package]] 728[[package]]
1168name = "ring" 729name = "regex-automata"
1169version = "0.16.20" 730version = "0.3.8"
1170source = "registry+https://github.com/rust-lang/crates.io-index" 731source = "registry+https://github.com/rust-lang/crates.io-index"
1171checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 732checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795"
1172dependencies = [ 733dependencies = [
1173 "cc", 734 "aho-corasick",
1174 "libc", 735 "memchr",
1175 "once_cell", 736 "regex-syntax",
1176 "spin",
1177 "untrusted",
1178 "web-sys",
1179 "winapi",
1180] 737]
1181 738
1182[[package]] 739[[package]]
1183name = "rustc_version" 740name = "regex-syntax"
1184version = "0.4.0" 741version = "0.7.5"
1185source = "registry+https://github.com/rust-lang/crates.io-index" 742source = "registry+https://github.com/rust-lang/crates.io-index"
1186checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 743checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
744
745[[package]]
746name = "rexpect"
747version = "0.5.0"
748source = "git+https://github.com/phaer/rexpect.git?branch=skip-ansi-escape-codes#f099dc4750e38a1c31d2ab06d7d3e0352679d85a"
1187dependencies = [ 749dependencies = [
1188 "semver", 750 "comma",
751 "nix",
752 "regex",
753 "tempfile",
754 "thiserror",
1189] 755]
1190 756
1191[[package]] 757[[package]]
1192name = "rustix" 758name = "rustix"
1193version = "0.37.18" 759version = "0.38.13"
1194source = "registry+https://github.com/rust-lang/crates.io-index" 760source = "registry+https://github.com/rust-lang/crates.io-index"
1195checksum = "8bbfc1d1c7c40c01715f47d71444744a81669ca84e8b63e25a55e169b1f86433" 761checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662"
1196dependencies = [ 762dependencies = [
1197 "bitflags", 763 "bitflags 2.4.0",
1198 "errno", 764 "errno",
1199 "io-lifetimes",
1200 "libc", 765 "libc",
1201 "linux-raw-sys", 766 "linux-raw-sys",
1202 "windows-sys 0.48.0", 767 "windows-sys 0.48.0",
1203] 768]
1204 769
1205[[package]] 770[[package]]
1206name = "rustls"
1207version = "0.20.8"
1208source = "registry+https://github.com/rust-lang/crates.io-index"
1209checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
1210dependencies = [
1211 "log",
1212 "ring",
1213 "sct",
1214 "webpki",
1215]
1216
1217[[package]]
1218name = "rustls-pemfile"
1219version = "1.0.2"
1220source = "registry+https://github.com/rust-lang/crates.io-index"
1221checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
1222dependencies = [
1223 "base64 0.21.0",
1224]
1225
1226[[package]]
1227name = "ryu" 771name = "ryu"
1228version = "1.0.13" 772version = "1.0.15"
1229source = "registry+https://github.com/rust-lang/crates.io-index"
1230checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
1231
1232[[package]]
1233name = "sct"
1234version = "0.7.0"
1235source = "registry+https://github.com/rust-lang/crates.io-index"
1236checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
1237dependencies = [
1238 "ring",
1239 "untrusted",
1240]
1241
1242[[package]]
1243name = "secp256k1"
1244version = "0.27.0"
1245source = "registry+https://github.com/rust-lang/crates.io-index"
1246checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f"
1247dependencies = [
1248 "bitcoin_hashes 0.12.0",
1249 "rand",
1250 "secp256k1-sys",
1251 "serde",
1252]
1253
1254[[package]]
1255name = "secp256k1-sys"
1256version = "0.8.1"
1257source = "registry+https://github.com/rust-lang/crates.io-index" 773source = "registry+https://github.com/rust-lang/crates.io-index"
1258checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" 774checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
1259dependencies = [
1260 "cc",
1261]
1262 775
1263[[package]] 776[[package]]
1264name = "semver" 777name = "scopeguard"
1265version = "1.0.17" 778version = "1.2.0"
1266source = "registry+https://github.com/rust-lang/crates.io-index" 779source = "registry+https://github.com/rust-lang/crates.io-index"
1267checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" 780checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1268
1269[[package]]
1270name = "send_wrapper"
1271version = "0.6.0"
1272source = "registry+https://github.com/rust-lang/crates.io-index"
1273checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
1274 781
1275[[package]] 782[[package]]
1276name = "serde" 783name = "serde"
1277version = "1.0.160" 784version = "1.0.188"
1278source = "registry+https://github.com/rust-lang/crates.io-index" 785source = "registry+https://github.com/rust-lang/crates.io-index"
1279checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" 786checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
1280dependencies = [ 787dependencies = [
1281 "serde_derive", 788 "serde_derive",
1282] 789]
1283 790
1284[[package]] 791[[package]]
1285name = "serde_derive" 792name = "serde_derive"
1286version = "1.0.160" 793version = "1.0.188"
1287source = "registry+https://github.com/rust-lang/crates.io-index" 794source = "registry+https://github.com/rust-lang/crates.io-index"
1288checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" 795checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
1289dependencies = [ 796dependencies = [
1290 "proc-macro2", 797 "proc-macro2",
1291 "quote", 798 "quote",
1292 "syn 2.0.15", 799 "syn 2.0.32",
1293] 800]
1294 801
1295[[package]] 802[[package]]
1296name = "serde_json" 803name = "serde_json"
1297version = "1.0.96" 804version = "1.0.106"
1298source = "registry+https://github.com/rust-lang/crates.io-index" 805source = "registry+https://github.com/rust-lang/crates.io-index"
1299checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 806checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2"
1300dependencies = [ 807dependencies = [
1301 "itoa", 808 "itoa",
1302 "ryu", 809 "ryu",
@@ -1304,26 +811,28 @@ dependencies = [
1304] 811]
1305 812
1306[[package]] 813[[package]]
1307name = "serde_urlencoded" 814name = "serial_test"
1308version = "0.7.1" 815version = "2.0.0"
1309source = "registry+https://github.com/rust-lang/crates.io-index" 816source = "registry+https://github.com/rust-lang/crates.io-index"
1310checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 817checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d"
1311dependencies = [ 818dependencies = [
1312 "form_urlencoded", 819 "dashmap",
1313 "itoa", 820 "futures",
1314 "ryu", 821 "lazy_static",
1315 "serde", 822 "log",
823 "parking_lot",
824 "serial_test_derive",
1316] 825]
1317 826
1318[[package]] 827[[package]]
1319name = "sha1" 828name = "serial_test_derive"
1320version = "0.10.5" 829version = "2.0.0"
1321source = "registry+https://github.com/rust-lang/crates.io-index" 830source = "registry+https://github.com/rust-lang/crates.io-index"
1322checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 831checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
1323dependencies = [ 832dependencies = [
1324 "cfg-if", 833 "proc-macro2",
1325 "cpufeatures", 834 "quote",
1326 "digest", 835 "syn 2.0.32",
1327] 836]
1328 837
1329[[package]] 838[[package]]
@@ -1334,28 +843,27 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
1334 843
1335[[package]] 844[[package]]
1336name = "slab" 845name = "slab"
1337version = "0.4.8" 846version = "0.4.9"
1338source = "registry+https://github.com/rust-lang/crates.io-index" 847source = "registry+https://github.com/rust-lang/crates.io-index"
1339checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 848checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
1340dependencies = [ 849dependencies = [
1341 "autocfg", 850 "autocfg",
1342] 851]
1343 852
1344[[package]] 853[[package]]
1345name = "socket2" 854name = "smallvec"
1346version = "0.4.9" 855version = "1.11.0"
1347source = "registry+https://github.com/rust-lang/crates.io-index" 856source = "registry+https://github.com/rust-lang/crates.io-index"
1348checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 857checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
1349dependencies = [
1350 "libc",
1351 "winapi",
1352]
1353 858
1354[[package]] 859[[package]]
1355name = "spin" 860name = "strip-ansi-escapes"
1356version = "0.5.2" 861version = "0.2.0"
1357source = "registry+https://github.com/rust-lang/crates.io-index" 862source = "registry+https://github.com/rust-lang/crates.io-index"
1358checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 863checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa"
864dependencies = [
865 "vte",
866]
1359 867
1360[[package]] 868[[package]]
1361name = "strsim" 869name = "strsim"
@@ -1376,9 +884,9 @@ dependencies = [
1376 884
1377[[package]] 885[[package]]
1378name = "syn" 886name = "syn"
1379version = "2.0.15" 887version = "2.0.32"
1380source = "registry+https://github.com/rust-lang/crates.io-index" 888source = "registry+https://github.com/rust-lang/crates.io-index"
1381checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" 889checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2"
1382dependencies = [ 890dependencies = [
1383 "proc-macro2", 891 "proc-macro2",
1384 "quote", 892 "quote",
@@ -1387,221 +895,60 @@ dependencies = [
1387 895
1388[[package]] 896[[package]]
1389name = "tempfile" 897name = "tempfile"
1390version = "3.5.0" 898version = "3.8.0"
1391source = "registry+https://github.com/rust-lang/crates.io-index" 899source = "registry+https://github.com/rust-lang/crates.io-index"
1392checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" 900checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef"
1393dependencies = [ 901dependencies = [
1394 "cfg-if", 902 "cfg-if",
1395 "fastrand", 903 "fastrand",
1396 "redox_syscall 0.3.5", 904 "redox_syscall 0.3.5",
1397 "rustix", 905 "rustix",
1398 "windows-sys 0.45.0", 906 "windows-sys 0.48.0",
1399] 907]
1400 908
1401[[package]] 909[[package]]
1402name = "thiserror" 910name = "termtree"
1403version = "1.0.40" 911version = "0.4.1"
1404source = "registry+https://github.com/rust-lang/crates.io-index" 912source = "registry+https://github.com/rust-lang/crates.io-index"
1405checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 913checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
1406dependencies = [
1407 "thiserror-impl",
1408]
1409 914
1410[[package]] 915[[package]]
1411name = "thiserror-impl" 916name = "test_utils"
1412version = "1.0.40" 917version = "0.1.0"
1413source = "registry+https://github.com/rust-lang/crates.io-index"
1414checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
1415dependencies = [
1416 "proc-macro2",
1417 "quote",
1418 "syn 2.0.15",
1419]
1420
1421[[package]]
1422name = "tinyvec"
1423version = "1.6.0"
1424source = "registry+https://github.com/rust-lang/crates.io-index"
1425checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
1426dependencies = [ 918dependencies = [
1427 "tinyvec_macros", 919 "anyhow",
920 "assert_cmd",
921 "dialoguer",
922 "directories",
923 "rexpect",
924 "strip-ansi-escapes",
1428] 925]
1429 926
1430[[package]] 927[[package]]
1431name = "tinyvec_macros" 928name = "thiserror"
1432version = "0.1.1" 929version = "1.0.48"
1433source = "registry+https://github.com/rust-lang/crates.io-index"
1434checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1435
1436[[package]]
1437name = "tokio"
1438version = "1.28.0"
1439source = "registry+https://github.com/rust-lang/crates.io-index" 930source = "registry+https://github.com/rust-lang/crates.io-index"
1440checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" 931checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7"
1441dependencies = [ 932dependencies = [
1442 "autocfg", 933 "thiserror-impl",
1443 "bytes",
1444 "libc",
1445 "mio",
1446 "num_cpus",
1447 "pin-project-lite",
1448 "socket2",
1449 "tokio-macros",
1450 "windows-sys 0.48.0",
1451] 934]
1452 935
1453[[package]] 936[[package]]
1454name = "tokio-macros" 937name = "thiserror-impl"
1455version = "2.1.0" 938version = "1.0.48"
1456source = "registry+https://github.com/rust-lang/crates.io-index" 939source = "registry+https://github.com/rust-lang/crates.io-index"
1457checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 940checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35"
1458dependencies = [ 941dependencies = [
1459 "proc-macro2", 942 "proc-macro2",
1460 "quote", 943 "quote",
1461 "syn 2.0.15", 944 "syn 2.0.32",
1462]
1463
1464[[package]]
1465name = "tokio-rustls"
1466version = "0.23.4"
1467source = "registry+https://github.com/rust-lang/crates.io-index"
1468checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
1469dependencies = [
1470 "rustls",
1471 "tokio",
1472 "webpki",
1473]
1474
1475[[package]]
1476name = "tokio-socks"
1477version = "0.5.1"
1478source = "registry+https://github.com/rust-lang/crates.io-index"
1479checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0"
1480dependencies = [
1481 "either",
1482 "futures-util",
1483 "thiserror",
1484 "tokio",
1485]
1486
1487[[package]]
1488name = "tokio-tungstenite"
1489version = "0.18.0"
1490source = "registry+https://github.com/rust-lang/crates.io-index"
1491checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd"
1492dependencies = [
1493 "futures-util",
1494 "log",
1495 "rustls",
1496 "tokio",
1497 "tokio-rustls",
1498 "tungstenite",
1499 "webpki",
1500 "webpki-roots",
1501]
1502
1503[[package]]
1504name = "tokio-util"
1505version = "0.7.8"
1506source = "registry+https://github.com/rust-lang/crates.io-index"
1507checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d"
1508dependencies = [
1509 "bytes",
1510 "futures-core",
1511 "futures-sink",
1512 "pin-project-lite",
1513 "tokio",
1514 "tracing",
1515]
1516
1517[[package]]
1518name = "toml"
1519version = "0.5.11"
1520source = "registry+https://github.com/rust-lang/crates.io-index"
1521checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
1522dependencies = [
1523 "serde",
1524]
1525
1526[[package]]
1527name = "tower-service"
1528version = "0.3.2"
1529source = "registry+https://github.com/rust-lang/crates.io-index"
1530checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
1531
1532[[package]]
1533name = "tracing"
1534version = "0.1.37"
1535source = "registry+https://github.com/rust-lang/crates.io-index"
1536checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
1537dependencies = [
1538 "cfg-if",
1539 "pin-project-lite",
1540 "tracing-core",
1541] 945]
1542 946
1543[[package]] 947[[package]]
1544name = "tracing-core"
1545version = "0.1.30"
1546source = "registry+https://github.com/rust-lang/crates.io-index"
1547checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
1548dependencies = [
1549 "once_cell",
1550]
1551
1552[[package]]
1553name = "try-lock"
1554version = "0.2.4"
1555source = "registry+https://github.com/rust-lang/crates.io-index"
1556checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
1557
1558[[package]]
1559name = "tungstenite"
1560version = "0.18.0"
1561source = "registry+https://github.com/rust-lang/crates.io-index"
1562checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788"
1563dependencies = [
1564 "base64 0.13.1",
1565 "byteorder",
1566 "bytes",
1567 "http",
1568 "httparse",
1569 "log",
1570 "rand",
1571 "rustls",
1572 "sha1",
1573 "thiserror",
1574 "url",
1575 "utf-8",
1576 "webpki",
1577]
1578
1579[[package]]
1580name = "typenum"
1581version = "1.16.0"
1582source = "registry+https://github.com/rust-lang/crates.io-index"
1583checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
1584
1585[[package]]
1586name = "unicode-bidi"
1587version = "0.3.13"
1588source = "registry+https://github.com/rust-lang/crates.io-index"
1589checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
1590
1591[[package]]
1592name = "unicode-ident" 948name = "unicode-ident"
1593version = "1.0.8" 949version = "1.0.11"
1594source = "registry+https://github.com/rust-lang/crates.io-index" 950source = "registry+https://github.com/rust-lang/crates.io-index"
1595checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 951checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
1596
1597[[package]]
1598name = "unicode-normalization"
1599version = "0.1.22"
1600source = "registry+https://github.com/rust-lang/crates.io-index"
1601checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
1602dependencies = [
1603 "tinyvec",
1604]
1605 952
1606[[package]] 953[[package]]
1607name = "unicode-width" 954name = "unicode-width"
@@ -1610,194 +957,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1610checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 957checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
1611 958
1612[[package]] 959[[package]]
1613name = "untrusted"
1614version = "0.7.1"
1615source = "registry+https://github.com/rust-lang/crates.io-index"
1616checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
1617
1618[[package]]
1619name = "url"
1620version = "2.3.1"
1621source = "registry+https://github.com/rust-lang/crates.io-index"
1622checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
1623dependencies = [
1624 "form_urlencoded",
1625 "idna",
1626 "percent-encoding",
1627 "serde",
1628]
1629
1630[[package]]
1631name = "utf-8"
1632version = "0.7.6"
1633source = "registry+https://github.com/rust-lang/crates.io-index"
1634checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
1635
1636[[package]]
1637name = "utf8parse" 960name = "utf8parse"
1638version = "0.2.1" 961version = "0.2.1"
1639source = "registry+https://github.com/rust-lang/crates.io-index" 962source = "registry+https://github.com/rust-lang/crates.io-index"
1640checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 963checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
1641 964
1642[[package]] 965[[package]]
1643name = "vcpkg"
1644version = "0.2.15"
1645source = "registry+https://github.com/rust-lang/crates.io-index"
1646checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
1647
1648[[package]]
1649name = "version_check" 966name = "version_check"
1650version = "0.9.4" 967version = "0.9.4"
1651source = "registry+https://github.com/rust-lang/crates.io-index" 968source = "registry+https://github.com/rust-lang/crates.io-index"
1652checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 969checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1653 970
1654[[package]] 971[[package]]
1655name = "want" 972name = "vte"
1656version = "0.3.0" 973version = "0.11.1"
1657source = "registry+https://github.com/rust-lang/crates.io-index"
1658checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
1659dependencies = [
1660 "log",
1661 "try-lock",
1662]
1663
1664[[package]]
1665name = "wasi"
1666version = "0.11.0+wasi-snapshot-preview1"
1667source = "registry+https://github.com/rust-lang/crates.io-index"
1668checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1669
1670[[package]]
1671name = "wasm-bindgen"
1672version = "0.2.84"
1673source = "registry+https://github.com/rust-lang/crates.io-index"
1674checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
1675dependencies = [
1676 "cfg-if",
1677 "wasm-bindgen-macro",
1678]
1679
1680[[package]]
1681name = "wasm-bindgen-backend"
1682version = "0.2.84"
1683source = "registry+https://github.com/rust-lang/crates.io-index"
1684checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
1685dependencies = [
1686 "bumpalo",
1687 "log",
1688 "once_cell",
1689 "proc-macro2",
1690 "quote",
1691 "syn 1.0.109",
1692 "wasm-bindgen-shared",
1693]
1694
1695[[package]]
1696name = "wasm-bindgen-futures"
1697version = "0.4.34"
1698source = "registry+https://github.com/rust-lang/crates.io-index" 974source = "registry+https://github.com/rust-lang/crates.io-index"
1699checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" 975checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197"
1700dependencies = [ 976dependencies = [
1701 "cfg-if", 977 "utf8parse",
1702 "js-sys", 978 "vte_generate_state_changes",
1703 "wasm-bindgen",
1704 "web-sys",
1705]
1706
1707[[package]]
1708name = "wasm-bindgen-macro"
1709version = "0.2.84"
1710source = "registry+https://github.com/rust-lang/crates.io-index"
1711checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
1712dependencies = [
1713 "quote",
1714 "wasm-bindgen-macro-support",
1715] 979]
1716 980
1717[[package]] 981[[package]]
1718name = "wasm-bindgen-macro-support" 982name = "vte_generate_state_changes"
1719version = "0.2.84" 983version = "0.1.1"
1720source = "registry+https://github.com/rust-lang/crates.io-index" 984source = "registry+https://github.com/rust-lang/crates.io-index"
1721checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 985checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff"
1722dependencies = [ 986dependencies = [
1723 "proc-macro2", 987 "proc-macro2",
1724 "quote", 988 "quote",
1725 "syn 1.0.109",
1726 "wasm-bindgen-backend",
1727 "wasm-bindgen-shared",
1728] 989]
1729 990
1730[[package]] 991[[package]]
1731name = "wasm-bindgen-shared" 992name = "wait-timeout"
1732version = "0.2.84" 993version = "0.2.0"
1733source = "registry+https://github.com/rust-lang/crates.io-index"
1734checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
1735
1736[[package]]
1737name = "web-sys"
1738version = "0.3.61"
1739source = "registry+https://github.com/rust-lang/crates.io-index"
1740checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
1741dependencies = [
1742 "js-sys",
1743 "wasm-bindgen",
1744]
1745
1746[[package]]
1747name = "webpki"
1748version = "0.22.0"
1749source = "registry+https://github.com/rust-lang/crates.io-index"
1750checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
1751dependencies = [
1752 "ring",
1753 "untrusted",
1754]
1755
1756[[package]]
1757name = "webpki-roots"
1758version = "0.22.6"
1759source = "registry+https://github.com/rust-lang/crates.io-index"
1760checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
1761dependencies = [
1762 "webpki",
1763]
1764
1765[[package]]
1766name = "winapi"
1767version = "0.3.9"
1768source = "registry+https://github.com/rust-lang/crates.io-index" 994source = "registry+https://github.com/rust-lang/crates.io-index"
1769checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 995checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
1770dependencies = [ 996dependencies = [
1771 "winapi-i686-pc-windows-gnu", 997 "libc",
1772 "winapi-x86_64-pc-windows-gnu",
1773] 998]
1774 999
1775[[package]] 1000[[package]]
1776name = "winapi-i686-pc-windows-gnu" 1001name = "wasi"
1777version = "0.4.0" 1002version = "0.11.0+wasi-snapshot-preview1"
1778source = "registry+https://github.com/rust-lang/crates.io-index"
1779checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1780
1781[[package]]
1782name = "winapi-x86_64-pc-windows-gnu"
1783version = "0.4.0"
1784source = "registry+https://github.com/rust-lang/crates.io-index"
1785checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1786
1787[[package]]
1788name = "windows-sys"
1789version = "0.42.0"
1790source = "registry+https://github.com/rust-lang/crates.io-index" 1003source = "registry+https://github.com/rust-lang/crates.io-index"
1791checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1004checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1792dependencies = [
1793 "windows_aarch64_gnullvm 0.42.2",
1794 "windows_aarch64_msvc 0.42.2",
1795 "windows_i686_gnu 0.42.2",
1796 "windows_i686_msvc 0.42.2",
1797 "windows_x86_64_gnu 0.42.2",
1798 "windows_x86_64_gnullvm 0.42.2",
1799 "windows_x86_64_msvc 0.42.2",
1800]
1801 1005
1802[[package]] 1006[[package]]
1803name = "windows-sys" 1007name = "windows-sys"
@@ -1814,7 +1018,7 @@ version = "0.48.0"
1814source = "registry+https://github.com/rust-lang/crates.io-index" 1018source = "registry+https://github.com/rust-lang/crates.io-index"
1815checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1019checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
1816dependencies = [ 1020dependencies = [
1817 "windows-targets 0.48.0", 1021 "windows-targets 0.48.5",
1818] 1022]
1819 1023
1820[[package]] 1024[[package]]
@@ -1834,17 +1038,17 @@ dependencies = [
1834 1038
1835[[package]] 1039[[package]]
1836name = "windows-targets" 1040name = "windows-targets"
1837version = "0.48.0" 1041version = "0.48.5"
1838source = "registry+https://github.com/rust-lang/crates.io-index" 1042source = "registry+https://github.com/rust-lang/crates.io-index"
1839checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 1043checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
1840dependencies = [ 1044dependencies = [
1841 "windows_aarch64_gnullvm 0.48.0", 1045 "windows_aarch64_gnullvm 0.48.5",
1842 "windows_aarch64_msvc 0.48.0", 1046 "windows_aarch64_msvc 0.48.5",
1843 "windows_i686_gnu 0.48.0", 1047 "windows_i686_gnu 0.48.5",
1844 "windows_i686_msvc 0.48.0", 1048 "windows_i686_msvc 0.48.5",
1845 "windows_x86_64_gnu 0.48.0", 1049 "windows_x86_64_gnu 0.48.5",
1846 "windows_x86_64_gnullvm 0.48.0", 1050 "windows_x86_64_gnullvm 0.48.5",
1847 "windows_x86_64_msvc 0.48.0", 1051 "windows_x86_64_msvc 0.48.5",
1848] 1052]
1849 1053
1850[[package]] 1054[[package]]
@@ -1855,9 +1059,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
1855 1059
1856[[package]] 1060[[package]]
1857name = "windows_aarch64_gnullvm" 1061name = "windows_aarch64_gnullvm"
1858version = "0.48.0" 1062version = "0.48.5"
1859source = "registry+https://github.com/rust-lang/crates.io-index" 1063source = "registry+https://github.com/rust-lang/crates.io-index"
1860checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1064checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
1861 1065
1862[[package]] 1066[[package]]
1863name = "windows_aarch64_msvc" 1067name = "windows_aarch64_msvc"
@@ -1867,9 +1071,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
1867 1071
1868[[package]] 1072[[package]]
1869name = "windows_aarch64_msvc" 1073name = "windows_aarch64_msvc"
1870version = "0.48.0" 1074version = "0.48.5"
1871source = "registry+https://github.com/rust-lang/crates.io-index" 1075source = "registry+https://github.com/rust-lang/crates.io-index"
1872checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1076checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
1873 1077
1874[[package]] 1078[[package]]
1875name = "windows_i686_gnu" 1079name = "windows_i686_gnu"
@@ -1879,9 +1083,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
1879 1083
1880[[package]] 1084[[package]]
1881name = "windows_i686_gnu" 1085name = "windows_i686_gnu"
1882version = "0.48.0" 1086version = "0.48.5"
1883source = "registry+https://github.com/rust-lang/crates.io-index" 1087source = "registry+https://github.com/rust-lang/crates.io-index"
1884checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1088checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
1885 1089
1886[[package]] 1090[[package]]
1887name = "windows_i686_msvc" 1091name = "windows_i686_msvc"
@@ -1891,9 +1095,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
1891 1095
1892[[package]] 1096[[package]]
1893name = "windows_i686_msvc" 1097name = "windows_i686_msvc"
1894version = "0.48.0" 1098version = "0.48.5"
1895source = "registry+https://github.com/rust-lang/crates.io-index" 1099source = "registry+https://github.com/rust-lang/crates.io-index"
1896checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1100checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
1897 1101
1898[[package]] 1102[[package]]
1899name = "windows_x86_64_gnu" 1103name = "windows_x86_64_gnu"
@@ -1903,9 +1107,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
1903 1107
1904[[package]] 1108[[package]]
1905name = "windows_x86_64_gnu" 1109name = "windows_x86_64_gnu"
1906version = "0.48.0" 1110version = "0.48.5"
1907source = "registry+https://github.com/rust-lang/crates.io-index" 1111source = "registry+https://github.com/rust-lang/crates.io-index"
1908checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1112checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
1909 1113
1910[[package]] 1114[[package]]
1911name = "windows_x86_64_gnullvm" 1115name = "windows_x86_64_gnullvm"
@@ -1915,9 +1119,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
1915 1119
1916[[package]] 1120[[package]]
1917name = "windows_x86_64_gnullvm" 1121name = "windows_x86_64_gnullvm"
1918version = "0.48.0" 1122version = "0.48.5"
1919source = "registry+https://github.com/rust-lang/crates.io-index" 1123source = "registry+https://github.com/rust-lang/crates.io-index"
1920checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1124checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
1921 1125
1922[[package]] 1126[[package]]
1923name = "windows_x86_64_msvc" 1127name = "windows_x86_64_msvc"
@@ -1927,37 +1131,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
1927 1131
1928[[package]] 1132[[package]]
1929name = "windows_x86_64_msvc" 1133name = "windows_x86_64_msvc"
1930version = "0.48.0" 1134version = "0.48.5"
1931source = "registry+https://github.com/rust-lang/crates.io-index"
1932checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
1933
1934[[package]]
1935name = "winreg"
1936version = "0.10.1"
1937source = "registry+https://github.com/rust-lang/crates.io-index" 1135source = "registry+https://github.com/rust-lang/crates.io-index"
1938checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 1136checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
1939dependencies = [
1940 "winapi",
1941]
1942
1943[[package]]
1944name = "ws_stream_wasm"
1945version = "0.7.4"
1946source = "registry+https://github.com/rust-lang/crates.io-index"
1947checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5"
1948dependencies = [
1949 "async_io_stream",
1950 "futures",
1951 "js-sys",
1952 "log",
1953 "pharos",
1954 "rustc_version",
1955 "send_wrapper",
1956 "thiserror",
1957 "wasm-bindgen",
1958 "wasm-bindgen-futures",
1959 "web-sys",
1960]
1961 1137
1962[[package]] 1138[[package]]
1963name = "zeroize" 1139name = "zeroize"
diff --git a/Cargo.toml b/Cargo.toml
index ac3e916..e745441 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
2name = "ngit" 2name = "ngit"
3version = "0.0.1" 3version = "0.0.1"
4edition = "2021" 4edition = "2021"
5description = "a proof of concept cli for a nostr based github alternative" 5description = "cli for code collaboration over nostr"
6authors = ["DanConwayDev <DanConwayDev@protonmail.com>"] 6authors = ["DanConwayDev <DanConwayDev@protonmail.com>"]
7readme = "README.md" 7readme = "README.md"
8homepage = "https://github.com/DanConwayDev/ngit-cli" 8homepage = "https://github.com/DanConwayDev/ngit-cli"
@@ -12,17 +12,21 @@ keywords = ["nostr", "git"]
12categories = ["command-line-utilities","git"] 12categories = ["command-line-utilities","git"]
13 13
14[dependencies] 14[dependencies]
15clap = { version = "4.1.6", features = ["derive"] } 15anyhow = "1.0.75"
16nostr = { version = "0.21" } 16clap = { version = "4.3.19", features = ["derive"] }
17nostr-sdk = { version = "0.21", features = ["blocking"] }
18serde = { version = "1.0.147", features = ["derive"] }
19serde_json = "1.0.91"
20dialoguer = "0.10.4" 17dialoguer = "0.10.4"
21indicatif = "0.17.3" 18directories = "5.0.1"
22thiserror = "1.0" 19serde = { version = "1.0.181", features = ["derive"] }
23confy = "0.5.1" 20serde_json = "1.0.105"
24git2 = "0.17.1"
25 21
26[patch.crates-io] 22[dev-dependencies]
27nostr = { git = 'https://github.com/DanConwayDev/nostr.git', features = ["blocking"] } 23assert_cmd = "2.0.12"
24duplicate = "1.0.0"
25mockall = "0.11.4"
26serial_test = "2.0.0"
27test_utils = { path = "test_utils" }
28 28
29[workspace]
30members = [
31 "test_utils",
32]
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..dfdef63
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2023 DanConwayDev
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE. \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b9aacd7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
1# ngit
2
3cli for code collaboration over nostr
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..29425ed
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,130 @@
1{
2 "nodes": {
3 "flake-utils": {
4 "inputs": {
5 "systems": "systems"
6 },
7 "locked": {
8 "lastModified": 1692799911,
9 "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
10 "owner": "numtide",
11 "repo": "flake-utils",
12 "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
13 "type": "github"
14 },
15 "original": {
16 "owner": "numtide",
17 "repo": "flake-utils",
18 "type": "github"
19 }
20 },
21 "flake-utils_2": {
22 "inputs": {
23 "systems": "systems_2"
24 },
25 "locked": {
26 "lastModified": 1681202837,
27 "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
28 "owner": "numtide",
29 "repo": "flake-utils",
30 "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
31 "type": "github"
32 },
33 "original": {
34 "owner": "numtide",
35 "repo": "flake-utils",
36 "type": "github"
37 }
38 },
39 "nixpkgs": {
40 "locked": {
41 "lastModified": 1694183432,
42 "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=",
43 "owner": "NixOS",
44 "repo": "nixpkgs",
45 "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b",
46 "type": "github"
47 },
48 "original": {
49 "owner": "NixOS",
50 "ref": "nixos-unstable",
51 "repo": "nixpkgs",
52 "type": "github"
53 }
54 },
55 "nixpkgs_2": {
56 "locked": {
57 "lastModified": 1681358109,
58 "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
59 "owner": "NixOS",
60 "repo": "nixpkgs",
61 "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
62 "type": "github"
63 },
64 "original": {
65 "owner": "NixOS",
66 "ref": "nixpkgs-unstable",
67 "repo": "nixpkgs",
68 "type": "github"
69 }
70 },
71 "root": {
72 "inputs": {
73 "flake-utils": "flake-utils",
74 "nixpkgs": "nixpkgs",
75 "rust-overlay": "rust-overlay"
76 }
77 },
78 "rust-overlay": {
79 "inputs": {
80 "flake-utils": "flake-utils_2",
81 "nixpkgs": "nixpkgs_2"
82 },
83 "locked": {
84 "lastModified": 1694398298,
85 "narHash": "sha256-Hi904+2V5DJhFdEy9DcARSRrGJOlYSILHUC6CgTtuZU=",
86 "owner": "oxalica",
87 "repo": "rust-overlay",
88 "rev": "6c520f2e31f4bebeb29cc4563543de7187013575",
89 "type": "github"
90 },
91 "original": {
92 "owner": "oxalica",
93 "repo": "rust-overlay",
94 "type": "github"
95 }
96 },
97 "systems": {
98 "locked": {
99 "lastModified": 1681028828,
100 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
101 "owner": "nix-systems",
102 "repo": "default",
103 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
104 "type": "github"
105 },
106 "original": {
107 "owner": "nix-systems",
108 "repo": "default",
109 "type": "github"
110 }
111 },
112 "systems_2": {
113 "locked": {
114 "lastModified": 1681028828,
115 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
116 "owner": "nix-systems",
117 "repo": "default",
118 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
119 "type": "github"
120 },
121 "original": {
122 "owner": "nix-systems",
123 "repo": "default",
124 "type": "github"
125 }
126 }
127 },
128 "root": "root",
129 "version": 7
130}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..7c36e2d
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,52 @@
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4 rust-overlay.url = "github:oxalica/rust-overlay";
5 flake-utils.url = "github:numtide/flake-utils";
6 };
7
8 outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
9 flake-utils.lib.eachDefaultSystem (system:
10 let
11 overlays = [ (import rust-overlay) ];
12 pkgs = import nixpkgs {
13 inherit system overlays;
14 };
15 in
16 with pkgs;
17 {
18 devShells.default = mkShell {
19
20 nativeBuildInputs = [
21 # stable to be introduced when the following issue is resolved
22 # https://github.com/oxalica/rust-overlay/issues/136
23 # rust-bin.stable.latest.default
24 # nightly for rustfmt
25 (
26 rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
27 extensions = [
28 "rust-src"
29 "rustfmt"
30 "clippy"
31 ];
32 })
33 )
34 ];
35
36 buildInputs = [
37 rust-analyzer
38 gitlint
39 ];
40 shellHook = ''
41 # auto-install git hooks
42 dot_git="$(git rev-parse --git-common-dir)"
43 if [[ ! -d "$dot_git/hooks" ]]; then mkdir "$dot_git/hooks"; fi
44 for hook in git_hooks/* ; do ln -sf "$(pwd)/$hook" "$dot_git/hooks/" ; done
45
46 # For rust-analyzer 'hover' tooltips to work.
47 export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
48 '';
49 };
50 }
51 );
52}
diff --git a/git_hooks/commit-msg b/git_hooks/commit-msg
new file mode 100755
index 0000000..e754e8d
--- /dev/null
+++ b/git_hooks/commit-msg
@@ -0,0 +1,35 @@
1#!/bin/sh
2### gitlint commit-msg hook start ###
3
4# Determine whether we have a tty available by trying to access it.
5# This allows us to deal with UI based gitclient's like Atlassian SourceTree.
6# NOTE: "exec < /dev/tty" sets stdin to the keyboard
7stdin_available=1
8(exec < /dev/tty) 2> /dev/null || stdin_available=0
9
10if [ $stdin_available -eq 1 ]; then
11 # Now that we know we have a functional tty, set stdin to it so we can ask the user questions :-)
12 exec < /dev/tty
13
14 # On Windows, we need to explicitly set our stdout to the tty to make terminal editing work (e.g. vim)
15 # See SO for windows detection in bash (slight modified to work on plain shell (not bash)):
16 # https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script
17 if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "win32" ]; then
18 exec > /dev/tty
19 fi
20fi
21
22gitlint --staged --msg-filename "$1" run-hook
23exit_code=$?
24
25# If we fail to find the gitlint binary (command not found), let's retry by executing as a python module.
26# This is the case for Atlassian SourceTree, where $PATH deviates from the user's shell $PATH.
27if [ $exit_code -eq 127 ]; then
28 echo "Fallback to python module execution"
29 python -m gitlint.cli --staged --msg-filename "$1" run-hook
30 exit_code=$?
31fi
32
33exit $exit_code
34
35### gitlint commit-msg hook end ###
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit
new file mode 100755
index 0000000..63b191d
--- /dev/null
+++ b/git_hooks/pre-commit
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3set -eu
4
5if ! cargo fmt -- --check
6then
7 echo "There are some code style issues."
8 echo "Run cargo fmt first."
9 exit 1
10fi
11
12if ! cargo clippy --all-targets -- -D warnings
13then
14 echo "There are some clippy issues."
15 exit 1
16fi
17
18if ! cargo test
19then
20 echo "There are some test issues."
21 exit 1
22fi
23
24exit 0 \ No newline at end of file
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..bcf7279
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,13 @@
1unstable_features = true
2version = "Two"
3
4# Imports
5imports_granularity = "Crate"
6group_imports = "StdExternalCrate"
7
8# Consistency
9newline_style = "Unix"
10
11# Comments
12wrap_comments = true
13format_code_in_doc_comments = true
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..8745f50
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1 @@
(builtins.getFlake ("git+file://" + toString ./.)).devShells.${builtins.currentSystem}.default
diff --git a/src/cli_interactor.rs b/src/cli_interactor.rs
new file mode 100644
index 0000000..2f28aee
--- /dev/null
+++ b/src/cli_interactor.rs
@@ -0,0 +1,34 @@
1use anyhow::{bail, Result};
2use dialoguer::{theme::ColorfulTheme, Input};
3#[cfg(test)]
4use mockall::*;
5
6#[derive(Default)]
7pub struct Interactor {
8 theme: ColorfulTheme,
9}
10
11#[cfg_attr(test, automock)]
12pub trait InteractorPrompt {
13 fn input(&self, parms: PromptInputParms) -> Result<String>;
14}
15impl InteractorPrompt for Interactor {
16 fn input(&self, parms: PromptInputParms) -> Result<String> {
17 let input: String = Input::with_theme(&self.theme)
18 .with_prompt(parms.prompt)
19 .interact_text()?;
20 Ok(input)
21 }
22}
23
24#[derive(Default)]
25pub struct PromptInputParms {
26 pub prompt: String,
27}
28
29impl PromptInputParms {
30 pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self {
31 self.prompt = prompt.into();
32 self
33 }
34}
diff --git a/src/config.rs b/src/config.rs
new file mode 100644
index 0000000..b26dea0
--- /dev/null
+++ b/src/config.rs
@@ -0,0 +1,152 @@
1use std::{fs::File, io::BufReader};
2
3use anyhow::{anyhow, Context, Result};
4use directories::ProjectDirs;
5#[cfg(test)]
6use mockall::*;
7use serde::{self, Deserialize, Serialize};
8
9#[derive(Default)]
10#[allow(clippy::module_name_repetitions)]
11pub struct ConfigManager;
12
13#[cfg_attr(test, automock)]
14#[allow(clippy::module_name_repetitions)]
15pub trait ConfigManagement {
16 fn load(&self) -> Result<MyConfig>;
17 fn save(&self, cfg: &MyConfig) -> Result<()>;
18}
19
20pub fn get_dirs() -> Result<ProjectDirs> {
21 ProjectDirs::from("", "CodeCollaboration", "ngit").ok_or(anyhow!(
22 "should find operating system home directories with rust-directories crate"
23 ))
24}
25
26impl ConfigManagement for ConfigManager {
27 fn load(&self) -> Result<MyConfig> {
28 let config_path = get_dirs()?.config_dir().join("config.json");
29 if config_path.exists() {
30 let file =
31 File::open(config_path).context("should open application configuration file")?;
32 let reader = BufReader::new(file);
33 let config: MyConfig = serde_json::from_reader(reader)
34 .context("should read config from config file with serde_json")?;
35 Ok(config)
36 } else {
37 Ok(MyConfig::default())
38 }
39 }
40 fn save(&self, cfg: &MyConfig) -> Result<()> {
41 let dirs = get_dirs()?;
42 let config_path = dirs.config_dir().join("config.json");
43 let file = if config_path.exists() {
44 std::fs::OpenOptions::new()
45 .create(true)
46 .write(true)
47 .truncate(true)
48 .open(config_path)
49 .context(
50 "should open application configuration file with write and truncate options",
51 )?
52 } else {
53 std::fs::create_dir_all(dirs.config_dir())
54 .context("should create application config directories")?;
55 std::fs::File::create(config_path).context("should create application config file")?
56 };
57 serde_json::to_writer_pretty(file, cfg)
58 .context("should write configuration to config file with serde_json")
59 }
60}
61
62#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq)]
63#[allow(clippy::module_name_repetitions)]
64pub struct MyConfig {
65 pub version: u8,
66 pub users: Vec<UserRef>,
67}
68
69#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
70pub struct UserRef {
71 pub nsec: String,
72}
73
74#[cfg(test)]
75mod tests {
76 use anyhow::Result;
77 use serial_test::serial;
78 use test_utils::*;
79
80 use super::*;
81
82 mod load {
83 use super::*;
84
85 #[test]
86 #[serial]
87 fn when_config_file_doesnt_exist_defaults_are_returned() -> Result<()> {
88 with_fresh_config(|| {
89 assert_eq!(ConfigManager.load()?, MyConfig::default());
90
91 Ok(())
92 })
93 }
94
95 #[test]
96 #[serial]
97 fn when_config_file_exists_it_is_returned() -> Result<()> {
98 with_fresh_config(|| {
99 let c = ConfigManager;
100 let new_config = MyConfig {
101 version: 255,
102 ..MyConfig::default()
103 };
104 c.save(&new_config)?;
105 assert_eq!(c.load()?, new_config);
106
107 Ok(())
108 })
109 }
110 }
111
112 mod save {
113 use super::*;
114
115 #[test]
116 #[serial]
117 fn when_config_file_doesnt_config_is_saved() -> Result<()> {
118 with_fresh_config(|| {
119 let c = ConfigManager;
120 let new_config = MyConfig {
121 version: 255,
122 ..MyConfig::default()
123 };
124 c.save(&new_config)?;
125 assert_eq!(c.load()?, new_config);
126
127 Ok(())
128 })
129 }
130
131 #[test]
132 #[serial]
133 fn when_config_file_exists_new_config_is_saved() -> Result<()> {
134 with_fresh_config(|| {
135 let c = ConfigManager;
136 let config = MyConfig {
137 version: 255,
138 ..MyConfig::default()
139 };
140 c.save(&config)?;
141 let new_config = MyConfig {
142 version: 254,
143 ..MyConfig::default()
144 };
145 c.save(&new_config)?;
146 assert_eq!(c.load()?, new_config);
147
148 Ok(())
149 })
150 }
151 }
152}
diff --git a/src/key_handling/mod.rs b/src/key_handling/mod.rs
new file mode 100644
index 0000000..913bd46
--- /dev/null
+++ b/src/key_handling/mod.rs
@@ -0,0 +1 @@
pub mod users;
diff --git a/src/key_handling/users.rs b/src/key_handling/users.rs
new file mode 100644
index 0000000..bd1748a
--- /dev/null
+++ b/src/key_handling/users.rs
@@ -0,0 +1,124 @@
1use anyhow::{Context, Result};
2
3use crate::{
4 cli_interactor::{Interactor, InteractorPrompt, PromptInputParms},
5 config::{ConfigManagement, ConfigManager, MyConfig, UserRef},
6};
7
8#[derive(Default)]
9pub struct UserManager {
10 config_manager: ConfigManager,
11 interactor: Interactor,
12}
13
14pub trait UserManagement {
15 fn add(&self, nsec: &Option<String>) -> Result<()>;
16}
17
18#[cfg(test)]
19use duplicate::duplicate_item;
20#[cfg_attr(test, duplicate_item(UserManager; [UserManager]; [self::tests::MockUserManager]))]
21impl UserManagement for UserManager {
22 fn add(&self, nsec: &Option<String>) -> Result<()> {
23 let nsec = match nsec.clone() {
24 Some(nsec) => nsec,
25 None => self
26 .interactor
27 .input(
28 PromptInputParms::default().with_prompt("login with nsec (or hex private key)"),
29 )
30 .context("failed to get nsec input from interactor.input")?,
31 };
32
33 self.config_manager
34 .save(&MyConfig {
35 users: vec![UserRef {
36 nsec: nsec.to_string(),
37 }],
38 ..MyConfig::default()
39 })
40 .context("failed to save application configuration with new user details in")?;
41
42 println!("logged in as {nsec}");
43
44 Ok(())
45 }
46}
47
48#[cfg(test)]
49mod tests {
50 use test_utils::*;
51
52 use super::*;
53 use crate::{cli_interactor::MockInteractorPrompt, config::MockConfigManagement};
54
55 #[derive(Default)]
56 pub struct MockUserManager {
57 pub config_manager: MockConfigManagement,
58 pub interactor: MockInteractorPrompt,
59 }
60
61 mod add {
62 use super::*;
63
64 impl MockUserManager {
65 fn add_return_expected_responses(mut self) -> Self {
66 self.config_manager
67 .expect_load()
68 .returning(|| Ok(MyConfig::default()));
69 self.config_manager.expect_save().returning(|_| Ok(()));
70 self.interactor
71 .expect_input()
72 .returning(|_| Ok(TEST_KEY_1_NSEC.into()));
73 self
74 }
75 }
76
77 mod when_nsec_is_passed {
78 use super::*;
79
80 #[test]
81 fn user_isnt_prompted() {
82 let mut m = MockUserManager::default().add_return_expected_responses();
83 m.interactor = MockInteractorPrompt::default();
84 m.interactor.expect_input().never();
85
86 let _ = m.add(&Some(TEST_KEY_1_NSEC.into()));
87 }
88 }
89
90 mod when_no_nsec_is_passed {
91 use super::*;
92
93 #[test]
94 fn prompt_for_nsec() {
95 let mut m = MockUserManager::default().add_return_expected_responses();
96
97 m.interactor = MockInteractorPrompt::new();
98 m.interactor
99 .expect_input()
100 .once()
101 .withf(|p| p.prompt.eq("login with nsec (or hex private key)"))
102 .returning(|_| Ok(TEST_KEY_1_NSEC.into()));
103
104 let _ = m.add(&None);
105 }
106
107 #[test]
108 fn stored_in_config() {
109 let mut m = MockUserManager::default().add_return_expected_responses();
110
111 m.config_manager = MockConfigManagement::new();
112 m.config_manager
113 .expect_load()
114 .returning(|| Ok(MyConfig::default()));
115 m.config_manager
116 .expect_save()
117 .withf(|cfg| cfg.users.len().eq(&1) && cfg.users[0].nsec.eq(TEST_KEY_1_NSEC))
118 .returning(|_| Ok(()));
119
120 let _ = m.add(&None);
121 }
122 }
123 }
124}
diff --git a/src/login.rs b/src/login.rs
new file mode 100644
index 0000000..da19a75
--- /dev/null
+++ b/src/login.rs
@@ -0,0 +1,16 @@
1use anyhow::{Context, Result};
2
3use crate::{
4 config::{ConfigManagement, ConfigManager},
5 key_handling::users::{UserManagement, UserManager},
6};
7
8pub fn launch(nsec: &Option<String>) -> Result<()> {
9 let cfg = ConfigManager
10 .load()
11 .context("failed to load application config")?;
12 if !cfg.users.is_empty() {
13 println!("logged in as {}", cfg.users[0].nsec);
14 }
15 UserManager::default().add(nsec)
16}
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..d16f1a3
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,35 @@
1#![cfg_attr(not(test), warn(clippy::pedantic))]
2#![cfg_attr(not(test), warn(clippy::expect_used))]
3
4use anyhow::Result;
5use clap::{Parser, Subcommand};
6
7mod cli_interactor;
8mod config;
9mod key_handling;
10mod login;
11mod sub_commands;
12
13#[derive(Parser)]
14#[command(author, version, about, long_about = None)]
15#[command(propagate_version = true)]
16pub struct Cli {
17 #[command(subcommand)]
18 command: Commands,
19 /// nsec or hex private key
20 #[arg(short, long)]
21 nsec: Option<String>,
22}
23
24#[derive(Subcommand)]
25enum Commands {
26 /// save encrypted nsec for future use
27 Login(sub_commands::login::SubCommandArgs),
28}
29
30fn main() -> Result<()> {
31 let cli = Cli::parse();
32 match &cli.command {
33 Commands::Login(args) => sub_commands::login::launch(&cli, args),
34 }
35}
diff --git a/src/sub_commands/login.rs b/src/sub_commands/login.rs
new file mode 100644
index 0000000..d61f578
--- /dev/null
+++ b/src/sub_commands/login.rs
@@ -0,0 +1,11 @@
1use anyhow::Result;
2use clap;
3
4use crate::{login, Cli};
5
6#[derive(clap::Args)]
7pub struct SubCommandArgs;
8
9pub fn launch(args: &Cli, _command_args: &SubCommandArgs) -> Result<()> {
10 login::launch(&args.nsec)
11}
diff --git a/src/sub_commands/mod.rs b/src/sub_commands/mod.rs
new file mode 100644
index 0000000..320cbbb
--- /dev/null
+++ b/src/sub_commands/mod.rs
@@ -0,0 +1 @@
pub mod login;
diff --git a/test_utils/Cargo.toml b/test_utils/Cargo.toml
new file mode 100644
index 0000000..e1f6090
--- /dev/null
+++ b/test_utils/Cargo.toml
@@ -0,0 +1,12 @@
1[package]
2name = "test_utils"
3version = "0.1.0"
4edition = "2021"
5
6[dependencies]
7anyhow = "1.0.75"
8assert_cmd = "2.0.12"
9dialoguer = "0.10.4"
10directories = "5.0.1"
11rexpect = { git = "https://github.com/phaer/rexpect.git", branch= "skip-ansi-escape-codes" }
12strip-ansi-escapes = "0.2.0"
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
new file mode 100644
index 0000000..495e8d2
--- /dev/null
+++ b/test_utils/src/lib.rs
@@ -0,0 +1,280 @@
1use std::ffi::OsStr;
2
3use anyhow::{ensure, Context, Result};
4use dialoguer::theme::{ColorfulTheme, Theme};
5use directories::ProjectDirs;
6use rexpect::session::{Options, PtySession};
7use strip_ansi_escapes::strip_str;
8
9pub static TEST_KEY_1_NSEC: &str =
10 "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq";
11
12pub static TEST_KEY_2_NSEC: &str =
13 "nsec1ypglg6nj6ep0g2qmyfqcv2al502gje3jvpwye6mthmkvj93tqkesknv6qm";
14
15/// wrapper for a cli testing tool - currently wraps rexpect and dialoguer
16///
17/// 1. allow more accurate articulation of expected behaviour
18/// 2. provide flexibility to swap rexpect for a tool that better maps to
19/// expected behaviour
20/// 3. provides flexability to swap dialoguer with another cli interaction tool
21pub struct CliTester {
22 rexpect_session: PtySession,
23 formatter: ColorfulTheme,
24}
25
26impl CliTester {
27 pub fn expect_input(&mut self, prompt: &str) -> Result<CliTesterInputPrompt> {
28 let mut i = CliTesterInputPrompt {
29 tester: self,
30 prompt: prompt.to_string(),
31 };
32 i.prompt(false).context("initial input prompt")?;
33 Ok(i)
34 }
35
36 pub fn expect_input_eventually(&mut self, prompt: &str) -> Result<CliTesterInputPrompt> {
37 let mut i = CliTesterInputPrompt {
38 tester: self,
39 prompt: prompt.to_string(),
40 };
41 i.prompt(true).context("initial input prompt")?;
42 Ok(i)
43 }
44}
45
46pub struct CliTesterInputPrompt<'a> {
47 tester: &'a mut CliTester,
48 prompt: String,
49}
50
51impl CliTesterInputPrompt<'_> {
52 fn prompt(&mut self, eventually: bool) -> Result<&mut Self> {
53 let mut s = String::new();
54 self.tester
55 .formatter
56 .format_prompt(&mut s, self.prompt.as_str())
57 .expect("diagluer theme formatter should succeed");
58 s.push(' ');
59
60 ensure!(
61 s.contains(self.prompt.as_str()),
62 "dialoguer must be broken as formatted prompt success doesnt contain prompt"
63 );
64
65 if eventually {
66 self.tester
67 .expect_eventually(sanatize(s).as_str())
68 .context("expect input prompt eventually")?;
69 } else {
70 self.tester
71 .expect(sanatize(s).as_str())
72 .context("expect input prompt")?;
73 }
74
75 Ok(self)
76 }
77
78 pub fn succeeds_with(&mut self, input: &str) -> Result<&mut Self> {
79 self.tester.send_line(input)?;
80 self.tester
81 .expect(input)
82 .context("expect input to be printed")?;
83 self.tester
84 .expect("\r")
85 .context("expect new line after input to be printed")?;
86
87 let mut s = String::new();
88 self.tester
89 .formatter
90 .format_input_prompt_selection(&mut s, self.prompt.as_str(), input)
91 .expect("diagluer theme formatter should succeed");
92 if !s.contains(self.prompt.as_str()) {
93 panic!("dialoguer must be broken as formatted prompt success doesnt contain prompt");
94 }
95 let formatted_success = format!("{}\r\n", sanatize(s));
96
97 self.tester
98 .expect(formatted_success.as_str())
99 .context("expect immediate prompt success")?;
100 Ok(self)
101 }
102}
103
104impl CliTester {
105 pub fn new<I, S>(args: I) -> Self
106 where
107 I: IntoIterator<Item = S>,
108 S: AsRef<OsStr>,
109 {
110 Self {
111 rexpect_session: rexpect_with(args).expect("rexpect to spawn new process"),
112 formatter: ColorfulTheme::default(),
113 }
114 }
115
116 pub fn restart_with<I, S>(&mut self, args: I) -> &mut Self
117 where
118 I: IntoIterator<Item = S>,
119 S: AsRef<OsStr>,
120 {
121 self.rexpect_session
122 .process
123 .exit()
124 .expect("process to exit");
125 self.rexpect_session = rexpect_with(args).expect("rexpect to spawn new process");
126 self
127 }
128
129 pub fn exit(&mut self) -> Result<()> {
130 match self
131 .rexpect_session
132 .process
133 .exit()
134 .context("expect proccess to exit")
135 {
136 Ok(_) => Ok(()),
137 Err(e) => Err(e),
138 }
139 }
140
141 /// returns what came before expected message
142 pub fn expect_eventually(&mut self, message: &str) -> Result<String> {
143 let before = self
144 .rexpect_session
145 .exp_string(message)
146 .context("exp_string failed")?;
147 Ok(before)
148 }
149
150 pub fn expect(&mut self, message: &str) -> Result<&mut Self> {
151 let before = self.expect_eventually(message)?;
152 ensure!(
153 before.is_empty(),
154 format!(
155 "expected message \"{}\". but got \"{}\" first.",
156 message.replace('\n', "\\n").replace('\r', "\\r"),
157 before.replace('\n', "\\n").replace('\r', "\\r"),
158 ),
159 );
160 Ok(self)
161 }
162
163 pub fn expect_end(&mut self) -> Result<()> {
164 let before = self
165 .rexpect_session
166 .exp_eof()
167 .context("expected immediate end but got timed out")?;
168 ensure!(
169 before.is_empty(),
170 format!(
171 "expected immediate end but got '{}' first.",
172 before.replace('\n', "\\n").replace('\r', "\\r"),
173 ),
174 );
175 Ok(())
176 }
177
178 pub fn expect_end_with(&mut self, message: &str) -> Result<()> {
179 let before = self
180 .rexpect_session
181 .exp_eof()
182 .context("expected immediate end but got timed out")?;
183 assert_eq!(before, message);
184 Ok(())
185 }
186 pub fn expect_end_eventually(&mut self) -> Result<String> {
187 self.rexpect_session
188 .exp_eof()
189 .context("expected end eventually but got timed out")
190 }
191
192 pub fn expect_end_eventually_with(&mut self, message: &str) -> Result<()> {
193 self.expect_eventually(message)?;
194 self.expect_end()
195 }
196
197 fn send_line(&mut self, line: &str) -> Result<()> {
198 self.rexpect_session
199 .send_line(line)
200 .context("send_line failed")?;
201 Ok(())
202 }
203}
204
205/// sanatize unicode string for rexpect
206fn sanatize(s: String) -> String {
207 // remove ansi codes as they don't work with rexpect
208 strip_str(s)
209 // sanatize unicode rexpect issue 105 is resolved https://github.com/rust-cli/rexpect/issues/105
210 .as_bytes()
211 .iter()
212 .map(|c| *c as char)
213 .collect::<String>()
214}
215
216pub fn rexpect_with<I, S>(args: I) -> Result<PtySession, rexpect::error::Error>
217where
218 I: IntoIterator<Item = S>,
219 S: AsRef<std::ffi::OsStr>,
220{
221 let mut cmd = std::process::Command::new(assert_cmd::cargo::cargo_bin("ngit"));
222 cmd.args(args);
223 // using branch for PR https://github.com/rust-cli/rexpect/pull/103 to strip ansi escape codes
224 rexpect::session::spawn_with_options(
225 cmd,
226 Options {
227 timeout_ms: Some(2000),
228 strip_ansi_escape_codes: true,
229 },
230 )
231}
232
233/// backup and remove application config and data
234pub fn before() -> Result<()> {
235 backup_existing_config()
236}
237
238/// restore backuped application config and data
239pub fn after() -> Result<()> {
240 restore_config_backup()
241}
242
243/// run func between before and after scripts which backup, reset and restore
244/// application config
245///
246/// TODO: fix issue: if func panics, after() is not run.
247pub fn with_fresh_config<F>(func: F) -> Result<()>
248where
249 F: Fn() -> Result<()>,
250{
251 before()?;
252 func()?;
253 after()
254}
255
256fn backup_existing_config() -> Result<()> {
257 let config_path = get_dirs().config_dir().join("config.json");
258 let backup_config_path = get_dirs().config_dir().join("config-backup.json");
259 if config_path.exists() {
260 std::fs::rename(config_path, backup_config_path)?;
261 }
262 Ok(())
263}
264
265fn restore_config_backup() -> Result<()> {
266 let config_path = get_dirs().config_dir().join("config.json");
267 let backup_config_path = get_dirs().config_dir().join("config-backup.json");
268 if config_path.exists() {
269 std::fs::remove_file(&config_path)?;
270 }
271 if backup_config_path.exists() {
272 std::fs::rename(backup_config_path, config_path)?;
273 }
274 Ok(())
275}
276
277fn get_dirs() -> ProjectDirs {
278 ProjectDirs::from("", "CodeCollaboration", "ngit")
279 .expect("rust directories crate should return ProjectDirs")
280}
diff --git a/tests/login.rs b/tests/login.rs
new file mode 100644
index 0000000..a7e1889
--- /dev/null
+++ b/tests/login.rs
@@ -0,0 +1,145 @@
1use anyhow::Result;
2use serial_test::serial;
3use test_utils::*;
4
5static EXPECTED_NSEC_PROMPT: &str = "login with nsec (or hex private key)";
6
7fn standard_login() -> Result<CliTester> {
8 let mut p = CliTester::new(["login"]);
9
10 p.expect_input_eventually(EXPECTED_NSEC_PROMPT)?
11 .succeeds_with(TEST_KEY_1_NSEC)?;
12
13 p.expect_end_eventually()?;
14 Ok(p)
15}
16
17mod when_first_time_login {
18 use super::*;
19
20 #[test]
21 #[serial]
22 fn prompts_for_nsec() -> Result<()> {
23 with_fresh_config(|| {
24 standard_login()?;
25 Ok(())
26 })
27 }
28
29 #[test]
30 #[serial]
31 fn succeeds_with_text_logged_in_as_npub() -> Result<()> {
32 with_fresh_config(|| {
33 let mut p = CliTester::new(["login"]);
34
35 p.expect_input(EXPECTED_NSEC_PROMPT)?
36 .succeeds_with(TEST_KEY_1_NSEC)?;
37
38 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())
39 })
40 }
41
42 #[test]
43 #[serial]
44 fn next_time_returns_logged_in_as_npub() -> Result<()> {
45 with_fresh_config(|| {
46 standard_login()?.exit()?;
47
48 CliTester::new(["login"])
49 .expect(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())?
50 .exit()
51 })
52 }
53}
54
55mod when_called_with_nsec_parameter {
56 use super::*;
57
58 #[test]
59 #[serial]
60 fn valid_nsec_param_succeeds_without_prompts() -> Result<()> {
61 with_fresh_config(|| {
62 CliTester::new(["--nsec", TEST_KEY_2_NSEC, "login"])
63 .expect_end_with(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?;
64
65 CliTester::new(["login"])
66 .expect(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?
67 .exit()
68 })
69 }
70
71 mod when_logging_in_as_different_nsec {
72 use super::*;
73
74 #[test]
75 #[serial]
76 fn valid_nsec_param_succeeds_without_prompts_and_logs_in() -> Result<()> {
77 with_fresh_config(|| {
78 standard_login()?.exit()?;
79
80 CliTester::new(["--nsec", TEST_KEY_2_NSEC, "login"])
81 .expect(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())?
82 .expect_end_with(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?;
83
84 CliTester::new(["login"])
85 .expect(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?
86 .exit()
87 })
88 }
89 }
90}
91
92mod when_logged_in {
93 use super::*;
94
95 #[test]
96 #[serial]
97 fn returns_logged_in_as_npub() -> Result<()> {
98 with_fresh_config(|| {
99 standard_login()?.exit()?;
100
101 CliTester::new(["login"])
102 .expect(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())?
103 .exit()
104 })
105 }
106
107 #[test]
108 #[serial]
109 fn prompts_to_log_in_with_different_nsec() -> Result<()> {
110 with_fresh_config(|| {
111 standard_login()?.exit()?;
112
113 let mut p = CliTester::new(["login"]);
114 p.expect(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())?;
115
116 p.expect_input(EXPECTED_NSEC_PROMPT)?
117 .succeeds_with(TEST_KEY_2_NSEC)?;
118
119 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())
120 })
121 }
122 mod when_logging_in_as_different_nsec {
123 use super::*;
124
125 #[test]
126 #[serial]
127 fn confirmed_as_logged_in_as_additional_user() -> Result<()> {
128 with_fresh_config(|| {
129 standard_login()?.exit()?;
130
131 let mut p = CliTester::new(["login"]);
132 p.expect(format!("logged in as {}\r\n", TEST_KEY_1_NSEC).as_str())?;
133
134 p.expect_input(EXPECTED_NSEC_PROMPT)?
135 .succeeds_with(TEST_KEY_2_NSEC)?;
136
137 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?;
138
139 CliTester::new(["login"])
140 .expect(format!("logged in as {}\r\n", TEST_KEY_2_NSEC).as_str())?
141 .exit()
142 })
143 }
144 }
145}