Skip to content

Conversation

TimvdLippe
Copy link

Before we were accepting any policy name. However, there is a grammar that specifies which characters are valid.

@TimvdLippe TimvdLippe force-pushed the fix-checking-of-policy-name branch 2 times, most recently from bcb9c8c to 1aa3fce Compare August 23, 2025 09:23
src/lib.rs Outdated
actually uses is the global's CSP List. So this function operates on that.
*/
pub fn is_trusted_type_policy_creation_allowed(&self, policy_name: String, created_policy_names: Vec<String>) -> (CheckResult, Vec<Violation>) {
pub fn is_trusted_type_policy_creation_allowed(&self, policy_name: &str, created_policy_names: Vec<&str>) -> (CheckResult, Vec<Violation>) {
Copy link
Member

@jdm jdm Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this could be &[&str] instead of a Vec.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Had to wrangle a bit on the Servo side, but I think I was able to make things work: https://github.com/servo/servo/pull/38886/files#diff-b3e53a3314875c9fede32bfb6ea2ac4b1b5a345ab9f3becc32348ecae11f29f7

@TimvdLippe TimvdLippe force-pushed the fix-checking-of-policy-name branch from 1aa3fce to d01e8cc Compare August 27, 2025 05:23
Before we were accepting any policy name. However, there
is a grammar that specifies which characters are valid.

Signed-off-by: Tim van der Lippe <[email protected]>
@TimvdLippe TimvdLippe force-pushed the fix-checking-of-policy-name branch from d01e8cc to f8143ed Compare August 27, 2025 05:26
@jdm jdm merged commit fc927df into servo:servo-csp Aug 27, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants