Skip to content

Commit

Permalink
Better validate ACL configuration (#1187)
Browse files Browse the repository at this point in the history
The ACL configuration may not be a boolean or just any string. It must
be a valid XACML. While we can't easily parse the XACML and check its
correctness, we can at least check if the ACL seems to be XML.

The background for this is that with Opencast 14, `acl = "false"` was a
valid configuration. This silently changed with Opencast 15(?) and
caused Studio to upload ACL files with the contents `false", causing
problems in later processing steps of Opencast. This patch makes this at
least easier to spot.
  • Loading branch information
LukasKalbertodt authored Oct 1, 2024
2 parents a85ca0f + 18c472f commit 8113b79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,11 @@ const SCHEMA = {
return true;
}

if (typeof v === "string") {
if (typeof v === "string" && v.trim().startsWith("<")) {
return v;
}

throw new Error("needs to be 'true', 'false' or a string");
throw new Error("needs to be 'true', 'false' or an XML string");
},
dcc: types.string,
titleField: metaDataField,
Expand Down

0 comments on commit 8113b79

Please sign in to comment.