summaryrefslogtreecommitdiff
path: root/angelsharkd
diff options
context:
space:
mode:
authorCarpenter, Adam (CORP) <adam.carpenter@adp.com>2021-12-10 10:11:27 -0500
committerCarpenter, Adam (CORP) <adam.carpenter@adp.com>2021-12-10 10:11:27 -0500
commita91ee6ff6467d131c76151fb18ca2c55345db188 (patch)
tree4046c53e531d0d63bc6793234d45f794ca5fd03c /angelsharkd
parent8c1c700ec1d5a28a2d85c662ec48db0a8ff84707 (diff)
downloadaltruistic-angelshark-a91ee6ff6467d131c76151fb18ca2c55345db188.tar.xz
altruistic-angelshark-a91ee6ff6467d131c76151fb18ca2c55345db188.zip
feat: impl deprov runner queueing from requests
Diffstat (limited to 'angelsharkd')
-rw-r--r--angelsharkd/src/routes/extensions/simple_deprov.rs30
1 files changed, 16 insertions, 14 deletions
diff --git a/angelsharkd/src/routes/extensions/simple_deprov.rs b/angelsharkd/src/routes/extensions/simple_deprov.rs
index de45d9b..eb6f04b 100644
--- a/angelsharkd/src/routes/extensions/simple_deprov.rs
+++ b/angelsharkd/src/routes/extensions/simple_deprov.rs
@@ -15,7 +15,22 @@ pub fn filter(runner: AcmRunner) -> impl Filter<Extract = impl Reply, Error = Re
.and_then(move |entries: Entries| remove_entries(entries, runner.to_owned()))
}
-async fn remove_entries(entries: Entries, runner: AcmRunner) -> Result<impl Reply, Infallible> {
+async fn remove_entries(entries: Entries, mut runner: AcmRunner) -> Result<impl Reply, Infallible> {
+ 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)),
+ );
+ }
+ }
+ }
+ dbg!(&runner);
Ok("")
}
@@ -28,16 +43,3 @@ enum Entry {
#[serde(rename(deserialize = "agent-loginid"))]
AgentLoginId { acm: String, ext: String },
}
-
-impl From<Entry> for Vec<Message> {
- fn from(entry: Entry) -> Self {
- match entry {
- Entry::StationUser { acm, ext } => {
- vec![Message::new(&format!("clear amw all {}", ext))]
- }
- Entry::AgentLoginId { acm, ext } => {
- todo!()
- }
- }
- }
-}