From d6c3b0a155d07fcd3ac0ca132d34ee9dcac78502 Mon Sep 17 00:00:00 2001 From: Chip Senkbeil Date: Sat, 21 Oct 2023 22:07:05 -0500 Subject: [PATCH] Beginning of big refactoring of crates, introduction of plugin crate, etc. --- Cargo.lock | 99 ++++++++++--------- Cargo.toml | 25 ++--- .../Cargo.toml | 6 +- {distant-auth => distant-core-auth}/README.md | 0 .../src/authenticator.rs | 0 .../src/handler.rs | 0 .../src/handler/methods.rs | 0 .../src/handler/methods/prompt.rs | 0 .../src/handler/methods/static_key.rs | 0 .../src/lib.rs | 0 .../src/methods.rs | 0 .../src/methods/none.rs | 0 .../src/methods/static_key.rs | 0 .../src/msg.rs | 0 {distant-net => distant-core-net}/Cargo.toml | 10 +- {distant-net => distant-core-net}/README.md | 0 .../src/authentication.rs | 6 +- .../src/client.rs | 0 .../src/client/builder.rs | 2 +- .../src/client/builder/tcp.rs | 0 .../src/client/builder/unix.rs | 0 .../src/client/builder/windows.rs | 0 .../src/client/channel.rs | 0 .../src/client/channel/mailbox.rs | 0 .../src/client/config.rs | 0 .../src/client/reconnect.rs | 0 .../src/client/shutdown.rs | 0 .../src/common.rs | 0 .../src/common/any.rs | 0 .../src/common/connection.rs | 6 +- .../src/common/destination.rs | 0 .../src/common/destination/host.rs | 2 +- .../src/common/destination/parser.rs | 0 .../src/common/key.rs | 0 .../src/common/keychain.rs | 0 .../src/common/listener.rs | 0 .../src/common/listener/mapped.rs | 0 .../src/common/listener/mpsc.rs | 0 .../src/common/listener/oneshot.rs | 0 .../src/common/listener/tcp.rs | 0 .../src/common/listener/unix.rs | 0 .../src/common/listener/windows.rs | 0 .../src/common/map.rs | 6 +- .../src/common/packet.rs | 0 .../src/common/packet/header.rs | 2 +- .../src/common/packet/request.rs | 0 .../src/common/packet/response.rs | 0 .../src/common/packet/value.rs | 0 .../src/common/port.rs | 0 .../src/common/transport.rs | 0 .../src/common/transport/framed.rs | 0 .../src/common/transport/framed/backup.rs | 0 .../src/common/transport/framed/codec.rs | 0 .../common/transport/framed/codec/chain.rs | 0 .../transport/framed/codec/compression.rs | 0 .../transport/framed/codec/encryption.rs | 0 .../common/transport/framed/codec/plain.rs | 0 .../transport/framed/codec/predicate.rs | 0 .../src/common/transport/framed/exchange.rs | 0 .../common/transport/framed/exchange/pkb.rs | 0 .../common/transport/framed/exchange/salt.rs | 0 .../src/common/transport/framed/frame.rs | 0 .../src/common/transport/framed/handshake.rs | 0 .../src/common/transport/inmemory.rs | 0 .../src/common/transport/tcp.rs | 0 .../src/common/transport/test.rs | 0 .../src/common/transport/unix.rs | 0 .../src/common/transport/windows.rs | 0 .../src/common/transport/windows/pipe.rs | 0 .../src/common/utils.rs | 0 .../src/common/version.rs | 2 +- {distant-net => distant-core-net}/src/lib.rs | 2 +- .../src/manager.rs | 0 .../src/manager/client.rs | 6 +- .../src/manager/client/channel.rs | 0 .../src/manager/data.rs | 0 .../src/manager/data/info.rs | 0 .../src/manager/data/list.rs | 0 .../src/manager/data/request.rs | 2 +- .../src/manager/data/response.rs | 2 +- .../src/manager/server.rs | 2 +- .../src/manager/server/authentication.rs | 4 +- .../src/manager/server/config.rs | 0 .../src/manager/server/connection.rs | 0 .../src/manager/server/handler.rs | 6 +- .../src/server.rs | 4 +- .../src/server/builder.rs | 0 .../src/server/builder/tcp.rs | 4 +- .../src/server/builder/unix.rs | 4 +- .../src/server/builder/windows.rs | 4 +- .../src/server/config.rs | 0 .../src/server/connection.rs | 4 +- .../src/server/context.rs | 0 .../src/server/ref.rs | 0 .../src/server/ref/tcp.rs | 0 .../src/server/ref/unix.rs | 0 .../src/server/ref/windows.rs | 0 .../src/server/reply.rs | 0 .../src/server/shutdown_timer.rs | 0 .../src/server/state.rs | 0 .../tests/manager_tests.rs | 12 +-- .../tests/typed_tests.rs | 8 +- .../tests/untyped_tests.rs | 8 +- distant-core-plugin/Cargo.toml | 12 +++ distant-core-plugin/README.md | 35 +++++++ distant-core-plugin/src/lib.rs | 5 + .../Cargo.toml | 6 +- .../README.md | 0 .../src/common.rs | 0 .../src/common/change.rs | 0 .../src/common/cmd.rs | 0 .../src/common/error.rs | 0 .../src/common/filesystem.rs | 0 .../src/common/metadata.rs | 0 .../src/common/permissions.rs | 16 +-- .../src/common/pty.rs | 0 .../src/common/search.rs | 0 .../src/common/system.rs | 0 .../src/common/version.rs | 0 .../src/lib.rs | 4 +- .../src/msg.rs | 0 .../src/request.rs | 0 .../src/response.rs | 0 .../src/utils.rs | 0 distant-core/Cargo.toml | 7 +- distant-core/src/api.rs | 4 +- distant-core/src/api/reply.rs | 2 +- distant-core/src/client.rs | 4 +- distant-core/src/client/ext.rs | 4 +- distant-core/src/client/lsp.rs | 4 +- distant-core/src/client/process.rs | 8 +- distant-core/src/client/searcher.rs | 6 +- distant-core/src/client/watcher.rs | 6 +- distant-core/src/credentials.rs | 2 +- distant-core/tests/api_tests.rs | 40 ++++---- .../Cargo.toml | 8 +- .../README.md | 0 .../src/api.rs | 0 .../src/api/process.rs | 0 .../src/api/process/pty.rs | 0 .../src/api/process/simple.rs | 0 .../src/api/process/simple/tasks.rs | 0 .../src/api/process/wait.rs | 0 .../src/api/state.rs | 0 .../src/api/state/process.rs | 0 .../src/api/state/process/instance.rs | 0 .../src/api/state/search.rs | 0 .../src/api/state/watcher.rs | 0 .../src/api/state/watcher/path.rs | 0 .../src/config.rs | 0 .../src/constants.rs | 0 .../src/lib.rs | 0 .../tests/stress/distant/large_file.rs | 0 .../tests/stress/distant/mod.rs | 0 .../tests/stress/distant/watch.rs | 0 .../tests/stress/fixtures.rs | 2 +- .../tests/stress/mod.rs | 0 .../tests/stress_tests.rs | 0 .../Cargo.toml | 10 +- .../README.md | 0 .../src/api.rs | 0 .../src/lib.rs | 0 .../src/process.rs | 0 .../src/utils.rs | 0 .../tests/lib.rs | 0 .../tests/ssh2/client.rs | 0 .../tests/ssh2/mod.rs | 0 .../tests/ssh2/ssh.rs | 2 +- .../tests/sshd/mod.rs | 2 +- .../tests/utils/mod.rs | 0 src/cli/commands/manager/handlers.rs | 10 +- src/cli/commands/server.rs | 4 +- 172 files changed, 250 insertions(+), 191 deletions(-) rename {distant-auth => distant-core-auth}/Cargo.toml (83%) rename {distant-auth => distant-core-auth}/README.md (100%) rename {distant-auth => distant-core-auth}/src/authenticator.rs (100%) rename {distant-auth => distant-core-auth}/src/handler.rs (100%) rename {distant-auth => distant-core-auth}/src/handler/methods.rs (100%) rename {distant-auth => distant-core-auth}/src/handler/methods/prompt.rs (100%) rename {distant-auth => distant-core-auth}/src/handler/methods/static_key.rs (100%) rename {distant-auth => distant-core-auth}/src/lib.rs (100%) rename {distant-auth => distant-core-auth}/src/methods.rs (100%) rename {distant-auth => distant-core-auth}/src/methods/none.rs (100%) rename {distant-auth => distant-core-auth}/src/methods/static_key.rs (100%) rename {distant-auth => distant-core-auth}/src/msg.rs (100%) rename {distant-net => distant-core-net}/Cargo.toml (78%) rename {distant-net => distant-core-net}/README.md (100%) rename {distant-net => distant-core-net}/src/authentication.rs (99%) rename {distant-net => distant-core-net}/src/client.rs (100%) rename {distant-net => distant-core-net}/src/client/builder.rs (99%) rename {distant-net => distant-core-net}/src/client/builder/tcp.rs (100%) rename {distant-net => distant-core-net}/src/client/builder/unix.rs (100%) rename {distant-net => distant-core-net}/src/client/builder/windows.rs (100%) rename {distant-net => distant-core-net}/src/client/channel.rs (100%) rename {distant-net => distant-core-net}/src/client/channel/mailbox.rs (100%) rename {distant-net => distant-core-net}/src/client/config.rs (100%) rename {distant-net => distant-core-net}/src/client/reconnect.rs (100%) rename {distant-net => distant-core-net}/src/client/shutdown.rs (100%) rename {distant-net => distant-core-net}/src/common.rs (100%) rename {distant-net => distant-core-net}/src/common/any.rs (100%) rename {distant-net => distant-core-net}/src/common/connection.rs (99%) rename {distant-net => distant-core-net}/src/common/destination.rs (100%) rename {distant-net => distant-core-net}/src/common/destination/host.rs (99%) rename {distant-net => distant-core-net}/src/common/destination/parser.rs (100%) rename {distant-net => distant-core-net}/src/common/key.rs (100%) rename {distant-net => distant-core-net}/src/common/keychain.rs (100%) rename {distant-net => distant-core-net}/src/common/listener.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/mapped.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/mpsc.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/oneshot.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/tcp.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/unix.rs (100%) rename {distant-net => distant-core-net}/src/common/listener/windows.rs (100%) rename {distant-net => distant-core-net}/src/common/map.rs (99%) rename {distant-net => distant-core-net}/src/common/packet.rs (100%) rename {distant-net => distant-core-net}/src/common/packet/header.rs (98%) rename {distant-net => distant-core-net}/src/common/packet/request.rs (100%) rename {distant-net => distant-core-net}/src/common/packet/response.rs (100%) rename {distant-net => distant-core-net}/src/common/packet/value.rs (100%) rename {distant-net => distant-core-net}/src/common/port.rs (100%) rename {distant-net => distant-core-net}/src/common/transport.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/backup.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec/chain.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec/compression.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec/encryption.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec/plain.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/codec/predicate.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/exchange.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/exchange/pkb.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/exchange/salt.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/frame.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/framed/handshake.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/inmemory.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/tcp.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/test.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/unix.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/windows.rs (100%) rename {distant-net => distant-core-net}/src/common/transport/windows/pipe.rs (100%) rename {distant-net => distant-core-net}/src/common/utils.rs (100%) rename {distant-net => distant-core-net}/src/common/version.rs (98%) rename {distant-net => distant-core-net}/src/lib.rs (91%) rename {distant-net => distant-core-net}/src/manager.rs (100%) rename {distant-net => distant-core-net}/src/manager/client.rs (99%) rename {distant-net => distant-core-net}/src/manager/client/channel.rs (100%) rename {distant-net => distant-core-net}/src/manager/data.rs (100%) rename {distant-net => distant-core-net}/src/manager/data/info.rs (100%) rename {distant-net => distant-core-net}/src/manager/data/list.rs (100%) rename {distant-net => distant-core-net}/src/manager/data/request.rs (97%) rename {distant-net => distant-core-net}/src/manager/data/response.rs (97%) rename {distant-net => distant-core-net}/src/manager/server.rs (99%) rename {distant-net => distant-core-net}/src/manager/server/authentication.rs (98%) rename {distant-net => distant-core-net}/src/manager/server/config.rs (100%) rename {distant-net => distant-core-net}/src/manager/server/connection.rs (100%) rename {distant-net => distant-core-net}/src/manager/server/handler.rs (98%) rename {distant-net => distant-core-net}/src/server.rs (99%) rename {distant-net => distant-core-net}/src/server/builder.rs (100%) rename {distant-net => distant-core-net}/src/server/builder/tcp.rs (97%) rename {distant-net => distant-core-net}/src/server/builder/unix.rs (97%) rename {distant-net => distant-core-net}/src/server/builder/windows.rs (97%) rename {distant-net => distant-core-net}/src/server/config.rs (100%) rename {distant-net => distant-core-net}/src/server/connection.rs (99%) rename {distant-net => distant-core-net}/src/server/context.rs (100%) rename {distant-net => distant-core-net}/src/server/ref.rs (100%) rename {distant-net => distant-core-net}/src/server/ref/tcp.rs (100%) rename {distant-net => distant-core-net}/src/server/ref/unix.rs (100%) rename {distant-net => distant-core-net}/src/server/ref/windows.rs (100%) rename {distant-net => distant-core-net}/src/server/reply.rs (100%) rename {distant-net => distant-core-net}/src/server/shutdown_timer.rs (100%) rename {distant-net => distant-core-net}/src/server/state.rs (100%) rename {distant-net => distant-core-net}/tests/manager_tests.rs (91%) rename {distant-net => distant-core-net}/tests/typed_tests.rs (89%) rename {distant-net => distant-core-net}/tests/untyped_tests.rs (91%) create mode 100644 distant-core-plugin/Cargo.toml create mode 100644 distant-core-plugin/README.md create mode 100644 distant-core-plugin/src/lib.rs rename {distant-protocol => distant-core-protocol}/Cargo.toml (83%) rename {distant-protocol => distant-core-protocol}/README.md (100%) rename {distant-protocol => distant-core-protocol}/src/common.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/change.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/cmd.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/error.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/filesystem.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/metadata.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/permissions.rs (98%) rename {distant-protocol => distant-core-protocol}/src/common/pty.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/search.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/system.rs (100%) rename {distant-protocol => distant-core-protocol}/src/common/version.rs (100%) rename {distant-protocol => distant-core-protocol}/src/lib.rs (96%) rename {distant-protocol => distant-core-protocol}/src/msg.rs (100%) rename {distant-protocol => distant-core-protocol}/src/request.rs (100%) rename {distant-protocol => distant-core-protocol}/src/response.rs (100%) rename {distant-protocol => distant-core-protocol}/src/utils.rs (100%) rename {distant-local => distant-plugin-local}/Cargo.toml (85%) rename {distant-local => distant-plugin-local}/README.md (100%) rename {distant-local => distant-plugin-local}/src/api.rs (100%) rename {distant-local => distant-plugin-local}/src/api/process.rs (100%) rename {distant-local => distant-plugin-local}/src/api/process/pty.rs (100%) rename {distant-local => distant-plugin-local}/src/api/process/simple.rs (100%) rename {distant-local => distant-plugin-local}/src/api/process/simple/tasks.rs (100%) rename {distant-local => distant-plugin-local}/src/api/process/wait.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state/process.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state/process/instance.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state/search.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state/watcher.rs (100%) rename {distant-local => distant-plugin-local}/src/api/state/watcher/path.rs (100%) rename {distant-local => distant-plugin-local}/src/config.rs (100%) rename {distant-local => distant-plugin-local}/src/constants.rs (100%) rename {distant-local => distant-plugin-local}/src/lib.rs (100%) rename {distant-local => distant-plugin-local}/tests/stress/distant/large_file.rs (100%) rename {distant-local => distant-plugin-local}/tests/stress/distant/mod.rs (100%) rename {distant-local => distant-plugin-local}/tests/stress/distant/watch.rs (100%) rename {distant-local => distant-plugin-local}/tests/stress/fixtures.rs (98%) rename {distant-local => distant-plugin-local}/tests/stress/mod.rs (100%) rename {distant-local => distant-plugin-local}/tests/stress_tests.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/Cargo.toml (84%) rename {distant-ssh2 => distant-plugin-ssh}/README.md (100%) rename {distant-ssh2 => distant-plugin-ssh}/src/api.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/src/lib.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/src/process.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/src/utils.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/tests/lib.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/tests/ssh2/client.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/tests/ssh2/mod.rs (100%) rename {distant-ssh2 => distant-plugin-ssh}/tests/ssh2/ssh.rs (93%) rename {distant-ssh2 => distant-plugin-ssh}/tests/sshd/mod.rs (99%) rename {distant-ssh2 => distant-plugin-ssh}/tests/utils/mod.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 772afdc..03aec70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,7 +773,7 @@ dependencies = [ [[package]] name = "distant" -version = "0.20.0" +version = "0.21.0" dependencies = [ "anyhow", "assert_cmd", @@ -786,8 +786,8 @@ dependencies = [ "dialoguer", "directories", "distant-core", - "distant-local", - "distant-ssh2", + "distant-plugin-local", + "distant-plugin-ssh", "env_logger", "file-mode", "flexi_logger", @@ -817,29 +817,17 @@ dependencies = [ "winsplit", ] -[[package]] -name = "distant-auth" -version = "0.20.0" -dependencies = [ - "async-trait", - "derive_more", - "env_logger", - "log", - "serde", - "test-log", - "tokio", -] - [[package]] name = "distant-core" -version = "0.20.0" +version = "0.21.0" dependencies = [ "async-trait", "bitflags 2.4.0", "bytes", "derive_more", - "distant-net", - "distant-protocol", + "distant-core-net", + "distant-core-plugin", + "distant-core-protocol", "env_logger", "futures", "hex", @@ -857,43 +845,28 @@ dependencies = [ ] [[package]] -name = "distant-local" -version = "0.20.0" +name = "distant-core-auth" +version = "0.21.0" dependencies = [ - "assert_fs", "async-trait", - "distant-core", + "derive_more", "env_logger", - "grep", - "ignore", - "indoc", "log", - "notify", - "notify-debouncer-full", - "num_cpus", - "once_cell", - "portable-pty", - "predicates", - "rand 0.8.5", - "rstest", - "shell-words", + "serde", "test-log", "tokio", - "walkdir", - "whoami", - "winsplit", ] [[package]] -name = "distant-net" -version = "0.20.0" +name = "distant-core-net" +version = "0.21.0" dependencies = [ "async-trait", "bytes", "chacha20poly1305", "const-str", "derive_more", - "distant-auth", + "distant-core-auth", "dyn-clone", "env_logger", "flate2", @@ -917,8 +890,12 @@ dependencies = [ ] [[package]] -name = "distant-protocol" -version = "0.20.0" +name = "distant-core-plugin" +version = "0.21.0" + +[[package]] +name = "distant-core-protocol" +version = "0.21.0" dependencies = [ "bitflags 2.4.0", "const-str", @@ -934,8 +911,36 @@ dependencies = [ ] [[package]] -name = "distant-ssh2" -version = "0.20.0" +name = "distant-plugin-local" +version = "0.21.0" +dependencies = [ + "assert_fs", + "async-trait", + "distant-core", + "env_logger", + "grep", + "ignore", + "indoc", + "log", + "notify", + "notify-debouncer-full", + "num_cpus", + "once_cell", + "portable-pty", + "predicates", + "rand 0.8.5", + "rstest", + "shell-words", + "test-log", + "tokio", + "walkdir", + "whoami", + "winsplit", +] + +[[package]] +name = "distant-plugin-ssh" +version = "0.21.0" dependencies = [ "anyhow", "assert_fs", @@ -3493,9 +3498,9 @@ dependencies = [ [[package]] name = "typed-path" -version = "0.3.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b26db9a2991a51e1e805820c2cabfc974f625ad6457be8a3eaba4c78361484e" +checksum = "bbb9d13b8242894ff21f9990082b90a6410a43dcc6029ac4227a1467853ba781" [[package]] name = "typenum" diff --git a/Cargo.toml b/Cargo.toml index 2cf3b3e..9eeee87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "distant" description = "Operate on a remote computer through file and process manipulation" categories = ["command-line-utilities"] keywords = ["cli"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" @@ -13,12 +13,13 @@ license = "MIT OR Apache-2.0" [workspace] members = [ - "distant-auth", "distant-core", - "distant-local", - "distant-net", - "distant-protocol", - "distant-ssh2", + "distant-core-auth", + "distant-core-net", + "distant-core-plugin", + "distant-core-protocol", + "distant-plugin-local", + "distant-plugin-ssh", ] [profile.release] @@ -29,8 +30,8 @@ strip = true [features] default = ["vendored-openssl"] -openssl = ["distant-ssh2/openssl"] -vendored-openssl = ["distant-ssh2/vendored-openssl"] +openssl = ["distant-plugin-ssh/openssl"] +vendored-openssl = ["distant-plugin-ssh/vendored-openssl"] [dependencies] anyhow = "1.0.71" @@ -40,8 +41,8 @@ clap_complete = "4.3.0" config = { version = "0.13.3", default-features = false, features = ["toml"] } derive_more = { version = "0.99.17", default-features = false, features = ["display", "from", "error", "is_variant"] } dialoguer = { version = "0.10.4", default-features = false } -distant-core = { version = "=0.20.0", path = "distant-core" } -distant-local = { version = "=0.20.0", path = "distant-local" } +distant-core = { version = "=0.21.0", path = "distant-core" } +distant-plugin-local = { version = "=0.21.0", path = "distant-plugin-local" } directories = "5.0.1" file-mode = "0.1.2" flexi_logger = "0.25.5" @@ -59,13 +60,13 @@ tokio = { version = "1.28.2", features = ["full"] } toml_edit = { version = "0.19.10", features = ["serde"] } terminal_size = "0.2.6" termwiz = "0.20.0" -typed-path = "0.3.2" +typed-path = "0.6.0" which = "4.4.0" winsplit = "0.1.0" whoami = "1.4.0" # Optional native SSH functionality -distant-ssh2 = { version = "=0.20.0", path = "distant-ssh2", optional = true } +distant-plugin-ssh = { version = "=0.21.0", path = "distant-plugin-ssh", optional = true } [target.'cfg(unix)'.dependencies] fork = "0.1.21" diff --git a/distant-auth/Cargo.toml b/distant-core-auth/Cargo.toml similarity index 83% rename from distant-auth/Cargo.toml rename to distant-core-auth/Cargo.toml index 15cefee..de5c4db 100644 --- a/distant-auth/Cargo.toml +++ b/distant-core-auth/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "distant-auth" -description = "Authentication library for distant, providing various implementations" +name = "distant-core-auth" +description = "Core authentication library for distant, providing various implementations" categories = ["authentication"] keywords = ["auth", "authentication", "async"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" diff --git a/distant-auth/README.md b/distant-core-auth/README.md similarity index 100% rename from distant-auth/README.md rename to distant-core-auth/README.md diff --git a/distant-auth/src/authenticator.rs b/distant-core-auth/src/authenticator.rs similarity index 100% rename from distant-auth/src/authenticator.rs rename to distant-core-auth/src/authenticator.rs diff --git a/distant-auth/src/handler.rs b/distant-core-auth/src/handler.rs similarity index 100% rename from distant-auth/src/handler.rs rename to distant-core-auth/src/handler.rs diff --git a/distant-auth/src/handler/methods.rs b/distant-core-auth/src/handler/methods.rs similarity index 100% rename from distant-auth/src/handler/methods.rs rename to distant-core-auth/src/handler/methods.rs diff --git a/distant-auth/src/handler/methods/prompt.rs b/distant-core-auth/src/handler/methods/prompt.rs similarity index 100% rename from distant-auth/src/handler/methods/prompt.rs rename to distant-core-auth/src/handler/methods/prompt.rs diff --git a/distant-auth/src/handler/methods/static_key.rs b/distant-core-auth/src/handler/methods/static_key.rs similarity index 100% rename from distant-auth/src/handler/methods/static_key.rs rename to distant-core-auth/src/handler/methods/static_key.rs diff --git a/distant-auth/src/lib.rs b/distant-core-auth/src/lib.rs similarity index 100% rename from distant-auth/src/lib.rs rename to distant-core-auth/src/lib.rs diff --git a/distant-auth/src/methods.rs b/distant-core-auth/src/methods.rs similarity index 100% rename from distant-auth/src/methods.rs rename to distant-core-auth/src/methods.rs diff --git a/distant-auth/src/methods/none.rs b/distant-core-auth/src/methods/none.rs similarity index 100% rename from distant-auth/src/methods/none.rs rename to distant-core-auth/src/methods/none.rs diff --git a/distant-auth/src/methods/static_key.rs b/distant-core-auth/src/methods/static_key.rs similarity index 100% rename from distant-auth/src/methods/static_key.rs rename to distant-core-auth/src/methods/static_key.rs diff --git a/distant-auth/src/msg.rs b/distant-core-auth/src/msg.rs similarity index 100% rename from distant-auth/src/msg.rs rename to distant-core-auth/src/msg.rs diff --git a/distant-net/Cargo.toml b/distant-core-net/Cargo.toml similarity index 78% rename from distant-net/Cargo.toml rename to distant-core-net/Cargo.toml index cf07c95..388ad83 100644 --- a/distant-net/Cargo.toml +++ b/distant-core-net/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "distant-net" -description = "Network library for distant, providing implementations to support client/server architecture" +name = "distant-core-net" +description = "Core network library for distant, providing implementations to support client/server architecture" categories = ["network-programming"] keywords = ["api", "async"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" @@ -17,7 +17,7 @@ bytes = "1.4.0" chacha20poly1305 = "0.10.1" const-str = "0.5.6" derive_more = { version = "0.99.17", default-features = false, features = ["as_mut", "as_ref", "deref", "deref_mut", "display", "from", "error", "into", "into_iterator", "is_variant", "try_into"] } -distant-auth = { version = "=0.20.0", path = "../distant-auth" } +distant-core-auth = { version = "=0.21.0", path = "../distant-core-auth" } dyn-clone = "1.0.11" flate2 = "1.0.26" hex = "0.4.3" @@ -37,7 +37,7 @@ strum = { version = "0.24.1", features = ["derive"] } tokio = { version = "1.28.2", features = ["full"] } [dev-dependencies] -distant-auth = { version = "=0.20.0", path = "../distant-auth", features = ["tests"] } +distant-core-auth = { version = "=0.21.0", path = "../distant-core-auth", features = ["tests"] } env_logger = "0.10.0" serde_json = "1.0.96" tempfile = "3.5.0" diff --git a/distant-net/README.md b/distant-core-net/README.md similarity index 100% rename from distant-net/README.md rename to distant-core-net/README.md diff --git a/distant-net/src/authentication.rs b/distant-core-net/src/authentication.rs similarity index 99% rename from distant-net/src/authentication.rs rename to distant-core-net/src/authentication.rs index 19c5e71..cdba7c6 100644 --- a/distant-net/src/authentication.rs +++ b/distant-core-net/src/authentication.rs @@ -1,8 +1,8 @@ use std::io; use async_trait::async_trait; -use distant_auth::msg::*; -use distant_auth::{AuthHandler, Authenticate, Authenticator}; +use distant_core_auth::msg::*; +use distant_core_auth::{AuthHandler, Authenticate, Authenticator}; use log::*; use crate::common::{utils, FramedTransport, Transport}; @@ -165,7 +165,7 @@ where #[cfg(test)] mod tests { - use distant_auth::tests::TestAuthHandler; + use distant_core_auth::tests::TestAuthHandler; use test_log::test; use tokio::sync::mpsc; diff --git a/distant-net/src/client.rs b/distant-core-net/src/client.rs similarity index 100% rename from distant-net/src/client.rs rename to distant-core-net/src/client.rs diff --git a/distant-net/src/client/builder.rs b/distant-core-net/src/client/builder.rs similarity index 99% rename from distant-net/src/client/builder.rs rename to distant-core-net/src/client/builder.rs index 9e02495..63e498f 100644 --- a/distant-net/src/client/builder.rs +++ b/distant-core-net/src/client/builder.rs @@ -14,7 +14,7 @@ use std::time::Duration; use std::{convert, io}; use async_trait::async_trait; -use distant_auth::AuthHandler; +use distant_core_auth::AuthHandler; #[cfg(windows)] pub use windows::*; diff --git a/distant-net/src/client/builder/tcp.rs b/distant-core-net/src/client/builder/tcp.rs similarity index 100% rename from distant-net/src/client/builder/tcp.rs rename to distant-core-net/src/client/builder/tcp.rs diff --git a/distant-net/src/client/builder/unix.rs b/distant-core-net/src/client/builder/unix.rs similarity index 100% rename from distant-net/src/client/builder/unix.rs rename to distant-core-net/src/client/builder/unix.rs diff --git a/distant-net/src/client/builder/windows.rs b/distant-core-net/src/client/builder/windows.rs similarity index 100% rename from distant-net/src/client/builder/windows.rs rename to distant-core-net/src/client/builder/windows.rs diff --git a/distant-net/src/client/channel.rs b/distant-core-net/src/client/channel.rs similarity index 100% rename from distant-net/src/client/channel.rs rename to distant-core-net/src/client/channel.rs diff --git a/distant-net/src/client/channel/mailbox.rs b/distant-core-net/src/client/channel/mailbox.rs similarity index 100% rename from distant-net/src/client/channel/mailbox.rs rename to distant-core-net/src/client/channel/mailbox.rs diff --git a/distant-net/src/client/config.rs b/distant-core-net/src/client/config.rs similarity index 100% rename from distant-net/src/client/config.rs rename to distant-core-net/src/client/config.rs diff --git a/distant-net/src/client/reconnect.rs b/distant-core-net/src/client/reconnect.rs similarity index 100% rename from distant-net/src/client/reconnect.rs rename to distant-core-net/src/client/reconnect.rs diff --git a/distant-net/src/client/shutdown.rs b/distant-core-net/src/client/shutdown.rs similarity index 100% rename from distant-net/src/client/shutdown.rs rename to distant-core-net/src/client/shutdown.rs diff --git a/distant-net/src/common.rs b/distant-core-net/src/common.rs similarity index 100% rename from distant-net/src/common.rs rename to distant-core-net/src/common.rs diff --git a/distant-net/src/common/any.rs b/distant-core-net/src/common/any.rs similarity index 100% rename from distant-net/src/common/any.rs rename to distant-core-net/src/common/any.rs diff --git a/distant-net/src/common/connection.rs b/distant-core-net/src/common/connection.rs similarity index 99% rename from distant-net/src/common/connection.rs rename to distant-core-net/src/common/connection.rs index ef6efe4..80dc178 100644 --- a/distant-net/src/common/connection.rs +++ b/distant-core-net/src/common/connection.rs @@ -2,7 +2,7 @@ use std::io; use std::ops::{Deref, DerefMut}; use async_trait::async_trait; -use distant_auth::{AuthHandler, Authenticate, Verifier}; +use distant_core_auth::{AuthHandler, Authenticate, Verifier}; use log::*; use serde::{Deserialize, Serialize}; use tokio::sync::oneshot; @@ -506,8 +506,8 @@ impl Connection { mod tests { use std::sync::Arc; - use distant_auth::msg::Challenge; - use distant_auth::{Authenticator, DummyAuthHandler}; + use distant_core_auth::msg::Challenge; + use distant_core_auth::{Authenticator, DummyAuthHandler}; use test_log::test; use super::*; diff --git a/distant-net/src/common/destination.rs b/distant-core-net/src/common/destination.rs similarity index 100% rename from distant-net/src/common/destination.rs rename to distant-core-net/src/common/destination.rs diff --git a/distant-net/src/common/destination/host.rs b/distant-core-net/src/common/destination/host.rs similarity index 99% rename from distant-net/src/common/destination/host.rs rename to distant-core-net/src/common/destination/host.rs index 2d9bad4..797aab7 100644 --- a/distant-net/src/common/destination/host.rs +++ b/distant-core-net/src/common/destination/host.rs @@ -111,7 +111,7 @@ impl FromStr for Host { /// ### Examples /// /// ``` - /// # use distant_net::common::Host; + /// # use distant_core_net::common::Host; /// # use std::net::{Ipv4Addr, Ipv6Addr}; /// // IPv4 address /// assert_eq!("127.0.0.1".parse(), Ok(Host::Ipv4(Ipv4Addr::new(127, 0, 0, 1)))); diff --git a/distant-net/src/common/destination/parser.rs b/distant-core-net/src/common/destination/parser.rs similarity index 100% rename from distant-net/src/common/destination/parser.rs rename to distant-core-net/src/common/destination/parser.rs diff --git a/distant-net/src/common/key.rs b/distant-core-net/src/common/key.rs similarity index 100% rename from distant-net/src/common/key.rs rename to distant-core-net/src/common/key.rs diff --git a/distant-net/src/common/keychain.rs b/distant-core-net/src/common/keychain.rs similarity index 100% rename from distant-net/src/common/keychain.rs rename to distant-core-net/src/common/keychain.rs diff --git a/distant-net/src/common/listener.rs b/distant-core-net/src/common/listener.rs similarity index 100% rename from distant-net/src/common/listener.rs rename to distant-core-net/src/common/listener.rs diff --git a/distant-net/src/common/listener/mapped.rs b/distant-core-net/src/common/listener/mapped.rs similarity index 100% rename from distant-net/src/common/listener/mapped.rs rename to distant-core-net/src/common/listener/mapped.rs diff --git a/distant-net/src/common/listener/mpsc.rs b/distant-core-net/src/common/listener/mpsc.rs similarity index 100% rename from distant-net/src/common/listener/mpsc.rs rename to distant-core-net/src/common/listener/mpsc.rs diff --git a/distant-net/src/common/listener/oneshot.rs b/distant-core-net/src/common/listener/oneshot.rs similarity index 100% rename from distant-net/src/common/listener/oneshot.rs rename to distant-core-net/src/common/listener/oneshot.rs diff --git a/distant-net/src/common/listener/tcp.rs b/distant-core-net/src/common/listener/tcp.rs similarity index 100% rename from distant-net/src/common/listener/tcp.rs rename to distant-core-net/src/common/listener/tcp.rs diff --git a/distant-net/src/common/listener/unix.rs b/distant-core-net/src/common/listener/unix.rs similarity index 100% rename from distant-net/src/common/listener/unix.rs rename to distant-core-net/src/common/listener/unix.rs diff --git a/distant-net/src/common/listener/windows.rs b/distant-core-net/src/common/listener/windows.rs similarity index 100% rename from distant-net/src/common/listener/windows.rs rename to distant-core-net/src/common/listener/windows.rs diff --git a/distant-net/src/common/map.rs b/distant-core-net/src/common/map.rs similarity index 99% rename from distant-net/src/common/map.rs rename to distant-core-net/src/common/map.rs index 2affac8..261dd02 100644 --- a/distant-net/src/common/map.rs +++ b/distant-core-net/src/common/map.rs @@ -34,7 +34,7 @@ impl Map { /// Keeping the value will result in `x` retaining the `a` key's original value: /// /// ```rust - /// use distant_net::map; + /// use distant_core_net::map; /// /// let mut x = map!("a" -> "hello", "b" -> "world"); /// let y = map!("a" -> "foo", "c" -> "bar"); @@ -47,7 +47,7 @@ impl Map { /// Not keeping the value will result in `x` replacing the `a` key's value: /// /// ```rust - /// use distant_net::map; + /// use distant_core_net::map; /// /// let mut x = map!("a" -> "hello", "b" -> "world"); /// let y = map!("a" -> "foo", "c" -> "bar"); @@ -247,7 +247,7 @@ impl<'de> Deserialize<'de> for Map { /// Generates a new [`Map`] of key/value pairs based on literals. /// /// ``` -/// use distant_net::map; +/// use distant_core_net::map; /// /// let _map = map!("key" -> "value", "key2" -> "value2"); /// ``` diff --git a/distant-net/src/common/packet.rs b/distant-core-net/src/common/packet.rs similarity index 100% rename from distant-net/src/common/packet.rs rename to distant-core-net/src/common/packet.rs diff --git a/distant-net/src/common/packet/header.rs b/distant-core-net/src/common/packet/header.rs similarity index 98% rename from distant-net/src/common/packet/header.rs rename to distant-core-net/src/common/packet/header.rs index 999709c..f0f478f 100644 --- a/distant-net/src/common/packet/header.rs +++ b/distant-core-net/src/common/packet/header.rs @@ -11,7 +11,7 @@ use crate::common::{utils, Value}; /// Generates a new [`Header`] of key/value pairs based on literals. /// /// ``` -/// use distant_net::header; +/// use distant_core_net::header; /// /// let _header = header!("key" -> "value", "key2" -> 123); /// ``` diff --git a/distant-net/src/common/packet/request.rs b/distant-core-net/src/common/packet/request.rs similarity index 100% rename from distant-net/src/common/packet/request.rs rename to distant-core-net/src/common/packet/request.rs diff --git a/distant-net/src/common/packet/response.rs b/distant-core-net/src/common/packet/response.rs similarity index 100% rename from distant-net/src/common/packet/response.rs rename to distant-core-net/src/common/packet/response.rs diff --git a/distant-net/src/common/packet/value.rs b/distant-core-net/src/common/packet/value.rs similarity index 100% rename from distant-net/src/common/packet/value.rs rename to distant-core-net/src/common/packet/value.rs diff --git a/distant-net/src/common/port.rs b/distant-core-net/src/common/port.rs similarity index 100% rename from distant-net/src/common/port.rs rename to distant-core-net/src/common/port.rs diff --git a/distant-net/src/common/transport.rs b/distant-core-net/src/common/transport.rs similarity index 100% rename from distant-net/src/common/transport.rs rename to distant-core-net/src/common/transport.rs diff --git a/distant-net/src/common/transport/framed.rs b/distant-core-net/src/common/transport/framed.rs similarity index 100% rename from distant-net/src/common/transport/framed.rs rename to distant-core-net/src/common/transport/framed.rs diff --git a/distant-net/src/common/transport/framed/backup.rs b/distant-core-net/src/common/transport/framed/backup.rs similarity index 100% rename from distant-net/src/common/transport/framed/backup.rs rename to distant-core-net/src/common/transport/framed/backup.rs diff --git a/distant-net/src/common/transport/framed/codec.rs b/distant-core-net/src/common/transport/framed/codec.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec.rs rename to distant-core-net/src/common/transport/framed/codec.rs diff --git a/distant-net/src/common/transport/framed/codec/chain.rs b/distant-core-net/src/common/transport/framed/codec/chain.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec/chain.rs rename to distant-core-net/src/common/transport/framed/codec/chain.rs diff --git a/distant-net/src/common/transport/framed/codec/compression.rs b/distant-core-net/src/common/transport/framed/codec/compression.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec/compression.rs rename to distant-core-net/src/common/transport/framed/codec/compression.rs diff --git a/distant-net/src/common/transport/framed/codec/encryption.rs b/distant-core-net/src/common/transport/framed/codec/encryption.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec/encryption.rs rename to distant-core-net/src/common/transport/framed/codec/encryption.rs diff --git a/distant-net/src/common/transport/framed/codec/plain.rs b/distant-core-net/src/common/transport/framed/codec/plain.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec/plain.rs rename to distant-core-net/src/common/transport/framed/codec/plain.rs diff --git a/distant-net/src/common/transport/framed/codec/predicate.rs b/distant-core-net/src/common/transport/framed/codec/predicate.rs similarity index 100% rename from distant-net/src/common/transport/framed/codec/predicate.rs rename to distant-core-net/src/common/transport/framed/codec/predicate.rs diff --git a/distant-net/src/common/transport/framed/exchange.rs b/distant-core-net/src/common/transport/framed/exchange.rs similarity index 100% rename from distant-net/src/common/transport/framed/exchange.rs rename to distant-core-net/src/common/transport/framed/exchange.rs diff --git a/distant-net/src/common/transport/framed/exchange/pkb.rs b/distant-core-net/src/common/transport/framed/exchange/pkb.rs similarity index 100% rename from distant-net/src/common/transport/framed/exchange/pkb.rs rename to distant-core-net/src/common/transport/framed/exchange/pkb.rs diff --git a/distant-net/src/common/transport/framed/exchange/salt.rs b/distant-core-net/src/common/transport/framed/exchange/salt.rs similarity index 100% rename from distant-net/src/common/transport/framed/exchange/salt.rs rename to distant-core-net/src/common/transport/framed/exchange/salt.rs diff --git a/distant-net/src/common/transport/framed/frame.rs b/distant-core-net/src/common/transport/framed/frame.rs similarity index 100% rename from distant-net/src/common/transport/framed/frame.rs rename to distant-core-net/src/common/transport/framed/frame.rs diff --git a/distant-net/src/common/transport/framed/handshake.rs b/distant-core-net/src/common/transport/framed/handshake.rs similarity index 100% rename from distant-net/src/common/transport/framed/handshake.rs rename to distant-core-net/src/common/transport/framed/handshake.rs diff --git a/distant-net/src/common/transport/inmemory.rs b/distant-core-net/src/common/transport/inmemory.rs similarity index 100% rename from distant-net/src/common/transport/inmemory.rs rename to distant-core-net/src/common/transport/inmemory.rs diff --git a/distant-net/src/common/transport/tcp.rs b/distant-core-net/src/common/transport/tcp.rs similarity index 100% rename from distant-net/src/common/transport/tcp.rs rename to distant-core-net/src/common/transport/tcp.rs diff --git a/distant-net/src/common/transport/test.rs b/distant-core-net/src/common/transport/test.rs similarity index 100% rename from distant-net/src/common/transport/test.rs rename to distant-core-net/src/common/transport/test.rs diff --git a/distant-net/src/common/transport/unix.rs b/distant-core-net/src/common/transport/unix.rs similarity index 100% rename from distant-net/src/common/transport/unix.rs rename to distant-core-net/src/common/transport/unix.rs diff --git a/distant-net/src/common/transport/windows.rs b/distant-core-net/src/common/transport/windows.rs similarity index 100% rename from distant-net/src/common/transport/windows.rs rename to distant-core-net/src/common/transport/windows.rs diff --git a/distant-net/src/common/transport/windows/pipe.rs b/distant-core-net/src/common/transport/windows/pipe.rs similarity index 100% rename from distant-net/src/common/transport/windows/pipe.rs rename to distant-core-net/src/common/transport/windows/pipe.rs diff --git a/distant-net/src/common/utils.rs b/distant-core-net/src/common/utils.rs similarity index 100% rename from distant-net/src/common/utils.rs rename to distant-core-net/src/common/utils.rs diff --git a/distant-net/src/common/version.rs b/distant-core-net/src/common/version.rs similarity index 98% rename from distant-net/src/common/version.rs rename to distant-core-net/src/common/version.rs index 5aa5bbb..9db9a6c 100644 --- a/distant-net/src/common/version.rs +++ b/distant-core-net/src/common/version.rs @@ -15,7 +15,7 @@ impl Version { /// major version is `0`. /// /// ``` - /// use distant_net::common::Version; + /// use distant_core_net::common::Version; /// /// // Matching versions are compatible /// let a = Version::new(1, 2, 3); diff --git a/distant-net/src/lib.rs b/distant-core-net/src/lib.rs similarity index 91% rename from distant-net/src/lib.rs rename to distant-core-net/src/lib.rs index 3d93c8e..4cc6432 100644 --- a/distant-net/src/lib.rs +++ b/distant-core-net/src/lib.rs @@ -12,6 +12,6 @@ pub mod server; pub use client::{Client, ReconnectStrategy}; /// Authentication functionality tied to network operations. -pub use distant_auth as auth; +pub use distant_core_auth as auth; pub use server::Server; pub use {log, paste}; diff --git a/distant-net/src/manager.rs b/distant-core-net/src/manager.rs similarity index 100% rename from distant-net/src/manager.rs rename to distant-core-net/src/manager.rs diff --git a/distant-net/src/manager/client.rs b/distant-core-net/src/manager/client.rs similarity index 99% rename from distant-net/src/manager/client.rs rename to distant-core-net/src/manager/client.rs index f20c700..4b58c9b 100644 --- a/distant-net/src/manager/client.rs +++ b/distant-core-net/src/manager/client.rs @@ -1,7 +1,7 @@ use std::io; -use distant_auth::msg::{Authentication, AuthenticationResponse}; -use distant_auth::AuthHandler; +use distant_core_auth::msg::{Authentication, AuthenticationResponse}; +use distant_core_auth::AuthHandler; use log::*; use crate::client::Client; @@ -298,7 +298,7 @@ impl ManagerClient { #[cfg(test)] mod tests { - use distant_auth::DummyAuthHandler; + use distant_core_auth::DummyAuthHandler; use super::*; use crate::client::UntypedClient; diff --git a/distant-net/src/manager/client/channel.rs b/distant-core-net/src/manager/client/channel.rs similarity index 100% rename from distant-net/src/manager/client/channel.rs rename to distant-core-net/src/manager/client/channel.rs diff --git a/distant-net/src/manager/data.rs b/distant-core-net/src/manager/data.rs similarity index 100% rename from distant-net/src/manager/data.rs rename to distant-core-net/src/manager/data.rs diff --git a/distant-net/src/manager/data/info.rs b/distant-core-net/src/manager/data/info.rs similarity index 100% rename from distant-net/src/manager/data/info.rs rename to distant-core-net/src/manager/data/info.rs diff --git a/distant-net/src/manager/data/list.rs b/distant-core-net/src/manager/data/list.rs similarity index 100% rename from distant-net/src/manager/data/list.rs rename to distant-core-net/src/manager/data/list.rs diff --git a/distant-net/src/manager/data/request.rs b/distant-core-net/src/manager/data/request.rs similarity index 97% rename from distant-net/src/manager/data/request.rs rename to distant-core-net/src/manager/data/request.rs index c04cc0c..bec2662 100644 --- a/distant-net/src/manager/data/request.rs +++ b/distant-core-net/src/manager/data/request.rs @@ -1,4 +1,4 @@ -use distant_auth::msg::AuthenticationResponse; +use distant_core_auth::msg::AuthenticationResponse; use serde::{Deserialize, Serialize}; use super::{ManagerAuthenticationId, ManagerChannelId}; diff --git a/distant-net/src/manager/data/response.rs b/distant-core-net/src/manager/data/response.rs similarity index 97% rename from distant-net/src/manager/data/response.rs rename to distant-core-net/src/manager/data/response.rs index b48cde5..66140ef 100644 --- a/distant-net/src/manager/data/response.rs +++ b/distant-core-net/src/manager/data/response.rs @@ -1,4 +1,4 @@ -use distant_auth::msg::Authentication; +use distant_core_auth::msg::Authentication; use serde::{Deserialize, Serialize}; use super::{ConnectionInfo, ConnectionList, ManagerAuthenticationId, ManagerChannelId, SemVer}; diff --git a/distant-net/src/manager/server.rs b/distant-core-net/src/manager/server.rs similarity index 99% rename from distant-net/src/manager/server.rs rename to distant-core-net/src/manager/server.rs index 9b23121..eebd557 100644 --- a/distant-net/src/manager/server.rs +++ b/distant-core-net/src/manager/server.rs @@ -3,7 +3,7 @@ use std::io; use std::sync::Arc; use async_trait::async_trait; -use distant_auth::msg::AuthenticationResponse; +use distant_core_auth::msg::AuthenticationResponse; use log::*; use tokio::sync::{oneshot, RwLock}; diff --git a/distant-net/src/manager/server/authentication.rs b/distant-core-net/src/manager/server/authentication.rs similarity index 98% rename from distant-net/src/manager/server/authentication.rs rename to distant-core-net/src/manager/server/authentication.rs index edc6963..f9e2265 100644 --- a/distant-net/src/manager/server/authentication.rs +++ b/distant-core-net/src/manager/server/authentication.rs @@ -3,8 +3,8 @@ use std::io; use std::sync::Arc; use async_trait::async_trait; -use distant_auth::msg::*; -use distant_auth::Authenticator; +use distant_core_auth::msg::*; +use distant_core_auth::Authenticator; use tokio::sync::{oneshot, RwLock}; use crate::manager::data::{ManagerAuthenticationId, ManagerResponse}; diff --git a/distant-net/src/manager/server/config.rs b/distant-core-net/src/manager/server/config.rs similarity index 100% rename from distant-net/src/manager/server/config.rs rename to distant-core-net/src/manager/server/config.rs diff --git a/distant-net/src/manager/server/connection.rs b/distant-core-net/src/manager/server/connection.rs similarity index 100% rename from distant-net/src/manager/server/connection.rs rename to distant-core-net/src/manager/server/connection.rs diff --git a/distant-net/src/manager/server/handler.rs b/distant-core-net/src/manager/server/handler.rs similarity index 98% rename from distant-net/src/manager/server/handler.rs rename to distant-core-net/src/manager/server/handler.rs index ee86f53..a0dbbe3 100644 --- a/distant-net/src/manager/server/handler.rs +++ b/distant-core-net/src/manager/server/handler.rs @@ -2,7 +2,7 @@ use std::future::Future; use std::io; use async_trait::async_trait; -use distant_auth::Authenticator; +use distant_core_auth::Authenticator; use crate::client::UntypedClient; use crate::common::{Destination, Map}; @@ -47,7 +47,7 @@ where /// Generates a new [`LaunchHandler`] for the provided anonymous function in the form of /// /// ``` -/// use distant_net::boxed_launch_handler; +/// use distant_core_net::boxed_launch_handler; /// /// let _handler = boxed_launch_handler!(|destination, options, authenticator| { /// todo!("Implement handler logic."); @@ -117,7 +117,7 @@ where /// Generates a new [`ConnectHandler`] for the provided anonymous function in the form of /// /// ``` -/// use distant_net::boxed_connect_handler; +/// use distant_core_net::boxed_connect_handler; /// /// let _handler = boxed_connect_handler!(|destination, options, authenticator| { /// todo!("Implement handler logic."); diff --git a/distant-net/src/server.rs b/distant-core-net/src/server.rs similarity index 99% rename from distant-net/src/server.rs rename to distant-core-net/src/server.rs index 218b996..c70ce81 100644 --- a/distant-net/src/server.rs +++ b/distant-core-net/src/server.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use std::time::Duration; use async_trait::async_trait; -use distant_auth::Verifier; +use distant_core_auth::Verifier; use log::*; use serde::de::DeserializeOwned; use serde::Serialize; @@ -265,7 +265,7 @@ mod tests { use std::time::Duration; use async_trait::async_trait; - use distant_auth::{AuthenticationMethod, DummyAuthHandler, NoneAuthenticationMethod}; + use distant_core_auth::{AuthenticationMethod, DummyAuthHandler, NoneAuthenticationMethod}; use test_log::test; use tokio::sync::mpsc; diff --git a/distant-net/src/server/builder.rs b/distant-core-net/src/server/builder.rs similarity index 100% rename from distant-net/src/server/builder.rs rename to distant-core-net/src/server/builder.rs diff --git a/distant-net/src/server/builder/tcp.rs b/distant-core-net/src/server/builder/tcp.rs similarity index 97% rename from distant-net/src/server/builder/tcp.rs rename to distant-core-net/src/server/builder/tcp.rs index be35590..1b1b254 100644 --- a/distant-net/src/server/builder/tcp.rs +++ b/distant-core-net/src/server/builder/tcp.rs @@ -1,7 +1,7 @@ use std::io; use std::net::IpAddr; -use distant_auth::Verifier; +use distant_core_auth::Verifier; use serde::de::DeserializeOwned; use serde::Serialize; @@ -63,7 +63,7 @@ mod tests { use std::net::{Ipv6Addr, SocketAddr}; use async_trait::async_trait; - use distant_auth::DummyAuthHandler; + use distant_core_auth::DummyAuthHandler; use test_log::test; use super::*; diff --git a/distant-net/src/server/builder/unix.rs b/distant-core-net/src/server/builder/unix.rs similarity index 97% rename from distant-net/src/server/builder/unix.rs rename to distant-core-net/src/server/builder/unix.rs index 1037b65..b76c44d 100644 --- a/distant-net/src/server/builder/unix.rs +++ b/distant-core-net/src/server/builder/unix.rs @@ -1,7 +1,7 @@ use std::io; use std::path::Path; -use distant_auth::Verifier; +use distant_core_auth::Verifier; use serde::de::DeserializeOwned; use serde::Serialize; @@ -62,7 +62,7 @@ where #[cfg(test)] mod tests { use async_trait::async_trait; - use distant_auth::DummyAuthHandler; + use distant_core_auth::DummyAuthHandler; use tempfile::NamedTempFile; use test_log::test; diff --git a/distant-net/src/server/builder/windows.rs b/distant-core-net/src/server/builder/windows.rs similarity index 97% rename from distant-net/src/server/builder/windows.rs rename to distant-core-net/src/server/builder/windows.rs index eb7f3d3..e6ef6b5 100644 --- a/distant-net/src/server/builder/windows.rs +++ b/distant-core-net/src/server/builder/windows.rs @@ -1,7 +1,7 @@ use std::ffi::{OsStr, OsString}; use std::io; -use distant_auth::Verifier; +use distant_core_auth::Verifier; use serde::de::DeserializeOwned; use serde::Serialize; @@ -74,7 +74,7 @@ where #[cfg(test)] mod tests { use async_trait::async_trait; - use distant_auth::DummyAuthHandler; + use distant_core_auth::DummyAuthHandler; use test_log::test; use super::*; diff --git a/distant-net/src/server/config.rs b/distant-core-net/src/server/config.rs similarity index 100% rename from distant-net/src/server/config.rs rename to distant-core-net/src/server/config.rs diff --git a/distant-net/src/server/connection.rs b/distant-core-net/src/server/connection.rs similarity index 99% rename from distant-net/src/server/connection.rs rename to distant-core-net/src/server/connection.rs index 540836e..015a408 100644 --- a/distant-net/src/server/connection.rs +++ b/distant-core-net/src/server/connection.rs @@ -5,7 +5,7 @@ use std::sync::{Arc, Weak}; use std::task::{Context, Poll}; use std::time::{Duration, Instant}; -use distant_auth::Verifier; +use distant_core_auth::Verifier; use log::*; use serde::de::DeserializeOwned; use serde::Serialize; @@ -619,7 +619,7 @@ mod tests { use std::sync::atomic::{AtomicBool, Ordering}; use async_trait::async_trait; - use distant_auth::DummyAuthHandler; + use distant_core_auth::DummyAuthHandler; use test_log::test; use super::*; diff --git a/distant-net/src/server/context.rs b/distant-core-net/src/server/context.rs similarity index 100% rename from distant-net/src/server/context.rs rename to distant-core-net/src/server/context.rs diff --git a/distant-net/src/server/ref.rs b/distant-core-net/src/server/ref.rs similarity index 100% rename from distant-net/src/server/ref.rs rename to distant-core-net/src/server/ref.rs diff --git a/distant-net/src/server/ref/tcp.rs b/distant-core-net/src/server/ref/tcp.rs similarity index 100% rename from distant-net/src/server/ref/tcp.rs rename to distant-core-net/src/server/ref/tcp.rs diff --git a/distant-net/src/server/ref/unix.rs b/distant-core-net/src/server/ref/unix.rs similarity index 100% rename from distant-net/src/server/ref/unix.rs rename to distant-core-net/src/server/ref/unix.rs diff --git a/distant-net/src/server/ref/windows.rs b/distant-core-net/src/server/ref/windows.rs similarity index 100% rename from distant-net/src/server/ref/windows.rs rename to distant-core-net/src/server/ref/windows.rs diff --git a/distant-net/src/server/reply.rs b/distant-core-net/src/server/reply.rs similarity index 100% rename from distant-net/src/server/reply.rs rename to distant-core-net/src/server/reply.rs diff --git a/distant-net/src/server/shutdown_timer.rs b/distant-core-net/src/server/shutdown_timer.rs similarity index 100% rename from distant-net/src/server/shutdown_timer.rs rename to distant-core-net/src/server/shutdown_timer.rs diff --git a/distant-net/src/server/state.rs b/distant-core-net/src/server/state.rs similarity index 100% rename from distant-net/src/server/state.rs rename to distant-core-net/src/server/state.rs diff --git a/distant-net/tests/manager_tests.rs b/distant-core-net/tests/manager_tests.rs similarity index 91% rename from distant-net/tests/manager_tests.rs rename to distant-core-net/tests/manager_tests.rs index 370fade..eeea1be 100644 --- a/distant-net/tests/manager_tests.rs +++ b/distant-core-net/tests/manager_tests.rs @@ -1,12 +1,12 @@ use std::io; use async_trait::async_trait; -use distant_net::auth::{DummyAuthHandler, Verifier}; -use distant_net::boxed_connect_handler; -use distant_net::client::Client; -use distant_net::common::{Destination, InmemoryTransport, Map, OneshotListener}; -use distant_net::manager::{Config, ManagerClient, ManagerServer}; -use distant_net::server::{RequestCtx, Server, ServerHandler}; +use distant_core_net::auth::{DummyAuthHandler, Verifier}; +use distant_core_net::boxed_connect_handler; +use distant_core_net::client::Client; +use distant_core_net::common::{Destination, InmemoryTransport, Map, OneshotListener}; +use distant_core_net::manager::{Config, ManagerClient, ManagerServer}; +use distant_core_net::server::{RequestCtx, Server, ServerHandler}; use log::*; use test_log::test; diff --git a/distant-net/tests/typed_tests.rs b/distant-core-net/tests/typed_tests.rs similarity index 89% rename from distant-net/tests/typed_tests.rs rename to distant-core-net/tests/typed_tests.rs index beecce7..66f0d6d 100644 --- a/distant-net/tests/typed_tests.rs +++ b/distant-core-net/tests/typed_tests.rs @@ -1,8 +1,8 @@ use async_trait::async_trait; -use distant_auth::{DummyAuthHandler, Verifier}; -use distant_net::client::Client; -use distant_net::common::{InmemoryTransport, OneshotListener}; -use distant_net::server::{RequestCtx, Server, ServerHandler}; +use distant_core_auth::{DummyAuthHandler, Verifier}; +use distant_core_net::client::Client; +use distant_core_net::common::{InmemoryTransport, OneshotListener}; +use distant_core_net::server::{RequestCtx, Server, ServerHandler}; use log::*; use test_log::test; diff --git a/distant-net/tests/untyped_tests.rs b/distant-core-net/tests/untyped_tests.rs similarity index 91% rename from distant-net/tests/untyped_tests.rs rename to distant-core-net/tests/untyped_tests.rs index 5abd2cf..e4d14ad 100644 --- a/distant-net/tests/untyped_tests.rs +++ b/distant-core-net/tests/untyped_tests.rs @@ -1,8 +1,8 @@ use async_trait::async_trait; -use distant_auth::{DummyAuthHandler, Verifier}; -use distant_net::client::Client; -use distant_net::common::{InmemoryTransport, OneshotListener, Request}; -use distant_net::server::{RequestCtx, Server, ServerHandler}; +use distant_core_auth::{DummyAuthHandler, Verifier}; +use distant_core_net::client::Client; +use distant_core_net::common::{InmemoryTransport, OneshotListener, Request}; +use distant_core_net::server::{RequestCtx, Server, ServerHandler}; use log::*; use test_log::test; diff --git a/distant-core-plugin/Cargo.toml b/distant-core-plugin/Cargo.toml new file mode 100644 index 0000000..75f4cfe --- /dev/null +++ b/distant-core-plugin/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "distant-core-plugin" +description = "Core plugin library for distant that provides everything needed to build a plugin" +categories = [] +keywords = [] +version = "0.21.0" +authors = ["Chip Senkbeil "] +edition = "2021" +homepage = "https://github.com/chipsenkbeil/distant" +repository = "https://github.com/chipsenkbeil/distant" +readme = "README.md" +license = "MIT OR Apache-2.0" diff --git a/distant-core-plugin/README.md b/distant-core-plugin/README.md new file mode 100644 index 0000000..bcb7738 --- /dev/null +++ b/distant-core-plugin/README.md @@ -0,0 +1,35 @@ +# distant auth + +[![Crates.io][distant_crates_img]][distant_crates_lnk] [![Docs.rs][distant_doc_img]][distant_doc_lnk] [![Rustc 1.70.0][distant_rustc_img]][distant_rustc_lnk] + +[distant_crates_img]: https://img.shields.io/crates/v/distant-auth.svg +[distant_crates_lnk]: https://crates.io/crates/distant-auth +[distant_doc_img]: https://docs.rs/distant-auth/badge.svg +[distant_doc_lnk]: https://docs.rs/distant-auth +[distant_rustc_img]: https://img.shields.io/badge/distant_auth-rustc_1.70+-lightgray.svg +[distant_rustc_lnk]: https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html + +## Details + +The `distant-auth` library supplies the authentication functionality for the +distant interfaces and distant cli. + +## Installation + +You can import the dependency by adding the following to your `Cargo.toml`: + +```toml +[dependencies] +distant-auth = "0.20" +``` + +## License + +This project is licensed under either of + +Apache License, Version 2.0, (LICENSE-APACHE or +[apache-license][apache-license]) MIT license (LICENSE-MIT or +[mit-license][mit-license]) at your option. + +[apache-license]: http://www.apache.org/licenses/LICENSE-2.0 +[mit-license]: http://opensource.org/licenses/MIT diff --git a/distant-core-plugin/src/lib.rs b/distant-core-plugin/src/lib.rs new file mode 100644 index 0000000..a4fe428 --- /dev/null +++ b/distant-core-plugin/src/lib.rs @@ -0,0 +1,5 @@ +#![doc = include_str!("../README.md")] + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/distant-protocol/Cargo.toml b/distant-core-protocol/Cargo.toml similarity index 83% rename from distant-protocol/Cargo.toml rename to distant-core-protocol/Cargo.toml index 3e14f71..3d73af7 100644 --- a/distant-protocol/Cargo.toml +++ b/distant-core-protocol/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "distant-protocol" -description = "Protocol library for distant, providing data structures used between the client and server" +name = "distant-core-protocol" +description = "Core protocol library for distant, providing data structures used between the client and server" categories = ["data-structures"] keywords = ["protocol"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" diff --git a/distant-protocol/README.md b/distant-core-protocol/README.md similarity index 100% rename from distant-protocol/README.md rename to distant-core-protocol/README.md diff --git a/distant-protocol/src/common.rs b/distant-core-protocol/src/common.rs similarity index 100% rename from distant-protocol/src/common.rs rename to distant-core-protocol/src/common.rs diff --git a/distant-protocol/src/common/change.rs b/distant-core-protocol/src/common/change.rs similarity index 100% rename from distant-protocol/src/common/change.rs rename to distant-core-protocol/src/common/change.rs diff --git a/distant-protocol/src/common/cmd.rs b/distant-core-protocol/src/common/cmd.rs similarity index 100% rename from distant-protocol/src/common/cmd.rs rename to distant-core-protocol/src/common/cmd.rs diff --git a/distant-protocol/src/common/error.rs b/distant-core-protocol/src/common/error.rs similarity index 100% rename from distant-protocol/src/common/error.rs rename to distant-core-protocol/src/common/error.rs diff --git a/distant-protocol/src/common/filesystem.rs b/distant-core-protocol/src/common/filesystem.rs similarity index 100% rename from distant-protocol/src/common/filesystem.rs rename to distant-core-protocol/src/common/filesystem.rs diff --git a/distant-protocol/src/common/metadata.rs b/distant-core-protocol/src/common/metadata.rs similarity index 100% rename from distant-protocol/src/common/metadata.rs rename to distant-core-protocol/src/common/metadata.rs diff --git a/distant-protocol/src/common/permissions.rs b/distant-core-protocol/src/common/permissions.rs similarity index 98% rename from distant-protocol/src/common/permissions.rs rename to distant-core-protocol/src/common/permissions.rs index 1db4dbc..ff7b8cd 100644 --- a/distant-protocol/src/common/permissions.rs +++ b/distant-core-protocol/src/common/permissions.rs @@ -75,7 +75,7 @@ impl Permissions { /// Creates a set of [`Permissions`] that indicate readonly status. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// let permissions = Permissions::readonly(); /// assert_eq!(permissions.is_readonly(), Some(true)); @@ -100,7 +100,7 @@ impl Permissions { /// Creates a set of [`Permissions`] that indicate globally writable status. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// let permissions = Permissions::writable(); /// assert_eq!(permissions.is_readonly(), Some(false)); @@ -126,7 +126,7 @@ impl Permissions { /// settings). /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// let permissions = Permissions { /// owner_write: Some(true), @@ -157,7 +157,7 @@ impl Permissions { /// writable, and `None` if no permissions have been set to indicate either status. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// assert_eq!( /// Permissions { owner_write: Some(true), ..Default::default() }.is_readonly(), @@ -184,7 +184,7 @@ impl Permissions { /// inability to write, and `None` if no permissions have been set to indicate either status. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// assert_eq!( /// Permissions { owner_write: Some(true), ..Default::default() }.is_writable(), @@ -214,7 +214,7 @@ impl Permissions { /// Applies `other` settings to `self`, overwriting any of the permissions in `self` with `other`. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// let mut a = Permissions { /// owner_read: Some(true), @@ -264,7 +264,7 @@ impl Permissions { /// `self`. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// let a = Permissions { /// owner_read: Some(true), @@ -313,7 +313,7 @@ impl Permissions { /// Converts to a Unix `mode` from a permission set. For any missing setting, a 0 bit is used. /// /// ``` - /// use distant_protocol::Permissions; + /// use distant_core_protocol::Permissions; /// /// assert_eq!(Permissions { /// owner_read: Some(true), diff --git a/distant-protocol/src/common/pty.rs b/distant-core-protocol/src/common/pty.rs similarity index 100% rename from distant-protocol/src/common/pty.rs rename to distant-core-protocol/src/common/pty.rs diff --git a/distant-protocol/src/common/search.rs b/distant-core-protocol/src/common/search.rs similarity index 100% rename from distant-protocol/src/common/search.rs rename to distant-core-protocol/src/common/search.rs diff --git a/distant-protocol/src/common/system.rs b/distant-core-protocol/src/common/system.rs similarity index 100% rename from distant-protocol/src/common/system.rs rename to distant-core-protocol/src/common/system.rs diff --git a/distant-protocol/src/common/version.rs b/distant-core-protocol/src/common/version.rs similarity index 100% rename from distant-protocol/src/common/version.rs rename to distant-core-protocol/src/common/version.rs diff --git a/distant-protocol/src/lib.rs b/distant-core-protocol/src/lib.rs similarity index 96% rename from distant-protocol/src/lib.rs rename to distant-core-protocol/src/lib.rs index cc213a9..85432cb 100644 --- a/distant-protocol/src/lib.rs +++ b/distant-core-protocol/src/lib.rs @@ -73,8 +73,8 @@ const PROTOCOL_VERSION_COMPAT: (semver::Comparator, semver::Comparator) = ( /// Returns true if the provided version is compatible with the protocol version. /// /// ``` -/// use distant_protocol::{is_compatible_with, PROTOCOL_VERSION}; -/// use distant_protocol::semver::Version; +/// use distant_core_protocol::{is_compatible_with, PROTOCOL_VERSION}; +/// use distant_core_protocol::semver::Version; /// /// // The current protocol version tied to this crate is always compatible /// assert!(is_compatible_with(&PROTOCOL_VERSION)); diff --git a/distant-protocol/src/msg.rs b/distant-core-protocol/src/msg.rs similarity index 100% rename from distant-protocol/src/msg.rs rename to distant-core-protocol/src/msg.rs diff --git a/distant-protocol/src/request.rs b/distant-core-protocol/src/request.rs similarity index 100% rename from distant-protocol/src/request.rs rename to distant-core-protocol/src/request.rs diff --git a/distant-protocol/src/response.rs b/distant-core-protocol/src/response.rs similarity index 100% rename from distant-protocol/src/response.rs rename to distant-core-protocol/src/response.rs diff --git a/distant-protocol/src/utils.rs b/distant-core-protocol/src/utils.rs similarity index 100% rename from distant-protocol/src/utils.rs rename to distant-core-protocol/src/utils.rs diff --git a/distant-core/Cargo.toml b/distant-core/Cargo.toml index 1d9354f..4b22d7f 100644 --- a/distant-core/Cargo.toml +++ b/distant-core/Cargo.toml @@ -3,7 +3,7 @@ name = "distant-core" description = "Core library for distant, enabling operation on a remote computer through file and process manipulation" categories = ["network-programming"] keywords = ["api", "async"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" @@ -16,8 +16,9 @@ async-trait = "0.1.68" bitflags = "2.3.1" bytes = "1.4.0" derive_more = { version = "0.99.17", default-features = false, features = ["as_mut", "as_ref", "deref", "deref_mut", "display", "from", "error", "into", "into_iterator", "is_variant", "try_into"] } -distant-net = { version = "=0.20.0", path = "../distant-net" } -distant-protocol = { version = "=0.20.0", path = "../distant-protocol" } +distant-core-net = { version = "=0.21.0", path = "../distant-core-net" } +distant-core-plugin = { version = "=0.21.0", path = "../distant-core-plugin" } +distant-core-protocol = { version = "=0.21.0", path = "../distant-core-protocol" } futures = "0.3.28" hex = "0.4.3" log = "0.4.18" diff --git a/distant-core/src/api.rs b/distant-core/src/api.rs index 62042fd..7e0f49c 100644 --- a/distant-core/src/api.rs +++ b/distant-core/src/api.rs @@ -3,8 +3,8 @@ use std::path::PathBuf; use std::sync::Arc; use async_trait::async_trait; -use distant_net::common::ConnectionId; -use distant_net::server::{Reply, RequestCtx, ServerHandler}; +use distant_core_net::common::ConnectionId; +use distant_core_net::server::{Reply, RequestCtx, ServerHandler}; use log::*; use crate::protocol::{ diff --git a/distant-core/src/api/reply.rs b/distant-core/src/api/reply.rs index 78212a0..8510b45 100644 --- a/distant-core/src/api/reply.rs +++ b/distant-core/src/api/reply.rs @@ -1,6 +1,6 @@ use std::io; -use distant_net::server::Reply; +use distant_core_net::server::Reply; use crate::protocol; diff --git a/distant-core/src/client.rs b/distant-core/src/client.rs index b700762..9e3a0f7 100644 --- a/distant-core/src/client.rs +++ b/distant-core/src/client.rs @@ -1,5 +1,5 @@ -use distant_net::client::Channel; -use distant_net::Client; +use distant_core_net::client::Channel; +use distant_core_net::Client; use crate::protocol; diff --git a/distant-core/src/client/ext.rs b/distant-core/src/client/ext.rs index bedbc64..7f6dc61 100644 --- a/distant-core/src/client/ext.rs +++ b/distant-core/src/client/ext.rs @@ -3,8 +3,8 @@ use std::io; use std::path::PathBuf; use std::pin::Pin; -use distant_net::client::Channel; -use distant_net::common::Request; +use distant_core_net::client::Channel; +use distant_core_net::common::Request; use crate::client::{ RemoteCommand, RemoteLspCommand, RemoteLspProcess, RemoteOutput, RemoteProcess, Searcher, diff --git a/distant-core/src/client/lsp.rs b/distant-core/src/client/lsp.rs index 512504c..13a77f8 100644 --- a/distant-core/src/client/lsp.rs +++ b/distant-core/src/client/lsp.rs @@ -432,8 +432,8 @@ mod tests { use std::future::Future; use std::time::Duration; - use distant_net::common::{FramedTransport, InmemoryTransport, Request, Response}; - use distant_net::Client; + use distant_core_net::common::{FramedTransport, InmemoryTransport, Request, Response}; + use distant_core_net::Client; use test_log::test; use super::*; diff --git a/distant-core/src/client/process.rs b/distant-core/src/client/process.rs index 7ef1eda..fc5e62d 100644 --- a/distant-core/src/client/process.rs +++ b/distant-core/src/client/process.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use std::sync::Arc; -use distant_net::client::Mailbox; -use distant_net::common::{Request, Response}; +use distant_core_net::client::Mailbox; +use distant_core_net::common::{Request, Response}; use log::*; use tokio::io; use tokio::sync::mpsc::error::{TryRecvError, TrySendError}; @@ -590,8 +590,8 @@ mod errors { mod tests { use std::time::Duration; - use distant_net::common::{FramedTransport, InmemoryTransport, Response}; - use distant_net::Client; + use distant_core_net::common::{FramedTransport, InmemoryTransport, Response}; + use distant_core_net::Client; use test_log::test; use super::*; diff --git a/distant-core/src/client/searcher.rs b/distant-core/src/client/searcher.rs index cef0542..ea21a97 100644 --- a/distant-core/src/client/searcher.rs +++ b/distant-core/src/client/searcher.rs @@ -1,6 +1,6 @@ use std::{fmt, io}; -use distant_net::common::Request; +use distant_core_net::common::Request; use log::*; use tokio::sync::mpsc; use tokio::task::JoinHandle; @@ -193,8 +193,8 @@ mod tests { use std::path::PathBuf; use std::sync::Arc; - use distant_net::common::{FramedTransport, InmemoryTransport, Response}; - use distant_net::Client; + use distant_core_net::common::{FramedTransport, InmemoryTransport, Response}; + use distant_core_net::Client; use test_log::test; use tokio::sync::Mutex; diff --git a/distant-core/src/client/watcher.rs b/distant-core/src/client/watcher.rs index c7f63a9..f504f08 100644 --- a/distant-core/src/client/watcher.rs +++ b/distant-core/src/client/watcher.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; use std::{fmt, io}; -use distant_net::common::Request; +use distant_core_net::common::Request; use log::*; use tokio::sync::mpsc; use tokio::task::JoinHandle; @@ -181,8 +181,8 @@ impl Watcher { mod tests { use std::sync::Arc; - use distant_net::common::{FramedTransport, InmemoryTransport, Response}; - use distant_net::Client; + use distant_core_net::common::{FramedTransport, InmemoryTransport, Response}; + use distant_core_net::Client; use test_log::test; use tokio::sync::Mutex; diff --git a/distant-core/src/credentials.rs b/distant-core/src/credentials.rs index 272afcc..f64c6b0 100644 --- a/distant-core/src/credentials.rs +++ b/distant-core/src/credentials.rs @@ -2,7 +2,7 @@ use std::convert::TryFrom; use std::str::FromStr; use std::{fmt, io}; -use distant_net::common::{Destination, Host, SecretKey32}; +use distant_core_net::common::{Destination, Host, SecretKey32}; use serde::de::Deserializer; use serde::ser::Serializer; use serde::{Deserialize, Serialize}; diff --git a/distant-core/tests/api_tests.rs b/distant-core/tests/api_tests.rs index 7b81fdb..e086114 100644 --- a/distant-core/tests/api_tests.rs +++ b/distant-core/tests/api_tests.rs @@ -5,11 +5,11 @@ use async_trait::async_trait; use distant_core::{ DistantApi, DistantApiServerHandler, DistantChannelExt, DistantClient, DistantCtx, }; -use distant_net::auth::{DummyAuthHandler, Verifier}; -use distant_net::client::Client; -use distant_net::common::{InmemoryTransport, OneshotListener, Version}; -use distant_net::server::{Server, ServerRef}; -use distant_protocol::PROTOCOL_VERSION; +use distant_core_net::auth::{DummyAuthHandler, Verifier}; +use distant_core_net::client::Client; +use distant_core_net::common::{InmemoryTransport, OneshotListener, Version}; +use distant_core_net::server::{Server, ServerRef}; +use distant_core_protocol::PROTOCOL_VERSION; /// Stands up an inmemory client and server using the given api. async fn setup(api: impl DistantApi + Send + Sync + 'static) -> (DistantClient, ServerRef) { @@ -85,8 +85,8 @@ mod single { mod batch_parallel { use std::time::{Duration, SystemTime, UNIX_EPOCH}; - use distant_net::common::Request; - use distant_protocol::{Msg, Request as RequestPayload}; + use distant_core_net::common::Request; + use distant_core_protocol::{Msg, Request as RequestPayload}; use test_log::test; use super::*; @@ -128,7 +128,7 @@ mod batch_parallel { let mut times = Vec::new(); for payload in payloads { match payload { - distant_protocol::Response::Blob { data } => { + distant_core_protocol::Response::Blob { data } => { let mut buf = [0u8; 8]; buf.copy_from_slice(&data[..8]); times.push(u64::from_be_bytes(buf)); @@ -177,21 +177,21 @@ mod batch_parallel { // Should be a success, error, and success assert!( - matches!(payloads[0], distant_protocol::Response::Blob { .. }), + matches!(payloads[0], distant_core_protocol::Response::Blob { .. }), "Unexpected payloads[0]: {:?}", payloads[0] ); assert!( matches!( &payloads[1], - distant_protocol::Response::Error(distant_protocol::Error { kind, description }) - if matches!(kind, distant_protocol::ErrorKind::Other) && description == "test error" + distant_core_protocol::Response::Error(distant_core_protocol::Error { kind, description }) + if matches!(kind, distant_core_protocol::ErrorKind::Other) && description == "test error" ), "Unexpected payloads[1]: {:?}", payloads[1] ); assert!( - matches!(payloads[2], distant_protocol::Response::Blob { .. }), + matches!(payloads[2], distant_core_protocol::Response::Blob { .. }), "Unexpected payloads[2]: {:?}", payloads[2] ); @@ -201,8 +201,8 @@ mod batch_parallel { mod batch_sequence { use std::time::{Duration, SystemTime, UNIX_EPOCH}; - use distant_net::common::Request; - use distant_protocol::{Msg, Request as RequestPayload}; + use distant_core_net::common::Request; + use distant_core_protocol::{Msg, Request as RequestPayload}; use test_log::test; use super::*; @@ -247,7 +247,7 @@ mod batch_sequence { let mut times = Vec::new(); for payload in payloads { match payload { - distant_protocol::Response::Blob { data } => { + distant_core_protocol::Response::Blob { data } => { let mut buf = [0u8; 8]; buf.copy_from_slice(&data[..8]); times.push(u64::from_be_bytes(buf)); @@ -299,15 +299,15 @@ mod batch_sequence { // Should be a success, error, and interrupt assert!( - matches!(payloads[0], distant_protocol::Response::Blob { .. }), + matches!(payloads[0], distant_core_protocol::Response::Blob { .. }), "Unexpected payloads[0]: {:?}", payloads[0] ); assert!( matches!( &payloads[1], - distant_protocol::Response::Error(distant_protocol::Error { kind, description }) - if matches!(kind, distant_protocol::ErrorKind::Other) && description == "test error" + distant_core_protocol::Response::Error(distant_core_protocol::Error { kind, description }) + if matches!(kind, distant_core_protocol::ErrorKind::Other) && description == "test error" ), "Unexpected payloads[1]: {:?}", payloads[1] @@ -315,8 +315,8 @@ mod batch_sequence { assert!( matches!( &payloads[2], - distant_protocol::Response::Error(distant_protocol::Error { kind, .. }) - if matches!(kind, distant_protocol::ErrorKind::Interrupted) + distant_core_protocol::Response::Error(distant_core_protocol::Error { kind, .. }) + if matches!(kind, distant_core_protocol::ErrorKind::Interrupted) ), "Unexpected payloads[2]: {:?}", payloads[2] diff --git a/distant-local/Cargo.toml b/distant-plugin-local/Cargo.toml similarity index 85% rename from distant-local/Cargo.toml rename to distant-plugin-local/Cargo.toml index 50eea2a..c2d94b4 100644 --- a/distant-local/Cargo.toml +++ b/distant-plugin-local/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "distant-local" -description = "Library implementing distant API for local interactions" +name = "distant-plugin-local" +description = "Plugin library implementing distant API for local interactions" categories = ["network-programming"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" @@ -21,7 +21,7 @@ macos-kqueue = ["notify/macos_kqueue"] [dependencies] async-trait = "0.1.68" -distant-core = { version = "=0.20.0", path = "../distant-core" } +distant-core = { version = "=0.21.0", path = "../distant-core" } grep = "0.2.12" ignore = "0.4.20" log = "0.4.18" diff --git a/distant-local/README.md b/distant-plugin-local/README.md similarity index 100% rename from distant-local/README.md rename to distant-plugin-local/README.md diff --git a/distant-local/src/api.rs b/distant-plugin-local/src/api.rs similarity index 100% rename from distant-local/src/api.rs rename to distant-plugin-local/src/api.rs diff --git a/distant-local/src/api/process.rs b/distant-plugin-local/src/api/process.rs similarity index 100% rename from distant-local/src/api/process.rs rename to distant-plugin-local/src/api/process.rs diff --git a/distant-local/src/api/process/pty.rs b/distant-plugin-local/src/api/process/pty.rs similarity index 100% rename from distant-local/src/api/process/pty.rs rename to distant-plugin-local/src/api/process/pty.rs diff --git a/distant-local/src/api/process/simple.rs b/distant-plugin-local/src/api/process/simple.rs similarity index 100% rename from distant-local/src/api/process/simple.rs rename to distant-plugin-local/src/api/process/simple.rs diff --git a/distant-local/src/api/process/simple/tasks.rs b/distant-plugin-local/src/api/process/simple/tasks.rs similarity index 100% rename from distant-local/src/api/process/simple/tasks.rs rename to distant-plugin-local/src/api/process/simple/tasks.rs diff --git a/distant-local/src/api/process/wait.rs b/distant-plugin-local/src/api/process/wait.rs similarity index 100% rename from distant-local/src/api/process/wait.rs rename to distant-plugin-local/src/api/process/wait.rs diff --git a/distant-local/src/api/state.rs b/distant-plugin-local/src/api/state.rs similarity index 100% rename from distant-local/src/api/state.rs rename to distant-plugin-local/src/api/state.rs diff --git a/distant-local/src/api/state/process.rs b/distant-plugin-local/src/api/state/process.rs similarity index 100% rename from distant-local/src/api/state/process.rs rename to distant-plugin-local/src/api/state/process.rs diff --git a/distant-local/src/api/state/process/instance.rs b/distant-plugin-local/src/api/state/process/instance.rs similarity index 100% rename from distant-local/src/api/state/process/instance.rs rename to distant-plugin-local/src/api/state/process/instance.rs diff --git a/distant-local/src/api/state/search.rs b/distant-plugin-local/src/api/state/search.rs similarity index 100% rename from distant-local/src/api/state/search.rs rename to distant-plugin-local/src/api/state/search.rs diff --git a/distant-local/src/api/state/watcher.rs b/distant-plugin-local/src/api/state/watcher.rs similarity index 100% rename from distant-local/src/api/state/watcher.rs rename to distant-plugin-local/src/api/state/watcher.rs diff --git a/distant-local/src/api/state/watcher/path.rs b/distant-plugin-local/src/api/state/watcher/path.rs similarity index 100% rename from distant-local/src/api/state/watcher/path.rs rename to distant-plugin-local/src/api/state/watcher/path.rs diff --git a/distant-local/src/config.rs b/distant-plugin-local/src/config.rs similarity index 100% rename from distant-local/src/config.rs rename to distant-plugin-local/src/config.rs diff --git a/distant-local/src/constants.rs b/distant-plugin-local/src/constants.rs similarity index 100% rename from distant-local/src/constants.rs rename to distant-plugin-local/src/constants.rs diff --git a/distant-local/src/lib.rs b/distant-plugin-local/src/lib.rs similarity index 100% rename from distant-local/src/lib.rs rename to distant-plugin-local/src/lib.rs diff --git a/distant-local/tests/stress/distant/large_file.rs b/distant-plugin-local/tests/stress/distant/large_file.rs similarity index 100% rename from distant-local/tests/stress/distant/large_file.rs rename to distant-plugin-local/tests/stress/distant/large_file.rs diff --git a/distant-local/tests/stress/distant/mod.rs b/distant-plugin-local/tests/stress/distant/mod.rs similarity index 100% rename from distant-local/tests/stress/distant/mod.rs rename to distant-plugin-local/tests/stress/distant/mod.rs diff --git a/distant-local/tests/stress/distant/watch.rs b/distant-plugin-local/tests/stress/distant/watch.rs similarity index 100% rename from distant-local/tests/stress/distant/watch.rs rename to distant-plugin-local/tests/stress/distant/watch.rs diff --git a/distant-local/tests/stress/fixtures.rs b/distant-plugin-local/tests/stress/fixtures.rs similarity index 98% rename from distant-local/tests/stress/fixtures.rs rename to distant-plugin-local/tests/stress/fixtures.rs index 2bd1672..05800eb 100644 --- a/distant-local/tests/stress/fixtures.rs +++ b/distant-plugin-local/tests/stress/fixtures.rs @@ -6,7 +6,7 @@ use distant_core::net::client::{Client, TcpConnector}; use distant_core::net::common::PortRange; use distant_core::net::server::Server; use distant_core::{DistantApiServerHandler, DistantClient}; -use distant_local::Api; +use distant_plugin_local::Api; use rstest::*; use tokio::sync::mpsc; diff --git a/distant-local/tests/stress/mod.rs b/distant-plugin-local/tests/stress/mod.rs similarity index 100% rename from distant-local/tests/stress/mod.rs rename to distant-plugin-local/tests/stress/mod.rs diff --git a/distant-local/tests/stress_tests.rs b/distant-plugin-local/tests/stress_tests.rs similarity index 100% rename from distant-local/tests/stress_tests.rs rename to distant-plugin-local/tests/stress_tests.rs diff --git a/distant-ssh2/Cargo.toml b/distant-plugin-ssh/Cargo.toml similarity index 84% rename from distant-ssh2/Cargo.toml rename to distant-plugin-ssh/Cargo.toml index e0b9f31..d26fea8 100644 --- a/distant-ssh2/Cargo.toml +++ b/distant-plugin-ssh/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "distant-ssh2" -description = "Library to enable native ssh-2 protocol for use with distant sessions" +name = "distant-plugin-ssh" +description = "Plugin library to enable native ssh-2 protocol for use with distant sessions" categories = ["network-programming"] -version = "0.20.0" +version = "0.21.0" authors = ["Chip Senkbeil "] edition = "2021" homepage = "https://github.com/chipsenkbeil/distant" @@ -20,7 +20,7 @@ vendored-openssl = ["russh/vendored-openssl"] async-once-cell = "0.5.2" async-trait = "0.1.68" derive_more = { version = "0.99.17", default-features = false, features = ["display", "error"] } -distant-core = { version = "=0.20.0", path = "../distant-core" } +distant-core = { version = "=0.21.0", path = "../distant-core" } futures = "0.3.28" hex = "0.4.3" log = "0.4.18" @@ -32,7 +32,7 @@ russh-keys = "0.38.0" russh-sftp = "2.0.0-beta.2" shell-words = "1.1.0" tokio = { version = "1.28.2", features = ["full"] } -typed-path = "0.3.2" +typed-path = "0.6.0" winsplit = "0.1.0" # Optional serde support for data structures diff --git a/distant-ssh2/README.md b/distant-plugin-ssh/README.md similarity index 100% rename from distant-ssh2/README.md rename to distant-plugin-ssh/README.md diff --git a/distant-ssh2/src/api.rs b/distant-plugin-ssh/src/api.rs similarity index 100% rename from distant-ssh2/src/api.rs rename to distant-plugin-ssh/src/api.rs diff --git a/distant-ssh2/src/lib.rs b/distant-plugin-ssh/src/lib.rs similarity index 100% rename from distant-ssh2/src/lib.rs rename to distant-plugin-ssh/src/lib.rs diff --git a/distant-ssh2/src/process.rs b/distant-plugin-ssh/src/process.rs similarity index 100% rename from distant-ssh2/src/process.rs rename to distant-plugin-ssh/src/process.rs diff --git a/distant-ssh2/src/utils.rs b/distant-plugin-ssh/src/utils.rs similarity index 100% rename from distant-ssh2/src/utils.rs rename to distant-plugin-ssh/src/utils.rs diff --git a/distant-ssh2/tests/lib.rs b/distant-plugin-ssh/tests/lib.rs similarity index 100% rename from distant-ssh2/tests/lib.rs rename to distant-plugin-ssh/tests/lib.rs diff --git a/distant-ssh2/tests/ssh2/client.rs b/distant-plugin-ssh/tests/ssh2/client.rs similarity index 100% rename from distant-ssh2/tests/ssh2/client.rs rename to distant-plugin-ssh/tests/ssh2/client.rs diff --git a/distant-ssh2/tests/ssh2/mod.rs b/distant-plugin-ssh/tests/ssh2/mod.rs similarity index 100% rename from distant-ssh2/tests/ssh2/mod.rs rename to distant-plugin-ssh/tests/ssh2/mod.rs diff --git a/distant-ssh2/tests/ssh2/ssh.rs b/distant-plugin-ssh/tests/ssh2/ssh.rs similarity index 93% rename from distant-ssh2/tests/ssh2/ssh.rs rename to distant-plugin-ssh/tests/ssh2/ssh.rs index 8cf8084..9f44263 100644 --- a/distant-ssh2/tests/ssh2/ssh.rs +++ b/distant-plugin-ssh/tests/ssh2/ssh.rs @@ -1,4 +1,4 @@ -use distant_ssh2::{Ssh, SshFamily}; +use distant_plugin_ssh::{Ssh, SshFamily}; use rstest::*; use test_log::test; diff --git a/distant-ssh2/tests/sshd/mod.rs b/distant-plugin-ssh/tests/sshd/mod.rs similarity index 99% rename from distant-ssh2/tests/sshd/mod.rs rename to distant-plugin-ssh/tests/sshd/mod.rs index 8af9abe..b16087e 100644 --- a/distant-ssh2/tests/sshd/mod.rs +++ b/distant-plugin-ssh/tests/sshd/mod.rs @@ -15,7 +15,7 @@ use assert_fs::TempDir; use async_trait::async_trait; use derive_more::{Deref, DerefMut, Display}; use distant_core::DistantClient; -use distant_ssh2::{Ssh, SshAuthEvent, SshAuthHandler, SshOpts}; +use distant_plugin_ssh::{Ssh, SshAuthEvent, SshAuthHandler, SshOpts}; use log::*; use once_cell::sync::Lazy; use rstest::*; diff --git a/distant-ssh2/tests/utils/mod.rs b/distant-plugin-ssh/tests/utils/mod.rs similarity index 100% rename from distant-ssh2/tests/utils/mod.rs rename to distant-plugin-ssh/tests/utils/mod.rs diff --git a/src/cli/commands/manager/handlers.rs b/src/cli/commands/manager/handlers.rs index 8186312..df10f0f 100644 --- a/src/cli/commands/manager/handlers.rs +++ b/src/cli/commands/manager/handlers.rs @@ -235,7 +235,7 @@ impl LaunchHandler for SshLaunchHandler { debug!("Handling launch of {destination} with options '{options}'"); let config = ClientLaunchConfig::from(options.clone()); - use distant_ssh2::DistantLaunchOpts; + use distant_plugin_ssh::DistantLaunchOpts; let mut ssh = load_ssh(destination, options)?; let handler = AuthClientSshAuthHandler::new(authenticator); let _ = ssh.authenticate(handler).await?; @@ -390,8 +390,8 @@ impl<'a> AuthClientSshAuthHandler<'a> { #[cfg(any(feature = "libssh", feature = "ssh2"))] #[async_trait] -impl<'a> distant_ssh2::SshAuthHandler for AuthClientSshAuthHandler<'a> { - async fn on_authenticate(&self, event: distant_ssh2::SshAuthEvent) -> io::Result> { +impl<'a> distant_plugin_ssh::SshAuthHandler for AuthClientSshAuthHandler<'a> { + async fn on_authenticate(&self, event: distant_plugin_ssh::SshAuthEvent) -> io::Result> { use std::collections::HashMap; let mut options = HashMap::new(); let mut questions = Vec::new(); @@ -462,9 +462,9 @@ impl<'a> distant_ssh2::SshAuthHandler for AuthClientSshAuthHandler<'a> { } #[cfg(any(feature = "libssh", feature = "ssh2"))] -fn load_ssh(destination: &Destination, options: &Map) -> io::Result { +fn load_ssh(destination: &Destination, options: &Map) -> io::Result { trace!("load_ssh({destination}, {options})"); - use distant_ssh2::{Ssh, SshOpts}; + use distant_plugin_ssh::{Ssh, SshOpts}; let host = destination.host.to_string(); diff --git a/src/cli/commands/server.rs b/src/cli/commands/server.rs index d3d3740..9171782 100644 --- a/src/cli/commands/server.rs +++ b/src/cli/commands/server.rs @@ -6,7 +6,7 @@ use distant_core::net::common::{Host, SecretKey32, Version}; use distant_core::net::server::{Server, ServerConfig as NetServerConfig}; use distant_core::protocol::PROTOCOL_VERSION; use distant_core::DistantSingleKeyCredentials; -use distant_local::{Config as LocalConfig, WatchConfig as LocalWatchConfig}; +use distant_plugin_local::{Config as LocalConfig, WatchConfig as LocalWatchConfig}; use log::*; use crate::options::ServerSubcommand; @@ -143,7 +143,7 @@ async fn async_run(cmd: ServerSubcommand, _is_forked: bool) -> CliResult { "using an ephemeral port".to_string() } ); - let handler = distant_local::new_handler(LocalConfig { + let handler = distant_plugin_local::new_handler(LocalConfig { watch: LocalWatchConfig { native: !watch.watch_polling, poll_interval: watch.watch_poll_interval.map(Into::into),