feat: add SVG Tools to Toolbox 0.10.0
This commit is contained in:
@@ -83,7 +83,7 @@ function makeLock(artifact: string, sha256: string) {
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
releaseVersion: '0.1.0',
|
||||
portalVersion: '0.2.11',
|
||||
portalVersion: '0.2.12',
|
||||
catalogue: {
|
||||
id: 'de.add-ideas.toolbox',
|
||||
name: 'Test Toolbox',
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('production deployment', () => {
|
||||
expect(containerfile).toContain(
|
||||
'COPY --from=release --chown=101:101 /tmp/toolbox/'
|
||||
);
|
||||
for (const app of ['pdf', 'xslt', 'onenote', 'av', 'regex']) {
|
||||
for (const app of ['pdf', 'xslt', 'onenote', 'av', 'regex', 'svg']) {
|
||||
expect(containerfile).toContain(
|
||||
`test -f /tmp/toolbox/apps/${app}/toolbox-app.json`
|
||||
);
|
||||
@@ -214,4 +214,28 @@ describe('production deployment', () => {
|
||||
expect(nginxConfig).toContain("media-src 'self' blob:");
|
||||
expect(nginxConfig).not.toContain("'unsafe-eval'");
|
||||
});
|
||||
|
||||
it('grants only the sandboxed SVG canvas controller cross-origin loading headers', () => {
|
||||
expect(nginxConfig).toMatch(
|
||||
/map \$uri \$toolbox_resource_policy\s*\{\s*default "same-origin";\s*"\/apps\/svg\/canvas-frame-controller\.js" "cross-origin";\s*\}/mu
|
||||
);
|
||||
expect(nginxConfig).toMatch(
|
||||
/map \$uri \$toolbox_access_control_allow_origin\s*\{\s*default "";\s*"\/apps\/svg\/canvas-frame-controller\.js" "\*";\s*\}/mu
|
||||
);
|
||||
expect(nginxConfig).toContain(
|
||||
'add_header Cross-Origin-Resource-Policy $toolbox_resource_policy always;'
|
||||
);
|
||||
expect(nginxConfig).toContain(
|
||||
'add_header Access-Control-Allow-Origin $toolbox_access_control_allow_origin always;'
|
||||
);
|
||||
expect(nginxConfig).not.toMatch(
|
||||
/location[^\n{]*canvas-frame-controller[^\n{]*\{/u
|
||||
);
|
||||
expect(
|
||||
nginxConfig.match(/^\s*add_header X-Content-Type-Options /gmu)
|
||||
).toHaveLength(1);
|
||||
expect(
|
||||
nginxConfig.match(/^\s*add_header Content-Security-Policy /gmu)
|
||||
).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user