From 4568c9b390e4312de0a8855cd2e8e2439a4bbdd0 Mon Sep 17 00:00:00 2001 From: Lennon Day-Reynolds Date: Mon, 14 Oct 2024 09:30:07 -0700 Subject: [PATCH] WIP: Update/clean up dependencies, move API crates into repo, replace Docker w/Nix This does a number of things which _could_ be separated, so I consider this more or less experimental. Implied in the removal of the various dockerfiles is the expectation that production deployments of ZeroNSD will simply use a Docker container, rather than distro-native packages. TODO: automate publishing of containers from Nix-generated image --- .dockerignore | 2 + .gitignore | 6 +- Cargo.lock | 1710 +++++++++++-------- Cargo.toml | 80 +- Dockerfile | 20 - Dockerfile.alpine | 32 - Dockerfile.packages | 8 - Dockerfile.ubi | 7 - Dockerfile.ubuntu | 10 - Makefile | 77 - cargo-docker.sh | 12 - central-api/Cargo.toml | 11 + central-api/openapi.json | 1912 ++++++++++++++++++++++ central-api/src/lib.rs | 3 + example.conf.yaml => config.yaml.example | 2 +- flake.lock | 82 + flake.nix | 81 + generate.sh | 25 - justfile | 22 + scripts/update-openapi.sh | 22 + service-api/Cargo.toml | 11 + service-api/openapi.json | 1035 ++++++++++++ service-api/src/lib.rs | 3 + tests/Cargo.toml | 29 + tests/integration.rs | 7 +- tests/service/context.rs | 2 +- tests/service/member.rs | 2 + tests/service/network.rs | 49 +- tests/service/utils.rs | 13 +- wix/main.wxs | 231 --- zeronsd/Cargo.toml | 84 + {src => zeronsd/src}/addresses.rs | 0 {src => zeronsd/src}/authority.rs | 1 - {src => zeronsd/src}/bin/zeronsd.rs | 0 {src => zeronsd/src}/cli.rs | 5 +- {src => zeronsd/src}/hosts.rs | 0 {src => zeronsd/src}/init.rs | 20 +- {src => zeronsd/src}/lib.rs | 0 {src => zeronsd/src}/log.rs | 0 {src => zeronsd/src}/server.rs | 0 {src => zeronsd/src}/supervise.rs | 0 {src => zeronsd/src}/tests.rs | 9 +- {src => zeronsd/src}/traits.rs | 1 + {src => zeronsd/src}/utils.rs | 15 +- 44 files changed, 4430 insertions(+), 1211 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Dockerfile.alpine delete mode 100644 Dockerfile.packages delete mode 100644 Dockerfile.ubi delete mode 100644 Dockerfile.ubuntu delete mode 100644 Makefile delete mode 100644 cargo-docker.sh create mode 100644 central-api/Cargo.toml create mode 100644 central-api/openapi.json create mode 100644 central-api/src/lib.rs rename example.conf.yaml => config.yaml.example (95%) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 generate.sh create mode 100644 justfile create mode 100755 scripts/update-openapi.sh create mode 100644 service-api/Cargo.toml create mode 100644 service-api/openapi.json create mode 100644 service-api/src/lib.rs create mode 100644 tests/Cargo.toml delete mode 100644 wix/main.wxs create mode 100644 zeronsd/Cargo.toml rename {src => zeronsd/src}/addresses.rs (100%) rename {src => zeronsd/src}/authority.rs (99%) rename {src => zeronsd/src}/bin/zeronsd.rs (100%) rename {src => zeronsd/src}/cli.rs (97%) rename {src => zeronsd/src}/hosts.rs (100%) rename {src => zeronsd/src}/init.rs (93%) rename {src => zeronsd/src}/lib.rs (100%) rename {src => zeronsd/src}/log.rs (100%) rename {src => zeronsd/src}/server.rs (100%) rename {src => zeronsd/src}/supervise.rs (100%) rename {src => zeronsd/src}/tests.rs (97%) rename {src => zeronsd/src}/traits.rs (99%) rename {src => zeronsd/src}/utils.rs (94%) diff --git a/.dockerignore b/.dockerignore index 4c4c3b8..c2d6092 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,6 @@ target +result +.direnv .git test-token.txt .token diff --git a/.gitignore b/.gitignore index 7b1f16a..59322ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target -.token +/result +*.token test-token.txt /test.yaml /windows.yaml @@ -8,3 +9,6 @@ test-token.txt /*.key /*.csr /*.srl +.env* +config.yaml +.direnv diff --git a/Cargo.lock b/Cargo.lock index 4b941dd..42e85db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,62 +3,107 @@ version = 3 [[package]] -name = "aho-corasick" -version = "0.7.18" +name = "addr2line" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "memchr", + "gimli", ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "winapi", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "async-trait" -version = "0.1.53" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -66,23 +111,38 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.0.73" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "58e804ac3194a48bb129643eb1d62fcc20d18c6b8c181704489353d13120bcd1" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -92,30 +152,25 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "libc", - "num-integer", "num-traits", - "serde", - "time 0.1.43", - "winapi", ] [[package]] name = "clap" -version = "3.1.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", - "indexmap", - "lazy_static", + "indexmap 1.9.3", + "once_cell", "strsim", "termcolor", "textwrap", @@ -123,31 +178,31 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ "os_str_bytes", ] [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -155,37 +210,46 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "ctor" -version = "0.1.22" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "deranged" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "dyn-clone" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -198,37 +262,37 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "env_logger" -version = "0.9.0" +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", + "libc", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "1.7.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fnv" @@ -253,19 +317,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "futures" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -278,9 +341,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -288,15 +351,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -305,38 +368,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -350,56 +413,75 @@ dependencies = [ "slab", ] -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width", -] - [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "h2" -version = "0.3.13" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", - "indexmap", + "indexmap 2.6.0", "slab", "tokio", - "tokio-util 0.7.1", + "tokio-util", "tracing", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -411,19 +493,16 @@ dependencies = [ ] [[package]] -name = "hex" -version = "0.4.3" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] -name = "home" -version = "0.5.3" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" -dependencies = [ - "winapi", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hostname" @@ -438,9 +517,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.7" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -449,68 +528,103 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", - "pin-project-lite", ] [[package]] -name = "httparse" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" - -[[package]] -name = "httpdate" -version = "1.0.2" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] [[package]] -name = "humantime" -version = "2.1.0" +name = "httparse" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "0.14.18" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -524,91 +638,118 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", - "serde", + "hashbrown 0.12.3", ] [[package]] -name = "instant" -version = "0.1.12" +name = "indexmap" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "cfg-if", + "equivalent", + "hashbrown 0.15.0", + "serde", ] [[package]] name = "ipconfig" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ "socket2", "widestring", - "winapi", - "winreg 0.7.0", + "windows-sys 0.48.0", + "winreg", ] [[package]] name = "ipnet" -version = "2.5.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "ipnetwork" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f84f1612606f3753f205a4e9a2efd6fe5b4c573a6269b2cc6c3003d44a0d127" +checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" dependencies = [ "serde", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libyml" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3302702afa434ffa30847a83305f0a69d6abd74293b6554c18ec85c7ef30c980" +dependencies = [ + "anyhow", + "version_check", +] [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -616,12 +757,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru-cache" @@ -638,52 +776,51 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] [[package]] name = "mio" -version = "0.8.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "wasi", + "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -705,67 +842,63 @@ dependencies = [ ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "autocfg", - "num-traits", + "overload", + "winapi", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "num_cpus" -version = "1.13.1" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "hermit-abi", - "libc", + "autocfg", ] [[package]] -name = "num_threads" -version = "0.1.6" +name = "object" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ - "libc", + "memchr", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openapiv3" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b4689110fd71f196934fbdf1ad0f0a4b49ea41fbc6f19008c00dba735b544c" +checksum = "cc02deea53ffe807708244e5914f6b099ad7015a207ee24317c22112e17d9c5c" dependencies = [ - "indexmap", + "indexmap 2.6.0", "serde", "serde_json", ] [[package]] name = "openssl" -version = "0.10.40" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -776,13 +909,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -793,20 +926,19 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.18.0+1.1.1n" +version = "300.3.2+3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7897a926e1e8d00219127dc020130eca4292e5ca666dd592480d72c3eca2ff6c" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.73" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ - "autocfg", "cc", "libc", "openssl-src", @@ -816,15 +948,21 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -832,37 +970,28 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-targets 0.52.6", ] [[package]] name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pest" -version = "2.1.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -872,15 +1001,24 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-error" @@ -891,7 +1029,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -908,34 +1046,29 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "progenitor" -version = "0.1.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54484468975e18aa57ed3e9a13ac0468160a433af89eee1189f681292eafc5d1" +checksum = "293df5b79211fbf0c1ebad6513ba451d267e9c15f5f19ee5d3da775e2dd27331" dependencies = [ - "anyhow", - "getopts", - "openapiv3", - "progenitor-client 0.1.1", + "progenitor-client", "progenitor-impl", "progenitor-macro", - "serde", - "serde_json", ] [[package]] name = "progenitor-client" -version = "0.1.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c7752120152426ce577c3de6b341fecdaae59883f31296d91871a6d7843206" +checksum = "d4a5db54eac3cae7007a0785854bc3e89fd418cca7dfc2207b99b43979154c1b" dependencies = [ "bytes", "futures-core", @@ -943,60 +1076,47 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serde_urlencoded", ] [[package]] -name = "progenitor-client" -version = "0.2.0" +name = "progenitor-impl" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35d9984d7780038d818076aa8e921cae41a605cf95a31ab5c1581ca95bdcfd9e" +checksum = "d85934a440963a69f9f04f48507ff6e7aa2952a5b2d8f96cc37fa3dd5c270f66" dependencies = [ - "bytes", - "futures-core", - "percent-encoding", - "reqwest", - "serde", - "serde_json", - "serde_urlencoded", -] - -[[package]] -name = "progenitor-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1980a31d714128082fe8dd6a7cb6086c15080cdb9a693feba171361fb961b034" -dependencies = [ - "getopts", - "heck", - "indexmap", + "heck 0.5.0", + "http", + "indexmap 2.6.0", "openapiv3", "proc-macro2", "quote", "regex", - "rustfmt-wrapper", "schemars", "serde", "serde_json", - "syn", + "syn 2.0.79", "thiserror", "typify", - "unicode-xid", + "unicode-ident", ] [[package]] name = "progenitor-macro" -version = "0.1.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0993b8f5bbcf35ec130f9d305cefbbd81f00c014c049bf298bd218529989b054" +checksum = "d99a5a259e2d65a4933054aa51717c70b6aba0522695731ac354a522124efc9b" dependencies = [ "openapiv3", "proc-macro2", "progenitor-impl", "quote", + "schemars", "serde", "serde_json", "serde_tokenstream", - "syn", + "serde_yaml", + "syn 2.0.79", ] [[package]] @@ -1007,9 +1127,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.18" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1047,62 +1167,66 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", + "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regress" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "1541daf4e4ed43a0922b7969bdc2170178bcacc5dabf7e39bc508a9fa3953a7a" dependencies = [ - "winapi", + "hashbrown 0.14.5", + "memchr", ] [[package]] name = "reqwest" -version = "0.11.10" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", @@ -1112,27 +1236,35 @@ dependencies = [ "h2", "http", "http-body", + "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", - "lazy_static", "log", "mime", "native-tls", + "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", - "tokio-util 0.6.9", + "tokio-util", + "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", - "winreg 0.10.1", + "windows-registry", ] [[package]] @@ -1146,46 +1278,98 @@ dependencies = [ ] [[package]] -name = "rustfmt-wrapper" -version = "0.1.0" +name = "ring" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7733577fb5b13c8b256232e7ca84aa424f915efae6ec980082d60a03f99da3f8" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ - "tempfile", - "thiserror", - "toolchain_find", + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] -name = "ryu" -version = "1.0.9" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "same-file" -version = "1.0.6" +name = "rustix" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "winapi-util", + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.23.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "lazy_static", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "schemars" -version = "0.8.8" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "chrono", "dyn-clone", @@ -1197,29 +1381,29 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.8" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.79", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.6.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1228,9 +1412,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -1238,73 +1422,75 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", + "serde", ] [[package]] name = "serde" -version = "1.0.137" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_tokenstream" -version = "0.1.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6deb15c3a535e81438110111d90168d91721652f502abb147f31cde129f683d" +checksum = "64060d864397305347a78851c51588fd283767e7e7589829e8121d65512340f1" dependencies = [ "proc-macro2", + "quote", "serde", - "syn", + "syn 2.0.79", ] [[package]] @@ -1321,150 +1507,227 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.24" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.6.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "serde_yml" +version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707d15895415db6628332b737c838b88c598522e4dc70647e59b72312924aebc" +checksum = "59e2dd588bf1597a252c3b920e0143eb99b0f76e4e082f4c92ce34fbc9e71ddd" dependencies = [ - "indexmap", + "indexmap 2.6.0", + "itoa", + "libyml", + "memchr", "ryu", "serde", - "yaml-rust", + "version_check", ] [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" -version = "1.0.94" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] name = "tempfile" -version = "3.3.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" -version = "0.15.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.1.43" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "libc", - "winapi", + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", ] [[package]] -name = "time" -version = "0.3.9" +name = "time-core" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" -dependencies = [ - "libc", - "num_threads", -] +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "tinytemplate" @@ -1478,55 +1741,53 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.18.2" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ + "backtrace", "bytes", "libc", - "memchr", "mio", - "num_cpus", - "once_cell", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "1.7.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -1534,79 +1795,94 @@ dependencies = [ [[package]] name = "tokio-openssl" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a" +checksum = "59df6849caa43bb7567f9a36f863c447d95a11d5903c9cc334ba32576a27eadd" dependencies = [ - "futures-util", "openssl", "openssl-sys", "tokio", ] [[package]] -name = "tokio-util" -version = "0.6.9" +name = "tokio-rustls" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", + "rustls", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] -name = "toolchain_find" -version = "0.2.0" +name = "toml" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e85654a10e7a07a47c6f19d93818f3f343e22927f2fa280c84f7c8042743413" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ - "home", - "lazy_static", - "regex", - "semver", - "walkdir", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.6.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1614,94 +1890,76 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.21" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "lazy_static", + "once_cell", "valuable", ] [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers", - "regex", - "serde", - "serde_json", + "nu-ansi-term", "sharded-slab", "smallvec", "thread_local", - "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] name = "trust-dns-client" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6d9ba1c6079f6f9b4664e482db1700bd53d2ee77b1c9752c1d7a66c0c8bda99" +checksum = "6c408c32e6a9dbb38037cece35740f2cf23c875d8ca134d33631cec83f74d3fe" dependencies = [ "cfg-if", "data-encoding", "futures-channel", "futures-util", "lazy_static", - "log", "openssl", "radix_trie", "rand", "thiserror", - "time 0.3.9", + "time", "tokio", + "tracing", "trust-dns-proto", ] [[package]] name = "trust-dns-proto" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", "cfg-if", @@ -1710,10 +1968,9 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.2.3", "ipnet", "lazy_static", - "log", "openssl", "rand", "serde", @@ -1722,20 +1979,20 @@ dependencies = [ "tinyvec", "tokio", "tokio-openssl", + "tracing", "url", ] [[package]] name = "trust-dns-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ "cfg-if", "futures-util", "ipconfig", "lazy_static", - "log", "lru-cache", "parking_lot", "resolv-conf", @@ -1744,30 +2001,30 @@ dependencies = [ "thiserror", "tokio", "tokio-openssl", + "tracing", "trust-dns-proto", ] [[package]] name = "trust-dns-server" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a395a2e0fd8aac9b4613767a5b4ba4b2040de1b767fa03ace8c9d6f351d60b2d" +checksum = "99022f9befa6daec2a860be68ac28b1f0d9d7ccf441d8c5a695e35a58d88840d" dependencies = [ "async-trait", "bytes", "cfg-if", "enum-as-inner", - "env_logger", "futures-executor", "futures-util", - "log", "openssl", "serde", "thiserror", - "time 0.3.9", + "time", "tokio", "tokio-openssl", - "toml", + "toml 0.5.11", + "tracing", "trust-dns-client", "trust-dns-proto", "trust-dns-resolver", @@ -1775,15 +2032,15 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typify" -version = "0.0.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75e642ba5bfa5a7b2e085a700f5f5111b069a833156f82c53a365210e545258d" +checksum = "b4c644dda9862f0fef3a570d8ddb3c2cfb1d5ac824a1f2ddfa7bc8f071a5ad8a" dependencies = [ "typify-impl", "typify-macro", @@ -1791,93 +2048,91 @@ dependencies = [ [[package]] name = "typify-impl" -version = "0.0.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b1b5a377f1e0dceb8a18b25c86c80b32d0882b01e1585fd520354a56b7c30c" +checksum = "d59ab345b6c0d8ae9500b9ff334a4c7c0d316c1c628dc55726b95887eb8dbd11" dependencies = [ - "heck", + "heck 0.5.0", "log", "proc-macro2", "quote", - "rustfmt-wrapper", + "regress", "schemars", + "semver", + "serde", "serde_json", - "syn", + "syn 2.0.79", "thiserror", - "unicode-xid", + "unicode-ident", ] [[package]] name = "typify-macro" -version = "0.0.6" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cad3517ce4190a7f108cd6360da245c7e289060003d077156f2da7dcf1f568" +checksum = "785e2cdcef0df8160fdd762ed548a637aaec1e83704fdbc14da0df66013ee8d0" dependencies = [ "proc-macro2", "quote", "schemars", + "semver", "serde", "serde_json", "serde_tokenstream", - "syn", + "syn 2.0.79", "typify-impl", ] [[package]] -name = "ucd-trie" -version = "0.1.3" +name = "unicode-bidi" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] -name = "unicode-bidi" -version = "0.3.8" +name = "unicode-ident" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] -name = "unicode-width" -version = "0.1.9" +name = "unsafe-libyaml" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] -name = "unicode-xid" -version = "0.2.3" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.2.2" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna", - "matches", + "idna 0.5.0", "percent-encoding", "serde", ] [[package]] name = "uuid" -version = "0.8.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde", -] +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "valuable" @@ -1893,37 +2148,19 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.3.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1932,34 +2169,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -1969,9 +2207,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1979,28 +2217,41 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" + +[[package]] +name = "wasm-streams" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -2008,9 +2259,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -2030,11 +2281,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -2043,79 +2294,233 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "winreg" -version = "0.7.0" +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ - "winapi", + "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "linked-hash-map", + "byteorder", + "zerocopy-derive", ] +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + [[package]] name = "zeronsd" -version = "0.5.2" +version = "0.6.0-pre1" dependencies = [ "anyhow", "async-trait", @@ -2130,49 +2535,58 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_yaml", + "serde_yml", "tinytemplate", "tokio", - "toml", + "toml 0.7.8", "tracing", "tracing-log", "tracing-subscriber", + "trust-dns-client", + "trust-dns-proto", "trust-dns-resolver", "trust-dns-server", "zerotier-central-api", - "zerotier-one-api", + "zerotier-service-api", ] [[package]] -name = "zerotier-central-api" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcbbc3ebfe848d2305d8f4bec2ae68d81bcdde1d9ff2f14e7957e8608a9a0c7" +name = "zeronsd-integration-tests" +version = "0.1.0" dependencies = [ "anyhow", - "chrono", + "async-trait", + "ctor", + "ipnetwork", + "rand", + "serde", + "serde_json", + "tokio", + "tracing", + "trust-dns-resolver", + "zeronsd", + "zerotier-central-api", + "zerotier-service-api", +] + +[[package]] +name = "zerotier-central-api" +version = "1.3.0" +dependencies = [ "futures", "progenitor", - "progenitor-client 0.2.0", "reqwest", "serde", "serde_json", - "uuid", ] [[package]] -name = "zerotier-one-api" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df22f59fd0537dc76b31474d1b2af45f0a8fafa1b7edaa0f2127c2688bfb1795" +name = "zerotier-service-api" +version = "1.3.0" dependencies = [ - "anyhow", - "chrono", "futures", "progenitor", - "progenitor-client 0.2.0", "reqwest", "serde", "serde_json", - "uuid", ] diff --git a/Cargo.toml b/Cargo.toml index 7c3fb28..924f088 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,78 +1,4 @@ -[package] -name = "zeronsd" -version = "0.5.2" -authors = ["Erik Hollensbe ", "Adam Ierymenko "] -description = "Unicast DNS resolver for ZeroTier networks" -homepage = "https://github.com/zerotier/zeronsd" -repository = "https://github.com/zerotier/zeronsd" -documentation = "https://github.com/zerotier/zeronsd/blob/main/README.md" -license = "BSD-3-Clause" -readme = "README.md" -keywords = ["dns", "zerotier"] -edition = "2021" +[workspace] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -regex = ">=0" -anyhow = ">=0" -clap = { version = "^3", features = ["derive"] } -ipnetwork = ">=0" -trust-dns-resolver = { version = "^0.21.0", features = ["tokio-runtime", "dns-over-openssl"] } -trust-dns-server = { version = "^0.21.0", features = ["trust-dns-resolver", "dns-over-openssl"] } -tokio = { version = "1", features = ["full"] } -serde = ">=0" -serde_json = ">=0" -serde_yaml = ">=0" -zerotier-central-api = "=1.2.1" -zerotier-one-api = "=1.2.1" -toml = ">=0" -tinytemplate = ">=0" -rand = ">=0" -tracing = "0.1" -tracing-log = "0.1" -tracing-subscriber = "0.2" -hex = ">=0" -openssl = ">=0" -async-trait = ">=0" -lazy_static = ">=0" -reqwest = ">=0" - -[features] -vendored-openssl = [ "openssl/vendored" ] - -[dev-dependencies] -ctor = ">=0" - -[package.metadata.deb.variants.ubuntu22] -features = [ "vendored-openssl" ] - -[package.metadata.deb] -copyright = "ZeroTier, Inc" - -extended-description = """ -ZeroNS provides names that are a part of ZeroTier Central's -(https://my.zerotier.com) configured networks; once provided a network it: - -- Listens on the local interface joined to that network -- you will want to - start one ZeroNS per ZeroTier network. -- Provides general DNS by forwarding all queries to `/etc/resolv.conf` - resolvers that do not match the TLD, similar to `dnsmasq`. -- Tells Central to point all clients that have the "Manage DNS" settings turned - **on** to resolve to it. -- Finally, sets a provided TLD (`.home.arpa` is the default), as well as - configuring `A` (IPv4) and `AAAA` (IPv6) records for: - - Member IDs: `zt-.` will resolve to the IPv4/v6 addresses for - them. - - Names: _if_ the names are compatible with DNS names, they will be converted - as such: to `.`. - - Please note that **collisions are possible** and that it's _up to the - admin to prevent them_. -""" - -[package.metadata.generate-rpm] -assets = [ { source = "target/release/zeronsd", dest = "/usr/bin/zeronsd", mode = "755" } ] -features = [ "vendored-openssl" ] - -[target.'cfg(windows)'.dependencies] -openssl = { version = ">=0", features = [ "vendored" ] } +resolver = "2" +members = ["zeronsd", "central-api", "service-api", "tests"] diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index da49003..0000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM debian:latest as rustenv - -ARG IS_LOCAL=0 -ARG VERSION=main -ARG IS_TAG=0 - -COPY . /code -WORKDIR /code -RUN apt-get update -qq && apt-get install curl pkg-config build-essential libssl-dev ca-certificates -y && apt-get autoclean -y && apt-get clean -y -RUN curl -sSL sh.rustup.rs >/usr/local/bin/rustup-dl && chmod +x /usr/local/bin/rustup-dl && /usr/local/bin/rustup-dl -y --default-toolchain stable - -FROM rustenv as buildenv - -RUN sh cargo-docker.sh - -FROM debian:latest -RUN apt-get update -qq && apt-get install ca-certificates -y && apt-get autoclean -y && apt-get clean -y -COPY --from=buildenv /root/.cargo/bin/zeronsd /usr/bin/zeronsd - -ENTRYPOINT ["/usr/bin/zeronsd"] diff --git a/Dockerfile.alpine b/Dockerfile.alpine deleted file mode 100644 index 5262aab..0000000 --- a/Dockerfile.alpine +++ /dev/null @@ -1,32 +0,0 @@ -# to run: -# -# docker run --net host -it \ -# -v /var/lib/zerotier-one/authtoken.secret:/authtoken.secret \ -# -v :/token.txt \ -# zeronsd:alpine start -s /authtoken.secret -t /token.txt \ -# - -FROM alpine:latest as builder - -RUN apk add gcc -RUN apk add libgcc -RUN apk add musl-dev -RUN apk add openssl -RUN apk add openssl-dev -RUN apk add curl - -RUN curl -sSL sh.rustup.rs >/usr/local/bin/rustup-dl && chmod +x /usr/local/bin/rustup-dl && /usr/local/bin/rustup-dl -y --default-toolchain stable - -COPY . /zeronsd -WORKDIR /zeronsd - -ENV PATH=/root/.cargo/bin:${PATH} -RUN . /root/.cargo/env && cargo install --path . - -FROM alpine:latest - -RUN apk add openssl ca-certificates libgcc - -COPY --from=builder /root/.cargo/bin/zeronsd /bin/zeronsd - -ENTRYPOINT ["zeronsd"] diff --git a/Dockerfile.packages b/Dockerfile.packages deleted file mode 100644 index 6dad9cb..0000000 --- a/Dockerfile.packages +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:latest as rustenv - -RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install curl pkg-config build-essential ca-certificates libc6-dev -y && apt-get autoclean -y && apt-get clean -y -RUN curl -sSL sh.rustup.rs >/usr/local/bin/rustup-dl && chmod +x /usr/local/bin/rustup-dl && /usr/local/bin/rustup-dl -y --default-toolchain stable - -FROM rustenv as buildenv - -RUN . /root/.cargo/env && cargo install cargo-deb diff --git a/Dockerfile.ubi b/Dockerfile.ubi deleted file mode 100644 index 568d84a..0000000 --- a/Dockerfile.ubi +++ /dev/null @@ -1,7 +0,0 @@ -# vim: ft=dockerfile -FROM redhat/ubi8 - -RUN dnf install openssl-devel gcc -y -RUN curl -sSL sh.rustup.rs >/tmp/rustup.sh && bash /tmp/rustup.sh -y -ENV PATH=${PATH}:${HOME}/.cargo/bin -RUN . /root/.cargo/env && cargo install cargo-generate-rpm diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu deleted file mode 100644 index c05da58..0000000 --- a/Dockerfile.ubuntu +++ /dev/null @@ -1,10 +0,0 @@ -# vim: ft=dockerfile -FROM ubuntu:jammy - -# this is pretty broken, but is the current state of things I guess? -RUN apt-get update -qq && apt-get install curl build-essential pkg-config libssl3 libssl-dev -y -RUN mkdir -p /root -ENV HOME=/root -RUN curl -sSL sh.rustup.rs >/tmp/rustup.sh && bash /tmp/rustup.sh -y -ENV PATH=${PATH}:${HOME}/.cargo/bin -RUN cargo install cargo-deb diff --git a/Makefile b/Makefile deleted file mode 100644 index a3ac159..0000000 --- a/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -# this fun little grep just extracts the version information from Cargo.toml. -CARGO_VERSION=$$(grep version Cargo.toml | head -1 | awk '{ print $$3 }' | sed 's/"//g') - -build: test - cargo build - -test: - cargo test --lib - -test-integration: -ifneq (${SKIP},) - TOKEN=$$(cat test-token.txt) sudo -E bash -c "$$(which cargo) test ${RUN_TEST} -- --skip '${SKIP}' --nocapture --test-threads 1" -else - TOKEN=$$(cat test-token.txt) sudo -E bash -c "$$(which cargo) test ${RUN_TEST} -- --nocapture --test-threads 1" -endif - -docker-image: - docker build -t zerotier/zeronsd . - -docker-image-package: - docker build --build-arg IS_LOCAL=1 -t zerotier/zeronsd:$(CARGO_VERSION) . - docker build -f Dockerfile.alpine -t zerotier/zeronsd:alpine-$(CARGO_VERSION) . - -docker-image-push: docker-image-package - docker push zerotier/zeronsd:$(CARGO_VERSION) - docker push zerotier/zeronsd:alpine-$(CARGO_VERSION) - docker tag zerotier/zeronsd:$(CARGO_VERSION) zerotier/zeronsd:latest - docker tag zerotier/zeronsd:alpine-$(CARGO_VERSION) zerotier/zeronsd:alpine-latest - docker push zerotier/zeronsd:latest - docker push zerotier/zeronsd:alpine-latest - -packagedir: - mkdir -p target/packages - -package-ubi: packagedir packages-out - docker build -f Dockerfile.ubi -t zeronsd-packages-ubi . - docker run -it -v ${PWD}:/code -w /code --rm zeronsd-packages-ubi bash -c ". /root/.cargo/env && cargo build --release && cargo generate-rpm && mv /code/target/generate-rpm/*.rpm /code/target/packages" - -package-ubuntu22: packagedir packages-out - docker build -f Dockerfile.ubuntu -t zeronsd-packages-ubuntu . - docker run -it -v ${PWD}:/code -w /code --rm zeronsd-packages-ubuntu bash -c "cargo deb --variant ubuntu22 && mv /code/target/debian/*.deb /code/target/packages" - -package-debian: packagedir packages-out - docker build -f Dockerfile.packages -t zeronsd-packages . - docker run -it -v ${PWD}:/code -w /code --rm zeronsd-packages bash -c ". /root/.cargo/env && cargo deb && mv /code/target/debian/*.deb /code/target/packages" - -packages: docker-image-package package-ubi package-ubuntu22 package-debian - make packages-out - -packages-out: - @echo - @find target/packages -name '*.deb' -o -name '*.rpm' - @echo docker image "zerotier/zeronsd:$(CARGO_VERSION)" was tagged - @echo - @echo "The files were written as root. Please ensure they fit your needed permissions manually." - @echo - -clean: - @echo - @echo Running sudo to clean your target directory - @echo - sudo rm -rf target - cargo clean - -test-packages: clean packages - docker run -v ${PWD}:/code --rm -it redhat/ubi8 bash -c "rpm -ivh /code/target/packages/\*.rpm && zeronsd --version" - docker run -v ${PWD}:/code --rm -it debian:latest bash -c "dpkg -i /code/target/packages/zeronsd_${CARGO_VERSION}_amd64.deb && zeronsd --version" - docker run -v ${PWD}:/code --rm -it ubuntu:focal bash -c "apt update -qq && apt install libssl1.1 libc6 -y && dpkg -i /code/target/packages/zeronsd_${CARGO_VERSION}_amd64.deb && zeronsd --version" - docker run -v ${PWD}:/code --rm -it ubuntu:jammy bash -c "dpkg -i /code/target/packages/zeronsd-ubuntu22_${CARGO_VERSION}_amd64.deb && zeronsd --version" - [ "$$(docker run --rm zerotier/zeronsd:$(CARGO_VERSION) --version)" = "zeronsd $(CARGO_VERSION)" ] - [ "$$(docker run --rm zerotier/zeronsd:alpine-$(CARGO_VERSION) --version)" = "zeronsd $(CARGO_VERSION)" ] - make packages-out - -.PHONY: docker-image docker-image-package \ - packages packages-out test-packages \ - clean package-debian package-ubuntu22 \ - package-ubi packagedir diff --git a/cargo-docker.sh b/cargo-docker.sh deleted file mode 100644 index 19fa862..0000000 --- a/cargo-docker.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -export PATH="${HOME}/.cargo/bin:${PATH}" - -if [ "${IS_LOCAL}" != 0 ] -then - cargo install --path . -else - cargo install --git https://github.com/zerotier/zeronsd \ - $(if [ "${IS_TAG}" != "0" ]; then echo "--tag"; else echo "--branch"; fi) \ - "${VERSION}" -fi diff --git a/central-api/Cargo.toml b/central-api/Cargo.toml new file mode 100644 index 0000000..26aaacb --- /dev/null +++ b/central-api/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "zerotier-central-api" +version = "1.3.0" +edition = "2021" + +[dependencies] +futures = "0.3.31" +progenitor = "0.8.0" +reqwest = { version = "0.12.8", features = ["json", "stream"] } +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" diff --git a/central-api/openapi.json b/central-api/openapi.json new file mode 100644 index 0000000..d582194 --- /dev/null +++ b/central-api/openapi.json @@ -0,0 +1,1912 @@ +{ + "openapi": "3.0.0", + "info": { + "description": "ZeroTier Central Network Management Portal API.

All API requests must have an API token header specified in the Authorization: token xxxxx format. You can generate your API key by logging into ZeroTier Central and creating a token on the Account page.

eg. curl -X GET -H \"Authorization: token xxxxx\" https://api.zerotier.com/api/v1/network

Rate Limiting

The ZeroTier Central API implements rate limiting. Paid users are limited to 100 requests per second. Free users are limited to 20 requests per second.

You can get the OpenAPI spec here as well: https://docs.zerotier.com/api/central/ref-v1.json

", + "version": "v1", + "title": "ZeroTier Central API", + "contact": { + "name": "ZeroTier Support Discussion Forum", + "url": "https://discuss.zerotier.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "servers": [ + { + "url": "https://api.zerotier.com/api/v1", + "description": "Production Server" + } + ], + "tags": [ + { + "name": "network", + "description": "Network operations" + }, + { + "name": "network-member", + "description": "Network member operations" + }, + { + "name": "user", + "description": "User management operations" + }, + { + "name": "organizations", + "description": "Organization management. Note: Organizations require a paid account and cannot be created via the API" + }, + { + "name": "util", + "description": "Utility endpoints" + } + ], + "paths": { + "/status": { + "get": { + "tags": ["util"], + "summary": "Obtain the overall status of the account tied to the API token in use.", + "operationId": "getStatus", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } + } + } + } + } + }, + "/network": { + "get": { + "tags": ["network"], + "summary": "Returns a list of Networks you have access to.", + "operationId": "getNetworkList", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + } + } + } + }, + "403": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "post": { + "tags": ["network"], + "summary": "Create a new network.", + "operationId": "newNetwork", + "requestBody": { + "description": "empty JSON object", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Network creation succeeded", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "403": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/network/{networkID}": { + "get": { + "tags": ["network"], + "summary": "Get network by ID", + "description": "Returns a single network", + "operationId": "getNetworkByID", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network to return", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "get success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": ["network"], + "summary": "update network configuration", + "operationId": "updateNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network to change", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Network object JSON", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": ["network"], + "summary": "delete network", + "operationId": "deleteNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "network deleted" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/network/{networkID}/member": { + "get": { + "tags": ["network-member"], + "summary": "Returns a list of Members on the network.", + "operationId": "getNetworkMemberList", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network to return", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "member list get success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/network/{networkID}/member/{memberID}": { + "get": { + "tags": ["network-member"], + "operationId": "getNetworkMember", + "summary": "Return an individual member on a network", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "memberID", + "description": "ID of the member", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "member get success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": ["network-member"], + "operationId": "updateNetworkMember", + "summary": "Modify a network member", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "memberID", + "description": "ID of the member", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Member object JSON", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "responses": { + "200": { + "description": "member changed successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": ["network-member"], + "operationId": "deleteNetworkMember", + "summary": "Delete a network member", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "memberID", + "description": "ID of the member", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "member deleted" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/user/{userID}": { + "get": { + "tags": ["user"], + "operationId": "getUserByID", + "summary": "Get user record", + "parameters": [ + { + "name": "userID", + "description": "User ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "User get success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": ["user"], + "operationId": "updateUserByID", + "summary": "Update user record (SMS number or Display Name only)", + "parameters": [ + { + "name": "userID", + "description": "User ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "User object JSON", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "200": { + "description": "User update success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": ["user"], + "operationId": "deleteUserByID", + "summary": "Delete user", + "description": "Deletes the user and all associated networks. This is not reversible. Delete at your own risk.", + "parameters": [ + { + "name": "userID", + "description": "User ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "user deleted" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/user/{userID}/token": { + "post": { + "tags": ["user"], + "operationId": "addAPIToken", + "summary": "Add an API token", + "parameters": [ + { + "name": "userID", + "description": "User ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "APIToken JSON object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIToken" + } + } + } + }, + "responses": { + "200": { + "description": "API Token added", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIToken" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/user/{userID}/token/{tokenName}": { + "delete": { + "tags": ["user"], + "operationId": "deleteAPIToken", + "summary": "Delete API Token", + "parameters": [ + { + "name": "userID", + "description": "User ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tokenName", + "description": "Token Name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "API token deleted" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/org": { + "get": { + "tags": ["organizations"], + "operationId": "getOrganization", + "summary": "Get the current user's organization", + "responses": { + "200": { + "description": "Get my organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/org/{orgID}": { + "get": { + "tags": ["organizations"], + "operationId": "getOrganizationByID", + "summary": "Get organization by ID", + "parameters": [ + { + "name": "orgID", + "description": "Organization ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/org/{orgID}/user": { + "get": { + "tags": ["organizations"], + "operationId": "getOrganizationMembers", + "summary": "Get list of organization members", + "parameters": [ + { + "name": "orgID", + "description": "Organization ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Get organization members success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationMember" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/org-invitation": { + "get": { + "tags": ["organizations"], + "operationId": "getOrganizationInvitationList", + "summary": "Get list of organization invitations", + "responses": { + "200": { + "description": "Get list of invitations", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrganizationInvitation" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": ["organizations"], + "operationId": "inviteUserByEmail", + "summary": "Invite a user to your organization by email", + "requestBody": { + "description": "Organization Invitation JSON object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitation" + } + } + } + }, + "responses": { + "200": { + "description": "User invited to organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitation" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/org-invitation/{inviteID}": { + "get": { + "tags": ["organizations"], + "operationId": "getInvitationByID", + "summary": "Get organization invitation", + "parameters": [ + { + "name": "inviteID", + "description": "Invitation ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Get organization invitation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitation" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": ["organizations"], + "operationId": "acceptInvitation", + "summary": "Accept organization invitation", + "parameters": [ + { + "name": "inviteID", + "description": "Invitation ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Organization invitation accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitation" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": ["organizations"], + "operationId": "declineInvitation", + "summary": "Decline organization invitation", + "parameters": [ + { + "name": "inviteID", + "description": "Invitation ID", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "organization invitation declined" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "$ref": "#/components/responses/AccessDeniedError" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/randomToken": { + "get": { + "tags": ["util"], + "operationId": "getRandomToken", + "summary": "Get a random 32 character token", + "description": "Get a random 32 character. Used by the web UI to generate API keys", + "responses": { + "200": { + "description": "Random token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomToken" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "tokenAuth": { + "type": "http", + "scheme": "token" + } + }, + "responses": { + "BadRequest": { + "description": "Bad request" + }, + "AccessDeniedError": { + "description": "Access denied" + }, + "NotFound": { + "description": "Item not found" + }, + "UnauthorizedError": { + "description": "Authorization required" + } + }, + "schemas": { + "Network": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "8056c2e21c000001", + "readOnly": true, + "nullable": true + }, + "clock": { + "type": "integer", + "format": "int64", + "example": 12345, + "readOnly": true, + "nullable": true + }, + "config": { + "$ref": "#/components/schemas/NetworkConfig", + "nullable": true + }, + "description": { + "type": "string", + "example": "Some descriptive text about my network.", + "nullable": true + }, + "rulesSource": { + "type": "string", + "example": "accept;", + "nullable": true + }, + "permissions": { + "$ref": "#/components/schemas/PermissionsMap", + "nullable": true + }, + "ownerId": { + "type": "string", + "example": "00000000-0000-0000-0000-000000000000", + "nullable": true + }, + "onlineMemberCount": { + "type": "integer", + "example": 123, + "readOnly": true, + "nullable": true, + "description": "Note: May be 0 on endpoints returning lists of Networks" + }, + "authorizedMemberCount": { + "type": "integer", + "example": 200, + "readOnly": true, + "nullable": true + }, + "totalMemberCount": { + "type": "integer", + "example": 250, + "readOnly": true, + "nullable": true + }, + "capabilitiesByName": { + "type": "object", + "nullable": true + }, + "tagsByName": { + "type": "object", + "nullable": true + } + }, + "description": "Network object" + }, + "NetworkConfig": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "8056c2e21c000001", + "description": "Network ID", + "readOnly": true, + "nullable": true + }, + "creationTime": { + "type": "integer", + "format": "int64", + "example": 1442292672978, + "description": "Time the network was created", + "readOnly": true, + "nullable": true + }, + "capabilities": { + "type": "array", + "description": "Array of network capabilities", + "items": { + "type": "object" + }, + "nullable": true + }, + "dns": { + "type": "object", + "$ref": "#/components/schemas/DNS", + "nullable": true + }, + "enableBroadcast": { + "type": "boolean", + "example": true, + "description": "Enable broadcast packets on the network", + "nullable": true + }, + "ipAssignmentPools": { + "type": "array", + "description": "Range of IP addresses for the auto assign pool", + "items": { + "$ref": "#/components/schemas/IPRange" + }, + "nullable": true + }, + "lastModified": { + "type": "integer", + "format": "int64", + "example": 1588184318235, + "description": "Time the network was last modified", + "readOnly": true, + "nullable": true + }, + "mtu": { + "type": "integer", + "example": 2800, + "description": "MTU to set on the client virtual network adapter", + "nullable": true + }, + "multicastLimit": { + "type": "integer", + "example": 32, + "description": "Maximum number of recipients per multicast or broadcast. Warning - Setting this to 0 will disable IPv4 communication on your network!", + "nullable": true + }, + "name": { + "type": "string", + "example": "My ZeroTier Network", + "nullable": true + }, + "private": { + "type": "boolean", + "example": true, + "description": "Whether or not the network is private. If false, members will *NOT* need to be authorized to join.", + "nullable": true + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Route" + }, + "nullable": true + }, + "rules": { + "type": "array", + "items": { + "type": "object" + }, + "nullable": true + }, + "ssoConfig": { + "$ref": "#/components/schemas/NetworkSSOConfig", + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "object" + }, + "nullable": true + }, + "v4AssignMode": { + "$ref": "#/components/schemas/IPV4AssignMode", + "nullable": true + }, + "v6AssignMode": { + "$ref": "#/components/schemas/IPV6AssignMode", + "nullable": true + } + } + }, + "NetworkSSOConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "example": true, + "readOnly": false, + "description": "SSO enabled/disabled on network" + }, + "mode": { + "type": "string", + "example": "default", + "description": "SSO mode. One of: `default`, `email`, `group`", + "readOnly": false + }, + "clientId": { + "type": "string", + "example": "some-client-id", + "description": "SSO client ID. Client ID must be already configured in the Org", + "readOnly": false + }, + "issuer": { + "type": "string", + "example": "https://example.com/oidc", + "description": "URL of the OIDC issuer", + "readOnly": true + }, + "provider": { + "type": "string", + "example": "keycloak", + "description": "Provider type", + "readOnly": true + }, + "authorizationEndpoint": { + "type": "string", + "description": "Authorization URL endpoint", + "readOnly": true + }, + "allowList": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true, + "description": "List of email addresses or group memberships that may SSO auth onto the network", + "readOnly": false + } + } + }, + "Member": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "8056c2e21c000001-abcdef0123", + "description": "concatenation of network ID and member ID", + "readOnly": true, + "deprecated": true, + "nullable": true + }, + "clock": { + "type": "integer", + "format": "int64", + "example": 1612993759070, + "readOnly": true, + "nullable": true + }, + "networkId": { + "type": "string", + "example": "8056c2e21c000001", + "readOnly": true, + "nullable": true + }, + "nodeId": { + "type": "string", + "example": "abcdef01234", + "description": "ZeroTier ID of the member", + "readOnly": true, + "nullable": true + }, + "controllerId": { + "type": "string", + "example": "8056c2e21c", + "readOnly": true, + "deprecated": true, + "nullable": true + }, + "hidden": { + "type": "boolean", + "example": false, + "description": "Whether or not the member is hidden in the UI", + "nullable": true + }, + "name": { + "type": "string", + "example": "my-cray-supercomputer", + "readOnly": false, + "description": "User defined name of the member", + "nullable": true + }, + "description": { + "type": "string", + "example": "My super awesome cray that I got ZeroTier to run on", + "readOnly": false, + "description": "User defined description of the member", + "nullable": true + }, + "config": { + "$ref": "#/components/schemas/MemberConfig", + "nullable": true + }, + "lastOnline": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Last seen time of the member (milliseconds since epoch). Note: This data is considered ephemeral and may be reset to 0 at any time without warning.", + "example": 1612993673254, + "nullable": true, + "deprecated": true + }, + "lastSeen": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Time the member last checked in with the network controller in milliseconds since epoch. Note: This data is considered ephemeral and may be reset to 0 at any time without warning.", + "example": 1612993673254, + "nullable": true + }, + "physicalAddress": { + "type": "string", + "readOnly": true, + "description": "IP address the member last spoke to the controller via (milliseconds since epoch). Note: This data is considered ephemeral and may be reset to 0 at any time without warning.", + "example": "8.8.8.8", + "nullable": true + }, + "clientVersion": { + "type": "string", + "readOnly": true, + "description": "ZeroTier version the member is running", + "example": "1.6.3", + "nullable": true + }, + "protocolVersion": { + "type": "integer", + "readOnly": true, + "description": "ZeroTier protocol version", + "example": 12, + "nullable": true + }, + "supportsRulesEngine": { + "type": "boolean", + "readOnly": true, + "description": "Whether or not the client version is new enough to support the rules engine (1.4.0+)", + "nullable": true + } + } + }, + "MemberConfig": { + "type": "object", + "properties": { + "activeBridge": { + "type": "boolean", + "readOnly": false, + "description": "Allow the member to be a bridge on the network", + "example": false, + "nullable": true + }, + "authorized": { + "type": "boolean", + "readOnly": false, + "description": "Is the member authorized on the network", + "example": true, + "nullable": true + }, + "capabilities": { + "type": "array", + "items": { + "type": "integer" + }, + "nullable": true + }, + "creationTime": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Time the member was created or first tried to join the network", + "example": 1599853509872, + "nullable": true + }, + "id": { + "type": "string", + "readOnly": true, + "description": "ID of the member node. This is the 10 digit identifier that identifies a ZeroTier node.", + "example": "abcdef01234", + "nullable": true + }, + "identity": { + "type": "string", + "readOnly": true, + "description": "Public Key of the member's Identity", + "example": "abcdef0123:0:abcdef0123abcdef0123abcdef0123abcdef0123abcdef0123abcdef0123abcdef0123", + "nullable": true + }, + "ipAssignments": { + "type": "array", + "readOnly": false, + "description": "List of assigned IP addresses", + "items": { + "type": "string" + }, + "example": ["10.0.0.3"], + "nullable": true + }, + "lastAuthorizedTime": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Time the member was authorized on the network", + "example": 1599853637989, + "nullable": true + }, + "lastDeauthorizedTime": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Time the member was deauthorized on the network", + "example": 0, + "nullable": true + }, + "noAutoAssignIps": { + "type": "boolean", + "readOnly": false, + "description": "Exempt this member from the IP auto assignment pool on a Network", + "example": false, + "nullable": true + }, + "revision": { + "type": "integer", + "readOnly": true, + "description": "Member record revision count", + "example": 123, + "nullable": true + }, + "ssoExempt": { + "type": "boolean", + "readOnly": false, + "description": "Allow the member to be authorized without OIDC/SSO", + "example": false, + "nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "array", + "items": { + "anyOf": [{ "type": "integer" }, { "type": "boolean" }] + } + }, + "nullable": true, + "readOnly": false, + "description": "Array of 2 member tuples of tag [ID, tag value]", + "example": [[123, 456]] + }, + "vMajor": { + "type": "integer", + "readOnly": true, + "description": "Major version of the client", + "example": 1, + "nullable": true + }, + "vMinor": { + "type": "integer", + "readOnly": true, + "description": "Minor version of the client", + "example": 6, + "nullable": true + }, + "vRev": { + "type": "integer", + "readOnly": true, + "description": "Revision number of the client", + "example": 3, + "nullable": true + }, + "vProto": { + "type": "integer", + "readOnly": true, + "description": "Protocol version of the client", + "example": 12, + "nullable": true + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "User ID", + "example": "00000000-0000-0000-0000-000000000000" + }, + "orgId": { + "type": "string", + "readOnly": true, + "description": "Organization ID", + "example": "00000000-0000-0000-0000-000000000000" + }, + "globalPermissions": { + "readOnly": true, + "allOf": [ + { + "$ref": "#/components/schemas/Permissions" + } + ] + }, + "displayName": { + "type": "string", + "readOnly": false, + "description": "Display Name", + "example": "Joe User" + }, + "email": { + "type": "string", + "readOnly": true, + "description": "User email address", + "example": "user@example.com" + }, + "auth": { + "readOnly": true, + "allOf": [ + { + "$ref": "#/components/schemas/AuthMethods" + } + ] + }, + "smsNumber": { + "type": "string", + "readOnly": false, + "description": "SMS number", + "example": "+1-800-555-1212", + "deprecated": true + }, + "tokens": { + "type": "array", + "readOnly": true, + "items": { + "type": "string" + }, + "example": ["my-token-id"], + "description": "List of API token names." + } + } + }, + "Organization": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "00000000-0000-0000-0000-000000000000", + "description": "Organization ID" + }, + "ownerId": { + "type": "string", + "description": "User ID of the organization owner", + "example": "00000000-0000-0000-0000-000000000000", + "readOnly": true + }, + "ownerEmail": { + "type": "string", + "description": "Organization owner's email address", + "example": "user@example.com", + "readOnly": true + }, + "members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrganizationMember" + }, + "description": "List of organization members" + }, + "ssoConfig": { + "type": "object", + "$ref": "#/components/schemas/OrgSsoConfig", + "description": "Organization wide SSO configuration" + } + } + }, + "OrgSsoConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "example": true, + "description": "Enabled flag for SSO" + }, + "issuers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SsoIssuer", + "description": "list of configured OIDC issuers" + } + } + } + }, + "SsoIssuer": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "example": "keycloak", + "description": "OIDC Provider (one of: default, authelia, auth0, azure, keycloak, okta, onelogin)" + }, + "clientId": { + "type": "string", + "example": "oidc-client-id", + "description": "OIDC Client ID" + }, + "issuer": { + "type": "string", + "example": "https://example.com/oidc/auth", + "description": "OIDC Issuer URL" + }, + "authorization_endpoint": { + "type": "string", + "example": "https://example.com/oidc/auth/endpoint", + "description": "authorization endpoint", + "readOnly": true + } + } + }, + "OrganizationMember": { + "type": "object", + "properties": { + "orgId": { + "type": "string", + "readOnly": true, + "description": "Organization ID", + "example": "00000000-0000-0000-0000-000000000000" + }, + "userId": { + "type": "string", + "readOnly": false, + "description": "User ID", + "example": "00000000-0000-0000-0000-000000000000" + }, + "name": { + "type": "string", + "readOnly": true, + "nullable": true, + "description": "Organization member display name", + "example": "Joe User" + }, + "email": { + "type": "string", + "readOnly": true, + "nullable": true, + "description": "Organization member email address" + } + } + }, + "OrganizationInvitation": { + "type": "object", + "properties": { + "orgId": { + "type": "string", + "description": "Organization ID", + "example": "00000000-0000-0000-0000-000000000000", + "readOnly": true + }, + "email": { + "type": "string", + "description": "Email address of invitee", + "example": "joe@user.com" + }, + "id": { + "type": "string", + "description": "Invitation ID", + "example": "00000000-0000-0000-0000-000000000000", + "readOnly": true + }, + "creation_time": { + "type": "integer", + "format": "int64", + "description": "Creation time of the invite", + "example": 1613067920454, + "readOnly": true + }, + "status": { + "readOnly": true, + "description": "Invitation status", + "example": "pending", + "allOf": [ + { + "$ref": "#/components/schemas/InviteStatus" + } + ] + }, + "update_time": { + "type": "integer", + "format": "int64", + "description": "Last updated time of the invitation", + "example": 1613067920454, + "readOnly": true + }, + "ownerEmail": { + "type": "string", + "description": "Organization owner email address", + "example": "user@example.com", + "readOnly": true + } + } + }, + "PermissionsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Permissions" + }, + "example": { + "00000000-0000-0000-0000-000000000000": { + "a": true, + "d": true, + "m": true, + "r": true + } + } + }, + "Permissions": { + "type": "object", + "properties": { + "a": { + "type": "boolean", + "example": true, + "description": "Authorize permission" + }, + "d": { + "type": "boolean", + "example": true, + "description": "Delete permission" + }, + "m": { + "type": "boolean", + "example": true, + "description": "Modify network settings permission" + }, + "r": { + "type": "boolean", + "example": true, + "description": "Read network settings permission" + } + } + }, + "IPRange": { + "type": "object", + "properties": { + "ipRangeStart": { + "type": "string", + "example": "10.0.0.1" + }, + "ipRangeEnd": { + "type": "string", + "example": "10.0.0.255" + } + } + }, + "DNS": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "example": "some.domain", + "description": "Search domain to use for DNS records" + }, + "servers": { + "type": "array", + "items": { + "type": "string" + }, + "example": ["10.0.0.3"], + "description": "IP address of unicast DNS service", + "nullable": true + } + } + }, + "Route": { + "type": "object", + "properties": { + "target": { + "type": "string", + "example": "10.0.0.0/24" + }, + "via": { + "type": "string", + "example": null, + "nullable": true + } + } + }, + "IPV4AssignMode": { + "type": "object", + "properties": { + "zt": { + "type": "boolean", + "example": true + } + } + }, + "IPV6AssignMode": { + "type": "object", + "properties": { + "6plane": { + "type": "boolean", + "example": true, + "nullable": true + }, + "rfc4193": { + "type": "boolean", + "example": false, + "nullable": true + }, + "zt": { + "type": "boolean", + "example": false, + "nullable": true + } + } + }, + "AuthMethods": { + "type": "object", + "properties": { + "local": { + "type": "string", + "example": "user@example.com", + "description": "email address for built-in authentication", + "nullable": true, + "readOnly": true + }, + "google": { + "type": "string", + "example": "156162346876134683", + "description": "Google OIDC ID", + "nullable": true, + "readOnly": true + }, + "oidc": { + "type": "string", + "example": "00000000-0000-0000-0000-000000000000", + "description": "Generic OIDC ID", + "nullable": true, + "readOnly": true + } + } + }, + "APIToken": { + "type": "object", + "properties": { + "tokenName": { + "type": "string", + "example": "my-super-secret-token", + "description": "user specified token name", + "readOnly": false + }, + "token": { + "type": "string", + "example": "adsf98ashdkjh3689adsfnj3$ADn", + "description": "API Token. Minimum 32 characters. This token is encrypted in the database and can not be retrieved once set", + "readOnly": false, + "writeOnly": true + } + } + }, + "InviteStatus": { + "type": "string", + "enum": ["pending", "accepted", "canceled"] + }, + "Status": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "central_status" + }, + "type": { + "type": "string", + "example": "CentralStatus" + }, + "clock": { + "type": "integer", + "format": "int64", + "example": 1613067920454, + "readOnly": true, + "description": "Current time on server" + }, + "version": { + "type": "string", + "example": "1.6.5" + }, + "apiVersion": { + "type": "string", + "example": "4" + }, + "uptime": { + "type": "integer", + "format": "int64", + "example": 1613067920454, + "readOnly": true, + "description": "Uptime on server" + }, + "user": { + "$ref": "#/components/schemas/User" + }, + "readOnlyMode": { + "type": "boolean" + }, + "loginMethods": { + "type": "object", + "properties": { + "local": { + "type": "boolean" + }, + "google": { + "type": "boolean" + }, + "twitter": { + "type": "boolean" + }, + "facebook": { + "type": "boolean" + }, + "github": { + "type": "boolean" + }, + "saml": { + "type": "boolean" + }, + "oidc": { + "type": "boolean" + } + } + } + } + }, + "RandomToken": { + "type": "object", + "properties": { + "clock": { + "type": "integer", + "format": "int64", + "example": 1613067920454, + "readOnly": true, + "description": "Current time on server" + }, + "hex": { + "type": "string", + "example": "16924f3ff478526cffb1b89b1040b33c8dbd3c09e07f39691f615769121c0d76", + "readOnly": true, + "description": "hex encoded random bytes of the token" + }, + "token": { + "type": "string", + "example": "wwrb66uUh18Fqc38rd8jMd5RFJzRsCn4", + "readOnly": true, + "description": "Random 32 character token" + } + } + } + } + }, + "security": [ + { + "tokenAuth": [] + } + ] +} diff --git a/central-api/src/lib.rs b/central-api/src/lib.rs new file mode 100644 index 0000000..4fe9457 --- /dev/null +++ b/central-api/src/lib.rs @@ -0,0 +1,3 @@ +use progenitor::generate_api; + +generate_api!("./openapi.json"); diff --git a/example.conf.yaml b/config.yaml.example similarity index 95% rename from example.conf.yaml rename to config.yaml.example index 63555a8..df26be2 100644 --- a/example.conf.yaml +++ b/config.yaml.example @@ -1,7 +1,7 @@ --- # must be set; the file containing the token used to communicate with ZeroTier # Central. -token: "/home/erikh/src/github.com/zerotier/zeronsd/.token" +token: ".central.token" # The domain to use for all subdomains. Defaults to `home.arpa.`. Trailing # period is not required. # diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a3f7dec --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728613723, + "narHash": "sha256-zVVj0PKguM8ZMdLE43YW7dzer3tl9e6i5Qs1fr878+c=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ca93f28abd2147dd9997261dcaeacc5a30dba463", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ab3294a --- /dev/null +++ b/flake.nix @@ -0,0 +1,81 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, flake-utils, rust-overlay, ... }: + let + cargo-config = builtins.fromTOML (builtins.readFile ./zeronsd/Cargo.toml); + rust-version = "1.81.0"; + in { + } // flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + }; + + devInputs = with pkgs; [ + rust-bin.stable.${rust-version}.complete + pkg-config + openssl + ]; + + zeronsd-bin = pkgs.rustPlatform.buildRustPackage rec { + inherit (cargo-config.package) name version; + + src = ./.; + buildAndTestSubdir = "zeronsd"; + + nativeBuildInputs = devInputs; + buildInputs = devInputs; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + }; + in + { + devShells.default = pkgs.mkShell { + buildInputs = devInputs; + nativeBuildInputs = [ pkgs.just ]; + }; + + packages = { + zeronsd = zeronsd-bin; + default = zeronsd-bin; + + container = pkgs.dockerTools.buildImage { + inherit (cargo-config.package) name; + tag = "latest"; + + copyToRoot = pkgs.buildEnv { + name = "image-root"; + paths = [ zeronsd-bin pkgs.dockerTools.caCertificates ]; + pathsToLink = [ "/bin" "/etc" ]; + }; + + created = "now"; + + runAsRoot = '' + #{pkgs.runtimeShell} + mkdir -p /var/lib/zeronsd + ''; + + config = { + Cmd = [ "/bin/zeronsd" ]; + WorkingDir = "/var/lib/zeronsd"; + }; + }; + }; + + overlays = { + default = final: prev: { zeronsd = zeronsd-bin; }; + }; + }); +} diff --git a/generate.sh b/generate.sh deleted file mode 100644 index ca5ee12..0000000 --- a/generate.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -if [ "x$1" = "x" ] -then - echo "Please read this script before executing it" - exit 1 -fi - -PACKAGE=$1 -PREFIX=$2 - -HOST=${HOST:-docs.zerotier.com} - -rm -rf ./${PREFIX} -mkdir -p ./${PREFIX} -docker pull openapitools/openapi-generator-cli:latest -docker run --rm -u $(id -u):$(id -g) -v ${PWD}/${PREFIX}:/swagger openapitools/openapi-generator-cli generate \ - --package-name ${PREFIX} \ - -i http://${HOST}/openapi/${PACKAGE}v1.json \ - -g rust \ - -o /swagger - -grep -v default-features ${PREFIX}/Cargo.toml > tmp && mv tmp ${PREFIX}/Cargo.toml diff --git a/justfile b/justfile new file mode 100644 index 0000000..b8bcd5f --- /dev/null +++ b/justfile @@ -0,0 +1,22 @@ +build: + nix build .#container + +dns-ip network: + @sudo zerotier-cli -j listnetworks \ + | jq -r \ + '.[] | select(.id == "{{network}}") \ + | .dns.servers \ + | select(.[] | test("\\d+\\.\\d+\\.\\d+\\.\\d+")) \ + | last' + +run network config="./config.yaml" token="./.central.token": build + file {{config}} + sudo docker load < result + sudo docker run \ + --net=host \ + --init \ + -v {{config}}:/var/lib/zeronsd/config.yaml \ + -v {{token}}:/var/lib/zeronsd/central.token \ + -v /var/lib/zerotier-one:/var/lib/zerotier-one \ + zeronsd:latest \ + zeronsd start -c /var/lib/zeronsd/config.yaml {{network}} diff --git a/scripts/update-openapi.sh b/scripts/update-openapi.sh new file mode 100755 index 0000000..dc7f5a9 --- /dev/null +++ b/scripts/update-openapi.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -eo pipefail + +if [ "x$1" = "x" ]; then + echo "Usage: $0 " + exit 1 +fi + +PACKAGE=$1 +CLIENT_LIB_DIR="${PACKAGE}-api" + +if [ ! -d ${CLIENT_LIB_DIR} ]; then + echo "Missing ${CLIENT_LIB_DIR}" + exit 1 +fi + +VERSION=${3:-"v1"} + +URL_BASE="https://raw.githubusercontent.com/zerotier/docs/refs/heads/main/static/openapi/" + +curl -sSL ${URL_BASE}/${PACKAGE}${VERSION}.json > ${CLIENT_LIB_DIR}/openapi.json diff --git a/service-api/Cargo.toml b/service-api/Cargo.toml new file mode 100644 index 0000000..97b3a4d --- /dev/null +++ b/service-api/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "zerotier-service-api" +version = "1.3.0" +edition = "2021" + +[dependencies] +futures = "0.3.31" +progenitor = "0.8.0" +reqwest = { version = "0.12.8", features = ["json", "stream"] } +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" diff --git a/service-api/openapi.json b/service-api/openapi.json new file mode 100644 index 0000000..4584fa4 --- /dev/null +++ b/service-api/openapi.json @@ -0,0 +1,1035 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "ZeroTierOne Service API", + "version": "0.1.0", + "description": "

This API controls the ZeroTier service that runs in the background on your computer. This is how zerotier-cli, and the macOS and Windows apps control the service.

API requests must be authenticated via an authentication token. ZeroTier One saves this token in the authtoken.secret file in its working directory. This token may be supplied via the X-ZT1-Auth HTTP request header.

For example: curl -H \"X-ZT1-Auth: $TOKEN\" http://localhost:9993/status

The token can be found in:

  • Mac :: ~/Library/Application Support/ZeroTier/authtoken.secret
  • Windows :: \\ProgramData\\ZeroTier\\One
  • Linux :: /var/lib/zerotier-one

You can get the OpenAPI spec here as well: https://docs.zerotier.com/openapi/servicev1.json

", + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "servers": [ + { + "url": "http://localhost:9993", + "description": "Production Server" + } + ], + "tags": [ + { + "name": "status", + "description": "status" + }, + { + "name": "network", + "description": "settings and status of a joined network" + }, + { + "name": "peer", + "description": "peer status" + } + ], + "paths": { + "/controller": { + "get": { + "tags": ["controller"], + "summary": "Get Controller Status.", + "operationId": "getControllerStatus", + "description": "Check for controller function and return controller status.", + "responses": { + "200": { + "description": "Status object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerStatus" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/controller/network": { + "get": { + "tags": ["controller"], + "summary": "List Networks.", + "operationId": "getControllerNetworks", + "description": "List IDs of all networks hosted by this controller.", + "responses": { + "200": { + "description": "List of network IDs.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "example": "3e245e31af7a726a" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/controller/network/{networkID}": { + "get": { + "tags": ["controller"], + "summary": "Get Network by ID.", + "description": "Get details of a network by its ID.", + "operationId": "getControllerNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "3e245e31af7a726a" + } + } + ], + "responses": { + "200": { + "description": "Network Details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetwork" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "post": { + "tags": ["controller"], + "summary": "Create or Update a Network.", + "operationId": "setControllerNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "3e245e31af7a726a" + } + } + ], + "requestBody": { + "description": "Network object JSON.", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetwork" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetwork" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/controller/network/{controllerID}": { + "post": { + "tags": ["controller"], + "summary": "Generate Random Network ID.", + "operationId": "generateControllerNetwork", + "description": "Create a new network with a random ID.", + "parameters": [ + { + "name": "controllerID", + "description": "Node ID of the controller.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Network object JSON.", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetwork" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetwork" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/controller/network/{networkID}/member": { + "get": { + "tags": ["controller"], + "summary": "List Network Members.", + "operationId": "getControllerNetworkMembers", + "description": "JSON object containing all member IDs as keys and their memberRevisionCounter values as values.", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "example": { "03d516a9df": 5, "b9d5ad8e13": 1 } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/controller/network/{networkID}/member/{nodeID}": { + "get": { + "tags": ["controller"], + "summary": "Get Network Member Details by ID.", + "operationId": "getControllerNetworkMember", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "nodeID", + "description": "ID of the member node.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ControllerNetworkMember" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/status": { + "get": { + "tags": ["status"], + "summary": "Node status and addressing info.", + "operationId": "getStatus", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/network": { + "get": { + "tags": ["network"], + "summary": "Get all network memberships.", + "operationId": "getNetworks", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Network" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/network/{networkID}": { + "get": { + "tags": ["network"], + "summary": "Get a joined Network membership configuration by Network ID.", + "operationId": "getNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network to get.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "post": { + "tags": ["network"], + "summary": "Join a network or update its configuration by Network ID.", + "operationId": "updateNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network to change.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Network membership object", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "delete": { + "tags": ["network"], + "summary": "Leave a network.", + "operationId": "deleteNetwork", + "parameters": [ + { + "name": "networkID", + "description": "ID of the network", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Network deleted." + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/peer": { + "get": { + "tags": ["peer"], + "summary": "Get all peers.", + "operationId": "getPeers", + "responses": { + "200": { + "description": "Array of Peer objects", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Peer" + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + }, + "/peer/{address}": { + "get": { + "tags": ["peer"], + "summary": "Get information about a specific peer by Node ID.", + "operationId": "getPeer", + "parameters": [ + { + "name": "address", + "description": "ZeroTier address of the peer to get", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Peer object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Peer" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + } + } + }, + "components": { + "securitySchemes": { + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-ZT1-Auth" + } + }, + "responses": { + "UnauthorizedError": { + "description": "Authorization required." + } + }, + "schemas": { + "ControllerStatus": { + "type": "object", + "properties": { + "controller": { + "type": "boolean", + "readOnly": true + }, + "apiVersion": { + "type": "integer", + "example": 3, + "readOnly": true + }, + "clock": { + "type": "integer", + "format": "int64", + "example": 1623101592, + "readOnly": true + } + } + }, + "ControllerNetwork": { + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "example": "3e245e31af000001" + }, + "nwid": { + "type": "string", + "readOnly": true, + "example": "3e245e31af000001" + }, + "objtype": { + "type": "string", + "example": "network", + "readOnly": true + }, + "name": { + "type": "string", + "example": "my-cool-network" + }, + "creationTime": { + "type": "number", + "example": 1623101592, + "readOnly": true + }, + "private": { + "type": "boolean" + }, + "enableBroadcast": { + "type": "boolean" + }, + "v4AssignMode": { + "type": "object", + "properties": { + "zt": { + "type": "boolean" + } + } + }, + "v6AssignMode": { + "type": "object", + "properties": { + "6plane": { + "type": "boolean" + }, + "rfc4193": { + "type": "boolean" + }, + "zt": { + "type": "boolean" + } + } + }, + "mtu": { + "type": "integer", + "example": 2800 + }, + "multicastLimit": { + "type": "integer", + "example": 32 + }, + "revision": { + "type": "integer", + "example": 1, + "readOnly": true + }, + "routes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "target": { + "type": "string", + "example": "192.168.192.0/24" + }, + "via": { + "type": "string", + "example": "192.168.192.1", + "nullable": true + } + } + } + }, + "ipAssignmentPools": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ipRangeStart": { + "type": "string", + "example": "192.168.192.1" + }, + "ipRangeEnd": { + "type": "string", + "example": "192.168.192.254" + } + } + } + }, + "rules": { + "type": "array", + "items": { + "type": "object" + } + }, + "capabilities": { + "type": "array", + "items": { + "type": "object" + } + }, + "tags": { + "type": "array", + "items": { + "type": "object" + } + }, + "remoteTraceTarget": { + "type": "string", + "example": "7f5d90eb87" + }, + "remoteTraceLevel": { + "type": "integer" + } + } + }, + "ControllerNetworkMember": { + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "example": "eb8d45c5c9" + }, + "address": { + "type": "string", + "readOnly": true, + "example": "eb8d45c5c9" + }, + "nwid": { + "type": "string", + "readOnly": true, + "example": "3e245e31af000001" + }, + "authorized": { + "type": "boolean" + }, + "activeBridge": { + "type": "boolean" + }, + "identity": { + "type": "string", + "readOnly": true, + "example": "eb8d45c5c9:0:0279558f1a731cb2f628b3adc9f8915d7c2f3752e07d75f2d75fde08274b9c3a43d8b04115fd30f37043f61758ac874b844cc184fdf51e1022e988c1d093a50d:91a840bcd3fbac910afc56be4222973f675204a0ca9625218352e1c82debaa758b915d948c5fe4bd3c38cf1255904804a5b937f5edaef182ba8d5f3d8a243329" + }, + "ipAssignments": { + "type": "array", + "items": { + "type": "string", + "example": "10.147.20.190" + } + }, + "revision": { + "type": "integer", + "readOnly": true, + "example": 1 + }, + "vMajor": { + "type": "integer", + "readOnly": true, + "example": 1 + }, + "vMinor": { + "type": "integer", + "readOnly": true, + "example": 6 + }, + "vRev": { + "type": "integer", + "readOnly": true, + "example": 5 + }, + "vProto": { + "type": "integer", + "readOnly": true, + "example": 5 + } + } + }, + "Status": { + "type": "object", + "properties": { + "address": { + "type": "string", + "example": "0deadbeef1" + }, + "clock": { + "type": "integer", + "format": "int64", + "example": 1618948931097 + }, + "config": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "properties": { + "allowTcpFallbackRelay": { + "type": "boolean" + }, + "portMappingEnabled": { + "type": "boolean" + }, + "primaryPort": { + "type": "integer", + "example": 9993 + } + } + } + } + }, + "online": { + "type": "boolean" + }, + "planetWorldId": { + "type": "integer", + "format": "int64", + "example": 149604618 + }, + "planetWorldTimestamp": { + "type": "integer", + "format": "int64", + "example": 1618339625163 + }, + "publicIdentity": { + "type": "string", + "example": "33c799cb58:0:690b44091ec50a44eb7f7769354b49abb47ac8747d99d547a1ec8c4d47623c5a6e3927f29b8d8443aebebc9ba4d4a812bd8902d71318db34b89d00186e8f4e4e" + }, + "tcpFallbackActive": { + "type": "boolean" + }, + "version": { + "type": "string", + "example": "1.6.4" + }, + "versionBuild": { + "type": "integer", + "example": 0 + }, + "versionMajor": { + "type": "integer", + "example": 1 + }, + "versionMinor": { + "type": "integer", + "example": 6 + }, + "versionRev": { + "type": "integer", + "example": 4 + } + } + }, + "Network": { + "allOf": [ + { + "type": "object", + "properties": { + "allowDNS": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier modify the system's DNS settings.", + "example": false + }, + "allowDefault": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier modify the system's default route.", + "example": false + }, + "allowGlobal": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier manage IP addresses and route assignments that aren't in private ranges (rfc1918).", + "example": false + }, + "allowManaged": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier manage IP addresses and Route assignments.", + "example": true + } + } + }, + { + "type": "object", + "properties": { + "allowDNS": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier modify the system's DNS settings." + }, + "allowDefault": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier modify the system's default route." + }, + "allowGlobal": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier manage IP addresses and Route assignments that aren't in private ranges (rfc1918)." + }, + "allowManaged": { + "type": "boolean", + "readOnly": false, + "description": "Let ZeroTier to manage IP addresses and Route assignments." + }, + "assignedAddresses": { + "type": "array", + "items": { + "type": "string", + "example": "10.147.20.190" + } + }, + "bridge": { + "type": "boolean" + }, + "broadcastEnabled": { + "type": "boolean" + }, + "dns": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "example": "zt.example.com" + }, + "servers": { + "type": "array", + "items": { + "type": "string", + "example": "10.147.20.3" + } + } + } + }, + "id": { + "type": "string", + "example": "565799d8f620c5c5" + }, + "mac": { + "type": "string", + "example": "e6:d2:2b:e6:68:73", + "description": "MAC address for this network's interface." + }, + "mtu": { + "type": "integer", + "example": 2800 + }, + "multicastSubscriptions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "adi": { + "type": "integer", + "format": "int64", + "example": 0 + }, + "mac": { + "type": "string", + "example": "34:34:ff:da:6e:ff" + } + } + } + }, + "name": { + "type": "string", + "example": "clever_krum" + }, + "netconfRevision": { + "type": "integer", + "example": 123 + }, + "portDeviceName": { + "type": "string", + "example": "ztnnhrtimp" + }, + "portError": { + "type": "integer", + "example": 0 + }, + "routes": { + "type": "array", + "items": { + "properties": { + "flags": { + "type": "integer", + "example": 0 + }, + "metric": { + "type": "integer", + "example": 0 + }, + "target": { + "type": "string", + "example": "10.147.20.0/24" + }, + "via": { + "type": "string", + "example": "192.168.168.5" + } + } + } + }, + "status": { + "type": "string", + "example": "OK" + }, + "type": { + "type": "string", + "example": "PRIVATE" + } + } + } + ] + }, + "Peer": { + "type": "object", + "properties": { + "address": { + "type": "string", + "example": "992fcf1db7" + }, + "isBonded": { + "type": "boolean", + "example": false + }, + "latency": { + "type": "integer", + "example": 40 + }, + "paths": { + "type": "array", + "items": { + "type": "object", + "properties": { + "active": { + "type": "boolean" + }, + "address": { + "type": "string", + "example": "195.181.173.159/9993" + }, + "expired": { + "type": "boolean", + "example": false + }, + "lastReceive": { + "type": "integer", + "format": "int64", + "example": 1618955164580 + }, + "lastSend": { + "type": "integer", + "format": "int64", + "example": 1618955164596 + }, + "preferred": { + "type": "boolean", + "example": true + }, + "trustedPathId": { + "type": "integer", + "example": 0 + } + } + } + }, + "role": { + "type": "string", + "example": "LEAF" + }, + "version": { + "type": "string", + "example": "1.6.4" + }, + "versionMajor": { + "type": "integer", + "example": 1 + }, + "versionMinor": { + "type": "integer", + "example": 6 + }, + "versionRev": { + "type": "integer", + "example": 4 + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] +} diff --git a/service-api/src/lib.rs b/service-api/src/lib.rs new file mode 100644 index 0000000..4fe9457 --- /dev/null +++ b/service-api/src/lib.rs @@ -0,0 +1,3 @@ +use progenitor::generate_api; + +generate_api!("./openapi.json"); diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 0000000..e494f88 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "zeronsd-integration-tests" +version = "0.1.0" +edition = "2021" + +[dev-dependencies] +zeronsd = { path = "../zeronsd" } +zerotier-central-api = { path = "../central-api" } +zerotier-service-api = { path = "../service-api" } + +[features] +default = [] +integration-tests = [] + +[[test]] +name = "integration" +path = "integration.rs" + +[dependencies] +anyhow = "1.0.89" +async-trait = "0.1.83" +ctor = "0.2.8" +ipnetwork = "0.20.0" +rand = "0.8.5" +serde = { version = "1.0.210", features = ["derive"] } +serde_json = "1.0.128" +tokio = { version = "1.40.0", features = ["rt-multi-thread"] } +tracing = "0.1.40" +trust-dns-resolver = "0.22.0" diff --git a/tests/integration.rs b/tests/integration.rs index eb23fa0..6dcb9c5 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1,5 +1,6 @@ use zeronsd::utils::init_logger; +#[cfg(feature = "integration-tests")] mod service; #[ctor::ctor] @@ -7,6 +8,7 @@ fn init() { init_logger(Some(tracing::Level::ERROR)); } +#[cfg(feature = "integration-tests")] mod sixplane { use std::{net::IpAddr, path::Path, str::FromStr, time::Duration}; @@ -151,6 +153,7 @@ mod sixplane { } } +#[cfg(feature = "integration-tests")] mod rfc4193 { use std::{net::IpAddr, path::Path, str::FromStr, time::Duration}; @@ -376,6 +379,7 @@ mod rfc4193 { } } +#[cfg(feature = "integration-tests")] mod ipv4 { use std::time::Duration; @@ -568,6 +572,7 @@ mod ipv4 { } } +#[cfg(feature = "integration-tests")] mod all { use rand::prelude::SliceRandom; use tracing::info; @@ -654,7 +659,7 @@ mod all { ); std::fs::write(hosts_path, "127.0.0.3 islay\n::3 islay\n").unwrap(); - sleep(Duration::new(30, 0)); // wait for bg update + sleep(Duration::new(10, 0)); // wait for bg update assert_eq!( service diff --git a/tests/service/context.rs b/tests/service/context.rs index 8c58f81..60b4878 100644 --- a/tests/service/context.rs +++ b/tests/service/context.rs @@ -11,7 +11,7 @@ use super::{ pub struct TestContext { pub member_config: Option, pub identity: String, - pub zerotier: zerotier_one_api::Client, + pub zerotier: zerotier_service_api::Client, pub central: zerotier_central_api::Client, } diff --git a/tests/service/member.rs b/tests/service/member.rs index 4965c2e..5fc99eb 100644 --- a/tests/service/member.rs +++ b/tests/service/member.rs @@ -20,6 +20,7 @@ impl MemberUtil for Member { physical_address: None, name: None, last_online: None, + last_seen: None, id: None, hidden: None, description: None, @@ -59,6 +60,7 @@ impl MemberConfigUtil for MemberConfig { authorized: Some(true), active_bridge: None, identity: Some(identity), + sso_exempt: None, } } } diff --git a/tests/service/network.rs b/tests/service/network.rs index addb8be..f1204f5 100644 --- a/tests/service/network.rs +++ b/tests/service/network.rs @@ -3,7 +3,6 @@ use std::time::Duration; use tracing::warn; use zeronsd::utils::{authtoken_path, get_listen_ips, ZEROTIER_LOCAL_URL}; use zerotier_central_api::types::{Member, MemberConfig, Network}; -use zerotier_one_api::types::{NetworkSubtype0, NetworkSubtype1}; use super::{context::TestContext, member::MemberConfigUtil, utils::network_definition}; @@ -57,34 +56,26 @@ impl TestNetwork { // join zerotier-one to the test network pub async fn join(&self) -> Result<(), anyhow::Error> { - let network = zerotier_one_api::types::Network { - subtype_0: NetworkSubtype0 { - allow_dns: Some(true), - allow_global: Some(false), - allow_default: Some(false), - allow_managed: Some(true), - }, - subtype_1: NetworkSubtype1 { - status: None, - type_: None, - routes: Vec::new(), - port_error: None, - port_device_name: None, - netconf_revision: None, - name: None, - multicast_subscriptions: Vec::new(), - mtu: None, - mac: None, - id: None, - dns: None, - broadcast_enabled: None, - bridge: None, - assigned_addresses: Vec::new(), - allow_dns: Some(true), - allow_global: Some(false), - allow_default: Some(false), - allow_managed: Some(true), - }, + let network = zerotier_service_api::types::Network { + status: None, + type_: None, + routes: Vec::new(), + port_error: None, + port_device_name: None, + netconf_revision: None, + name: None, + multicast_subscriptions: Vec::new(), + mtu: None, + mac: None, + id: None, + dns: None, + broadcast_enabled: None, + bridge: None, + assigned_addresses: Vec::new(), + allow_dns: Some(true), + allow_global: Some(false), + allow_default: Some(false), + allow_managed: Some(true), }; self.context diff --git a/tests/service/utils.rs b/tests/service/utils.rs index bc43db7..01263a3 100644 --- a/tests/service/utils.rs +++ b/tests/service/utils.rs @@ -1,7 +1,4 @@ -use std::{ - collections::HashMap, - path::{Path, PathBuf}, -}; +use std::path::{Path, PathBuf}; use zeronsd::utils::authtoken_path; @@ -25,9 +22,9 @@ pub fn randstring(len: u8) -> String { // extract a network definiton from testdata. templates in a new name. pub fn network_definition( name: String, -) -> Result, anyhow::Error> { - let mut res: HashMap = serde_json::from_reader( - std::fs::File::open(format!("testdata/networks/{}.json", name))?, +) -> Result, anyhow::Error> { + let mut res: serde_json::Map = serde_json::from_reader( + std::fs::File::open(format!("../testdata/networks/{}.json", name))?, )?; if let serde_json::Value::Object(config) = res.clone().get("config").unwrap() { @@ -44,7 +41,7 @@ pub fn network_definition( } // returns the public identity of this instance of zerotier -pub async fn get_identity(client: &zerotier_one_api::Client) -> Result { +pub async fn get_identity(client: &zerotier_service_api::Client) -> Result { let status = client.get_status().await?; Ok(status diff --git a/wix/main.wxs b/wix/main.wxs deleted file mode 100644 index 8526dec..0000000 --- a/wix/main.wxs +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - - - - - - - - - - - - - - - - - - diff --git a/zeronsd/Cargo.toml b/zeronsd/Cargo.toml new file mode 100644 index 0000000..a85b7b8 --- /dev/null +++ b/zeronsd/Cargo.toml @@ -0,0 +1,84 @@ +[package] +name = "zeronsd" +version = "0.6.0-pre1" +authors = [ + "Erik Hollensbe ", + "Adam Ierymenko ", + "Lennon Day-Reynolds " +] +description = "Unicast DNS resolver for ZeroTier networks" +homepage = "https://github.com/zerotier/zeronsd" +repository = "https://github.com/zerotier/zeronsd" +documentation = "https://github.com/zerotier/zeronsd/blob/main/README.md" +license = "BSD-3-Clause" +readme = "README.md" +keywords = ["dns", "zerotier"] +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +regex = "^1.11.0" +anyhow = "^1.0.89" +clap = { version = "^3", features = ["derive"] } +ipnetwork = "^0.20.0" +trust-dns-client = { version = "^0.22", features = ["dns-over-openssl"] } +trust-dns-resolver = { version = "^0.22", features = ["tokio-runtime", "dns-over-openssl"] } +trust-dns-server = { version = "^0.22", features = ["dns-over-openssl"] } +trust-dns-proto = "^0.22" +tokio = { version = "1", features = ["full"] } +serde = "^1.0.210" +serde_json = "^1.0.128" +serde_yml = "^0.0.12" +zerotier-central-api = { path = "../central-api" } +zerotier-service-api = { path = "../service-api" } +toml = "^0.7.8" +tinytemplate = "^1.2.1" +rand = "^0.8.5" +tracing = "^0.1.40" +tracing-log = "^0.2.0" +tracing-subscriber = "^0.3.18" +hex = "^0.4.3" +openssl = { version = "^0.10.55", features = ["v102", "v110"] } +async-trait = "^0.1.83" +lazy_static = "^1.5.0" +reqwest = "^0.12.8" + +[features] +vendored-openssl = [ "openssl/vendored" ] + +[dev-dependencies] +ctor = ">=0" + +[package.metadata.deb.variants.ubuntu22] +features = [ "vendored-openssl" ] + +[package.metadata.deb] +copyright = "ZeroTier, Inc" + +extended-description = """ +ZeroNS provides names that are a part of ZeroTier Central's +(https://my.zerotier.com) configured networks; once provided a network it: + +- Listens on the local interface joined to that network -- you will want to + start one ZeroNS per ZeroTier network. +- Provides general DNS by forwarding all queries to `/etc/resolv.conf` + resolvers that do not match the TLD, similar to `dnsmasq`. +- Tells Central to point all clients that have the "Manage DNS" settings turned + **on** to resolve to it. +- Finally, sets a provided TLD (`.home.arpa` is the default), as well as + configuring `A` (IPv4) and `AAAA` (IPv6) records for: + - Member IDs: `zt-.` will resolve to the IPv4/v6 addresses for + them. + - Names: _if_ the names are compatible with DNS names, they will be converted + as such: to `.`. + - Please note that **collisions are possible** and that it's _up to the + admin to prevent them_. +""" + +[package.metadata.generate-rpm] +assets = [ { source = "target/release/zeronsd", dest = "/usr/bin/zeronsd", mode = "755" } ] +features = [ "vendored-openssl" ] + +[target.'cfg(windows)'.dependencies] +openssl = { version = ">=0", features = [ "vendored" ] } diff --git a/src/addresses.rs b/zeronsd/src/addresses.rs similarity index 100% rename from src/addresses.rs rename to zeronsd/src/addresses.rs diff --git a/src/authority.rs b/zeronsd/src/authority.rs similarity index 99% rename from src/authority.rs rename to zeronsd/src/authority.rs index 0866d21..9a55b60 100644 --- a/src/authority.rs +++ b/zeronsd/src/authority.rs @@ -76,7 +76,6 @@ pub async fn init_catalog(zt: ZTAuthority) -> Result { trust_dns_server::authority::ZoneType::Primary, config, ) - .await .expect("Could not initialize forwarder"); catalog.upsert(Name::root().into(), Box::new(Arc::new(forwarder))); diff --git a/src/bin/zeronsd.rs b/zeronsd/src/bin/zeronsd.rs similarity index 100% rename from src/bin/zeronsd.rs rename to zeronsd/src/bin/zeronsd.rs diff --git a/src/cli.rs b/zeronsd/src/cli.rs similarity index 97% rename from src/cli.rs rename to zeronsd/src/cli.rs index e8ad500..e233d9d 100644 --- a/src/cli.rs +++ b/zeronsd/src/cli.rs @@ -7,9 +7,8 @@ use std::{path::PathBuf, time::Duration}; use clap::{Args, Parser, Subcommand}; -/// zerotier central nameserver #[derive(Parser)] -#[clap(version, author = "Erik Hollensbe ")] +#[clap(version, author = "ZeroTier, Inc. ")] pub struct Cli { /// Verbose logging (repeat -v for more verbosity) #[clap(short, global = true, parse(from_occurrences))] @@ -108,7 +107,7 @@ impl Into for StartArgs { tls_key: self.tls_key, log_level: self.log_level, network_id: Some(self.network_id), - local_url: self.local_url, + local_url: Some(self.local_url), } } } diff --git a/src/hosts.rs b/zeronsd/src/hosts.rs similarity index 100% rename from src/hosts.rs rename to zeronsd/src/hosts.rs diff --git a/src/init.rs b/zeronsd/src/init.rs similarity index 93% rename from src/init.rs rename to zeronsd/src/init.rs index 70fe5fa..7e16c6e 100644 --- a/src/init.rs +++ b/zeronsd/src/init.rs @@ -31,7 +31,7 @@ pub struct Launcher { pub tls_key: Option, pub wildcard: bool, pub log_level: Option, - pub local_url: String, + pub local_url: Option, #[serde(skip_deserializing)] pub network_id: Option, } @@ -71,7 +71,7 @@ impl Default for Launcher { wildcard: false, network_id: None, log_level: None, - local_url: ZEROTIER_LOCAL_URL.to_string(), + local_url: Some(ZEROTIER_LOCAL_URL.to_string()), } } } @@ -85,7 +85,7 @@ impl Launcher { pub fn parse_format(s: &str, format: ConfigFormat) -> Result { Ok(match format { ConfigFormat::JSON => serde_json::from_str(s)?, - ConfigFormat::YAML => serde_yaml::from_str(s)?, + ConfigFormat::YAML => serde_yml::from_str(s)?, ConfigFormat::TOML => toml::from_str(s)?, }) } @@ -116,7 +116,9 @@ impl Launcher { let ips = get_listen_ips( &authtoken, &self.network_id.clone().unwrap(), - self.local_url.clone(), + self.local_url + .clone() + .unwrap_or(ZEROTIER_LOCAL_URL.to_string()), ) .await?; @@ -151,8 +153,14 @@ impl Launcher { } } - let member_name = - get_member_name(authtoken, domain_name.clone(), self.local_url.clone()).await?; + let member_name = get_member_name( + authtoken, + domain_name.clone(), + self.local_url + .clone() + .unwrap_or(ZEROTIER_LOCAL_URL.to_string()), + ) + .await?; let network = client .get_network_by_id(&self.network_id.clone().unwrap()) diff --git a/src/lib.rs b/zeronsd/src/lib.rs similarity index 100% rename from src/lib.rs rename to zeronsd/src/lib.rs diff --git a/src/log.rs b/zeronsd/src/log.rs similarity index 100% rename from src/log.rs rename to zeronsd/src/log.rs diff --git a/src/server.rs b/zeronsd/src/server.rs similarity index 100% rename from src/server.rs rename to zeronsd/src/server.rs diff --git a/src/supervise.rs b/zeronsd/src/supervise.rs similarity index 100% rename from src/supervise.rs rename to zeronsd/src/supervise.rs diff --git a/src/tests.rs b/zeronsd/src/tests.rs similarity index 97% rename from src/tests.rs rename to zeronsd/src/tests.rs index f9e2efb..32ab2a7 100644 --- a/src/tests.rs +++ b/zeronsd/src/tests.rs @@ -75,13 +75,12 @@ fn test_parse_ip_from_cidr() { #[test] fn test_domain_or_default() { - use crate::utils::{domain_or_default, DOMAIN_NAME}; - use std::str::FromStr; + use crate::utils::{domain_or_default, DEFAULT_DOMAIN_NAME}; use trust_dns_server::client::rr::Name; assert_eq!( domain_or_default(None).unwrap(), - Name::from_str(DOMAIN_NAME).unwrap() + Name::from_str(DEFAULT_DOMAIN_NAME).unwrap() ); assert_eq!( @@ -169,7 +168,7 @@ fn test_supervise_systemd_green() { } for (name, mut props) in table { - let path = std::path::PathBuf::from(format!("testdata/supervise/systemd/{}.unit", name)); + let path = std::path::PathBuf::from(format!("../testdata/supervise/systemd/{}.unit", name)); if !write { let path = path.canonicalize(); @@ -392,7 +391,7 @@ fn test_parse_hosts_duplicate() { let domain = Name::from_str("zombocom").unwrap(); let res = parse_hosts( - Some(PathBuf::from("testdata/hosts-files/duplicates")), + Some(PathBuf::from("../testdata/hosts-files/duplicates")), domain.clone(), ); diff --git a/src/traits.rs b/zeronsd/src/traits.rs similarity index 99% rename from src/traits.rs rename to zeronsd/src/traits.rs index 8083e7f..af5854d 100644 --- a/src/traits.rs +++ b/zeronsd/src/traits.rs @@ -161,6 +161,7 @@ mod tests { network_id: None, name: None, last_online: None, + last_seen: None, id: None, hidden: None, description: None, diff --git a/src/utils.rs b/zeronsd/src/utils.rs similarity index 94% rename from src/utils.rs rename to zeronsd/src/utils.rs index 1dcefd5..fa99ba6 100644 --- a/src/utils.rs +++ b/zeronsd/src/utils.rs @@ -10,9 +10,8 @@ use anyhow::anyhow; use crate::traits::ToHostname; // collections of test hosts files -pub const TEST_HOSTS_DIR: &str = "testdata/hosts-files"; -// default domain parameter. FIXME change to home.arpa. -pub const DOMAIN_NAME: &str = "home.arpa."; +pub const TEST_HOSTS_DIR: &str = "../testdata/hosts-files"; +pub const DEFAULT_DOMAIN_NAME: &str = "home.arpa."; // zeronsd version calculated from Cargo.toml pub const VERSION_STRING: &str = env!("CARGO_PKG_VERSION"); // address of Central @@ -126,7 +125,7 @@ pub fn domain_or_default(tld: Option<&str>) -> Result { } }; - Ok(Name::from_str(DOMAIN_NAME)?) + Ok(Name::from_str(DEFAULT_DOMAIN_NAME)?) } // parse_member_name ensures member names are DNS compliant @@ -167,7 +166,7 @@ pub async fn get_member_name( fn local_client_from_file( authtoken_path: &Path, local_url: String, -) -> Result { +) -> Result { let authtoken = std::fs::read_to_string(authtoken_path)?; local_client(authtoken, local_url) } @@ -175,11 +174,11 @@ fn local_client_from_file( pub fn local_client( authtoken: String, local_url: String, -) -> Result { +) -> Result { let mut headers = HeaderMap::new(); headers.insert("X-ZT1-Auth", HeaderValue::from_str(&authtoken)?); - Ok(zerotier_one_api::Client::new_with_client( + Ok(zerotier_service_api::Client::new_with_client( &local_url, reqwest::Client::builder() .user_agent(version()) @@ -204,7 +203,7 @@ pub async fn get_listen_ips( network_id )), Ok(listen) => { - let assigned = listen.subtype_1.assigned_addresses.to_owned(); + let assigned = listen.assigned_addresses.to_owned(); if !assigned.is_empty() { Ok(assigned) } else {