Plan device actions exclusively as approved scripts and provide reboot library revisions
This commit is contained in:
@@ -186,7 +186,7 @@ pub async fn plan(
|
||||
reason: input.reason,
|
||||
artifact_ids: vec![],
|
||||
};
|
||||
jobs::plan_resolved(s, p, tenant, plan, None, Some(reference)).await
|
||||
jobs::plan_resolved(s, p, tenant, plan, Some(reference)).await
|
||||
}
|
||||
|
||||
pub(crate) fn validate_plan_bindings(plan: &rmm_domain::jobs::PlanPayload) -> Result<(), Error> {
|
||||
@@ -263,7 +263,20 @@ pub(crate) mod tests {
|
||||
let tenant = p.tenant;
|
||||
let initial = list(s, p, tenant, PageQuery::default()).await.unwrap();
|
||||
let items = initial["items"].as_array().unwrap();
|
||||
assert_eq!(items.len(), 13);
|
||||
assert_eq!(items.len(), 15);
|
||||
for (name, interpreter, identity) in [
|
||||
("Linux neu starten", "posix_sh", "root"),
|
||||
("Windows neu starten", "powershell", "system"),
|
||||
] {
|
||||
let revision = items.iter().find(|r| r["name"] == name).unwrap();
|
||||
assert_eq!(revision["version"], 1);
|
||||
assert_eq!(revision["interpreter"], interpreter);
|
||||
assert_eq!(revision["execution_identity"], identity);
|
||||
assert_eq!(
|
||||
revision["script_sha256"],
|
||||
hash(revision["script_utf8"].as_str().unwrap().as_bytes())
|
||||
);
|
||||
}
|
||||
let template = items
|
||||
.iter()
|
||||
.find(|item| item["name"] == "Windows-Updates installieren")
|
||||
|
||||
Reference in New Issue
Block a user