chore(#1055): address argus review nits
- rename cap-cap-col → cap-col; add CSS rules for .cap-col and .cap-save-col - drop zero-width-space replace in capability header cells (nowrap makes it a no-op) - add Capability::ALL to hive-sh4re; validate incoming cap strings in post_capabilities
This commit is contained in:
parent
3a1cfa26ec
commit
c7f02993d0
4 changed files with 22 additions and 2 deletions
|
|
@ -2595,6 +2595,12 @@ async fn post_capabilities(
|
|||
if let Some(reject) = guard_agent_name(&state, &logical).await {
|
||||
return reject;
|
||||
}
|
||||
let known: Vec<&str> = hive_sh4re::Capability::ALL.iter().map(|c| c.as_str()).collect();
|
||||
for cap in &body.caps {
|
||||
if !known.contains(&cap.as_str()) {
|
||||
return error_response(&format!("unknown capability: {cap}"));
|
||||
}
|
||||
}
|
||||
if let Err(e) = crate::capabilities::set_caps(&logical, &body.caps) {
|
||||
return error_response(&format!("set capabilities for {logical}: {e}"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue