fix(packaging): reject arbitrary Snap YAML aliases

This commit is contained in:
4gray committed 2026-07-17 22:42:37 +02:00
1 parent 809182ca06
commit 601501a4b0
2 files changed
+3 -3

No files matched your search

@@ -520,7 +520,7 @@ function containsUnsupportedYamlSemantics(lines) {
blockScalarParentIndent = null;
const syntax = yamlSyntaxOutsideQuotedScalars(line);
if (
/(?:^|[\s:[\]{},])(?:[&*][A-Za-z0-9_-]+|![^\s,[\]{}]+)(?=$|[\s,\]}])/.test(
/(?:^|[\s:[\]{},])(?:[&*][^\s,[\]{}]+|![^\s,[\]{}]+)(?=$|[\s,\]}])/.test(
syntax
) ||
/(?:^|\s)<<\s*:/.test(syntax)
@@ -665,10 +665,10 @@ test('requires a private top-level shared-memory plug used by the Snap app', ()
[
(contents) =>
[
'shared-interface: &sharedInterface shared-memory',
'shared-interface: &shared.interface shared-memory',
contents.replace(
'\nplugs:\n',
'\nplugs:\n alias-plug:\n interface: *sharedInterface\n'
'\nplugs:\n alias-plug:\n interface: *shared.interface\n'
),
].join('\n'),
/anchors, aliases, merge keys, or custom tags/i,