summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock267
-rw-r--r--angelsharkd/Cargo.toml2
-rw-r--r--angelsharkd/README.md6
-rw-r--r--angelsharkd/src/routes/extensions/mod.rs6
-rw-r--r--angelsharkd/src/routes/extensions/simple_deprov.rs5
-rw-r--r--angelsharkd/src/routes/extensions/simple_deprov/README.md61
-rw-r--r--angelsharkd/src/routes/extensions/simple_deprov/mod.rs70
-rw-r--r--angelsharkd/src/routes/extensions/simple_search/mod.rs6
8 files changed, 256 insertions, 167 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5a272a9..cd177a2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -24,7 +24,7 @@ dependencies = [
[[package]]
name = "angelsharkd"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"anyhow",
"env_logger",
@@ -37,9 +37,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.44"
+version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
+checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"
[[package]]
name = "async-mutex"
@@ -150,15 +150,9 @@ checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663"
[[package]]
name = "cc"
-version = "1.0.70"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0"
-
-[[package]]
-name = "cfg-if"
-version = "0.1.10"
+version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
[[package]]
name = "cfg-if"
@@ -168,9 +162,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "2.33.3"
+version = "2.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
+checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
dependencies = [
"bitflags",
"textwrap",
@@ -178,15 +172,6 @@ dependencies = [
]
[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
name = "cpufeatures"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -201,7 +186,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-utils",
]
@@ -211,7 +196,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
@@ -222,7 +207,7 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"crossbeam-utils",
"lazy_static",
"memoffset",
@@ -235,7 +220,7 @@ version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"lazy_static",
]
@@ -263,9 +248,9 @@ dependencies = [
[[package]]
name = "darling"
-version = "0.13.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12"
+checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4"
dependencies = [
"darling_core",
"darling_macro",
@@ -273,9 +258,9 @@ dependencies = [
[[package]]
name = "darling_core"
-version = "0.13.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3"
+checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324"
dependencies = [
"fnv",
"ident_case",
@@ -287,9 +272,9 @@ dependencies = [
[[package]]
name = "darling_macro"
-version = "0.13.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc"
+checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b"
dependencies = [
"darling_core",
"quote",
@@ -347,24 +332,10 @@ dependencies = [
]
[[package]]
-name = "futures"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
name = "futures-channel"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888"
+checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27"
dependencies = [
"futures-core",
"futures-sink",
@@ -372,35 +343,28 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d"
-
-[[package]]
-name = "futures-io"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
+checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445"
[[package]]
name = "futures-sink"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
+checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af"
[[package]]
name = "futures-task"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99"
+checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12"
[[package]]
name = "futures-util"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
+checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e"
dependencies = [
- "autocfg",
"futures-core",
"futures-sink",
"futures-task",
@@ -420,9 +384,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.3.5"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b21b78895ff1ade3f8df6a9a77917f20dc8b46d0069dd5a3837cf1f507a70ee"
+checksum = "8f072413d126e57991455e0a922b31e4c8ba7c2ffbebf6b78b4f8521397d65cd"
dependencies = [
"bytes",
"fnv",
@@ -445,18 +409,18 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
name = "headers"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855"
+checksum = "a4c4eb0471fcb85846d8b0690695ef354f9afb11cb03cac2e1d7c9253351afb0"
dependencies = [
"base64",
"bitflags",
"bytes",
"headers-core",
"http",
+ "httpdate",
"mime",
"sha-1",
- "time",
]
[[package]]
@@ -490,9 +454,9 @@ dependencies = [
[[package]]
name = "http-body"
-version = "0.4.3"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
+checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6"
dependencies = [
"bytes",
"http",
@@ -507,9 +471,9 @@ checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503"
[[package]]
name = "httpdate"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
+checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "humantime"
@@ -519,9 +483,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.13"
+version = "0.14.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593"
+checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c"
dependencies = [
"bytes",
"futures-channel",
@@ -558,6 +522,15 @@ dependencies = [
]
[[package]]
+name = "instant"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
name = "itoa"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -581,15 +554,15 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.102"
+version = "0.2.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103"
+checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
[[package]]
name = "libssh2-sys"
-version = "0.2.21"
+version = "0.2.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0186af0d8f171ae6b9c4c90ec51898bad5d08a2d5e470903a50d9ad8959cbee"
+checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca"
dependencies = [
"cc",
"libc",
@@ -613,9 +586,9 @@ dependencies = [
[[package]]
name = "lock_api"
-version = "0.3.4"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
+checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
dependencies = [
"scopeguard",
]
@@ -626,7 +599,7 @@ version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
]
[[package]]
@@ -643,9 +616,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
dependencies = [
"autocfg",
]
@@ -668,9 +641,9 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.7.13"
+version = "0.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
+checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc"
dependencies = [
"libc",
"log",
@@ -721,18 +694,18 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl-src"
-version = "111.16.0+1.1.1l"
+version = "300.0.3+3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ab2173f69416cf3ec12debb5823d244127d23a9b127d5a5189aa97c5fa2859f"
+checksum = "c51ecedef28dcb23c303944dce1d44a9729f3d28d59f39e56f0c847329d1b134"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.66"
+version = "0.9.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82"
+checksum = "7df13d165e607909b363a4757a6f133f8a818a74e9d3a98d09c6128e15fa4c73"
dependencies = [
"autocfg",
"cc",
@@ -744,22 +717,23 @@ dependencies = [
[[package]]
name = "parking_lot"
-version = "0.10.2"
+version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
+checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [
+ "instant",
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
-version = "0.7.2"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
+checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
dependencies = [
- "cfg-if 0.1.10",
- "cloudabi",
+ "cfg-if",
+ "instant",
"libc",
"redox_syscall",
"smallvec",
@@ -806,24 +780,24 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
-version = "0.3.19"
+version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
+checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e"
[[package]]
name = "proc-macro2"
-version = "1.0.29"
+version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d"
+checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
dependencies = [
"unicode-xid",
]
[[package]]
name = "quote"
-version = "1.0.9"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
+checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
"proc-macro2",
]
@@ -855,9 +829,12 @@ dependencies = [
[[package]]
name = "redox_syscall"
-version = "0.1.57"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
+checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
+dependencies = [
+ "bitflags",
+]
[[package]]
name = "regex"
@@ -884,9 +861,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "ryu"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568"
[[package]]
name = "scoped-tls"
@@ -902,18 +879,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "serde"
-version = "1.0.130"
+version = "1.0.131"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
+checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.130"
+version = "1.0.131"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
+checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2"
dependencies = [
"proc-macro2",
"quote",
@@ -922,9 +899,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.68"
+version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
+checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"
dependencies = [
"itoa",
"ryu",
@@ -950,7 +927,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6"
dependencies = [
"block-buffer",
- "cfg-if 1.0.0",
+ "cfg-if",
"cpufeatures",
"digest",
"opaque-debug",
@@ -967,15 +944,15 @@ dependencies = [
[[package]]
name = "slab"
-version = "0.4.4"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
+checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
[[package]]
name = "smallvec"
-version = "1.6.1"
+version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
+checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
[[package]]
name = "socket2"
@@ -989,9 +966,9 @@ dependencies = [
[[package]]
name = "ssh2"
-version = "0.9.1"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d876d4d57f6bbf2245d43f7ec53759461f801a446d3693704aa6d27b257844d7"
+checksum = "269343e64430067a14937ae0e3c4ec604c178fb896dde0964b1acd22b3e2eeb1"
dependencies = [
"bitflags",
"libc",
@@ -1007,9 +984,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
-version = "1.0.77"
+version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0"
+checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
dependencies = [
"proc-macro2",
"quote",
@@ -1035,21 +1012,10 @@ dependencies = [
]
[[package]]
-name = "time"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
-dependencies = [
- "libc",
- "wasi",
- "winapi",
-]
-
-[[package]]
name = "tokio"
-version = "1.12.0"
+version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc"
+checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144"
dependencies = [
"autocfg",
"bytes",
@@ -1066,9 +1032,9 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "1.4.1"
+version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb"
+checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e"
dependencies = [
"proc-macro2",
"quote",
@@ -1077,9 +1043,9 @@ dependencies = [
[[package]]
name = "tokio-stream"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
+checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3"
dependencies = [
"futures-core",
"pin-project-lite",
@@ -1088,9 +1054,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.6.8"
+version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd"
+checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0"
dependencies = [
"bytes",
"futures-core",
@@ -1108,11 +1074,11 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
[[package]]
name = "tracing"
-version = "0.1.28"
+version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8"
+checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"log",
"pin-project-lite",
"tracing-core",
@@ -1120,9 +1086,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.20"
+version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf"
+checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
dependencies = [
"lazy_static",
]
@@ -1184,12 +1150,13 @@ dependencies = [
[[package]]
name = "warp"
-version = "0.3.1"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "332d47745e9a0c38636dbd454729b147d16bd1ed08ae67b3ab281c4506771054"
+checksum = "3cef4e1e9114a4b7f1ac799f16ce71c14de5778500c5450ec6b7b920c55b587e"
dependencies = [
"bytes",
- "futures",
+ "futures-channel",
+ "futures-util",
"headers",
"http",
"hyper",
@@ -1210,12 +1177,6 @@ dependencies = [
]
[[package]]
-name = "wasi"
-version = "0.10.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
-
-[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/angelsharkd/Cargo.toml b/angelsharkd/Cargo.toml
index 9fdb00c..0bb1294 100644
--- a/angelsharkd/Cargo.toml
+++ b/angelsharkd/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "angelsharkd"
-version = "0.2.0"
+version = "0.2.1"
edition = "2021"
authors = ["Adam T. Carpenter <adam.carpenter@adp.com>"]
description = "A HTTP interface into one or more Communication Managers"
diff --git a/angelsharkd/README.md b/angelsharkd/README.md
index 8315c74..2287315 100644
--- a/angelsharkd/README.md
+++ b/angelsharkd/README.md
@@ -225,7 +225,11 @@ runtime.
## Login Configuration
-TODO:
+`angelsharkd` uses the same login configuration file syntax as `angelsharkcli`.
+See the
+[`angelsharkcli` README for more information](/angelsharkcli/README.md#login-configuration).
+
+You can download a [sample `asa.cfg.sample`](/asa.cfg.sample) to start with.
## Logging
diff --git a/angelsharkd/src/routes/extensions/mod.rs b/angelsharkd/src/routes/extensions/mod.rs
index cada47f..54053af 100644
--- a/angelsharkd/src/routes/extensions/mod.rs
+++ b/angelsharkd/src/routes/extensions/mod.rs
@@ -8,7 +8,7 @@ mod simple_search;
/// The extension filter; consists of all compiled optional Angelshark extension
/// filters combined under `/extensions`.
-pub fn filter(_config: &Config) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
+pub fn filter(config: &Config) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
// Note: this next line deals with the common edge case of having no
// extensions loaded with feature flags. It ensures that the the type
// checking is right when the return `.and()` is called below.
@@ -17,14 +17,14 @@ pub fn filter(_config: &Config) -> impl Filter<Extract = impl Reply, Error = Rej
// Block to enable simple_search extension feature. Instantiates a
// searchable haystack and configures filters to handle search requests.
#[cfg(feature = "simple_search")]
- let haystack = simple_search::Haystack::new(_config.runner.clone());
+ let haystack = simple_search::Haystack::new(config.runner.clone());
#[cfg(feature = "simple_search")]
let filters = filters
.or(simple_search::search_filter(haystack.clone()))
.or(simple_search::refresh_filter(haystack));
#[cfg(feature = "simple_deprov")]
- let filters = filters.or(simple_deprov::filter());
+ let filters = filters.or(simple_deprov::filter(config.runner.clone()));
path("extensions").and(filters)
}
diff --git a/angelsharkd/src/routes/extensions/simple_deprov.rs b/angelsharkd/src/routes/extensions/simple_deprov.rs
deleted file mode 100644
index 2b5ad40..0000000
--- a/angelsharkd/src/routes/extensions/simple_deprov.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-use warp::{Filter, Rejection, Reply};
-
-pub fn filter() -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
- warp::path("deprov").map(|| -> &str { todo!() }) // TODO:
-}
diff --git a/angelsharkd/src/routes/extensions/simple_deprov/README.md b/angelsharkd/src/routes/extensions/simple_deprov/README.md
new file mode 100644
index 0000000..4900075
--- /dev/null
+++ b/angelsharkd/src/routes/extensions/simple_deprov/README.md
@@ -0,0 +1,61 @@
+# Daemon Extension `simple_deprov`
+
+This extension implements excruciatingly simple extension de-provisioning. For
+example, if an agent was provisioned with a `station-user` and an
+`agent-loginid`, you can submit those extensions, their type, and the ACM they
+were provision on. They relevant commands to remove those objects will be
+executed in parallel, and any errors encountered will be returned.
+
+## Getting Started
+
+To enable this feature, compile `angelsharkd` with the `simple_deprov` flag:
+
+```sh
+cargo build --bin angelsharkd --features simple_deprov ...
+```
+
+## `POST /extensions/deprov` Remove Objects
+
+The request type is TODO:
+
+```json
+POST /extensions/deprov
+[
+ {
+ "station-user": {
+ "acm": "01",
+ "ext": "17571230000"
+ }
+ },
+ {
+ "agent-loginid": {
+ "acm": "01",
+ "ext": "17571240000"
+ }
+ }
+]
+```
+
+If all of the deprov commands were successful, the response is an empty array.
+
+```json
+200 OK
+[]
+```
+
+If there were errors running the relevant deprov commands (such as when an
+extension does not exist), they are included in the resulting array.
+
+```json
+200 OK
+[
+ "ACM lab: 1 00000000 309e Extension exists but assigned to a different object",
+ "ACM lab: 1 00000000 2ed5 Extension assigned as remote extension on the uniform-dialplan form",
+ "ACM lab: 1 00000000 2ed5 Extension assigned as remote extension on the uniform-dialplan form"
+]
+```
+
+## Logging
+
+The `deprov` endpoint always returns successfully. Any errors encountered during
+the command execution are logged as `ERROR`.
diff --git a/angelsharkd/src/routes/extensions/simple_deprov/mod.rs b/angelsharkd/src/routes/extensions/simple_deprov/mod.rs
new file mode 100644
index 0000000..fc734f3
--- /dev/null
+++ b/angelsharkd/src/routes/extensions/simple_deprov/mod.rs
@@ -0,0 +1,70 @@
+use libangelshark::{AcmRunner, Message, ParallelIterator};
+use log::error;
+use serde::Deserialize;
+use std::convert::Infallible;
+use warp::{
+ body::{content_length_limit, json},
+ post, reply, Filter, Rejection, Reply,
+};
+
+const SIXTEEN_K: u64 = 1024 * 16;
+
+/// Returns a warp filter to handle HTTP POSTs for deprovisioning stations, agents, etc.
+pub fn filter(runner: AcmRunner) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
+ warp::path("deprov")
+ .and(post())
+ .and(content_length_limit(SIXTEEN_K))
+ .and(json())
+ .and_then(move |entries| remove_entries(entries, runner.to_owned()))
+}
+
+/// Queues removal commands for [Entries] on an [AcmRunner]. Gathers any errors encountered and returns those.
+async fn remove_entries(entries: Entries, mut runner: AcmRunner) -> Result<impl Reply, Infallible> {
+ // Construct OSSI messages to carry out removals.
+ for entry in entries {
+ match entry {
+ Entry::StationUser { acm, ext } => {
+ runner.queue_input(&acm, &Message::new(&format!("clear amw all {}", ext)));
+ runner.queue_input(&acm, &Message::new(&format!("remove station {}", ext)));
+ }
+ Entry::AgentLoginId { acm, ext } => {
+ runner.queue_input(
+ &acm,
+ &Message::new(&format!("remove agent-loginID {}", ext)),
+ );
+ }
+ }
+ }
+
+ // Gather any errors encountered and format them for the client response.
+ let errors: Vec<String> = runner
+ .run_cached()
+ .map(|(acm, output)| match output {
+ Ok(messages) => messages
+ .into_iter()
+ .filter_map(|message| Some(format!("ACM {}: {}", acm.clone(), message.error?)))
+ .collect(),
+ Err(error) => vec![format!("ACM {}: {}", acm, error)],
+ })
+ .flatten()
+ .collect();
+
+ // Log errors for tracking.
+ for error in &errors {
+ error!("{}", error);
+ }
+
+ Ok(reply::json(&errors))
+}
+
+/// Collection of [Entry].
+type Entries = Vec<Entry>;
+
+/// Very basic [Deserialize] target for deprov inputs. Going from stringly typed to strongly typed.
+#[derive(Debug, Deserialize)]
+enum Entry {
+ #[serde(rename(deserialize = "station-user"))]
+ StationUser { acm: String, ext: String },
+ #[serde(rename(deserialize = "agent-loginid"))]
+ AgentLoginId { acm: String, ext: String },
+}
diff --git a/angelsharkd/src/routes/extensions/simple_search/mod.rs b/angelsharkd/src/routes/extensions/simple_search/mod.rs
index 5b5dc8e..159137a 100644
--- a/angelsharkd/src/routes/extensions/simple_search/mod.rs
+++ b/angelsharkd/src/routes/extensions/simple_search/mod.rs
@@ -21,7 +21,7 @@ pub fn search_filter(
.and(post())
.and(content_length_limit(1024 * 16))
.and(json())
- .and_then(move |terms: Needles| search(haystack.to_owned(), terms))
+ .and_then(move |needles: Needles| search(haystack.to_owned(), needles))
.with(with::header(header::PRAGMA, "no-cache"))
.with(with::header(header::CACHE_CONTROL, "no-store, max-age=0"))
.with(with::header(header::X_FRAME_OPTIONS, "DENY"))
@@ -39,8 +39,6 @@ pub fn refresh_filter(
/// Runs the search request to find all needles in the haystack and converts the
/// results into a reply.
async fn search(haystack: Haystack, needles: Needles) -> Result<impl Reply, Infallible> {
- // Ok(haystack.search(Vec::new())?)
- // if let Ok(matches = haystack.search(needle);
match haystack.search(needles) {
Ok(matches) => Ok(reply::with_status(reply::json(&matches), StatusCode::OK)),
Err(e) => Ok(reply::with_status(
@@ -56,7 +54,7 @@ async fn refresh(haystack: Haystack) -> Result<impl Reply, Infallible> {
// Run refresh as a background task and immediately return.
tokio::spawn(async move {
if let Err(e) = haystack.refresh() {
- error!("{}", e.to_string()); // TODO: use logger
+ error!("{}", e.to_string());
} else {
info!("Search haystack refreshed.");
}