@forge/csp
Advanced tools
Comparing version 1.0.0 to 1.0.1-next.0
# @forge/csp | ||
## 1.0.1-next.0 | ||
### Patch Changes | ||
- 4ef25ff: change occurrences of Csp to CSP for consistency | ||
## 1.0.0 | ||
@@ -4,0 +10,0 @@ |
@@ -6,4 +6,4 @@ import type { LambdaEnvironment } from '@forge/cli-shared'; | ||
private getForgeGlobalCSP; | ||
getInjectableCSP: (existingCspDetails: CSPDetails, env: LambdaEnvironment, tunnelCspReporterUri?: string | undefined) => string[]; | ||
getInjectableCSP: (existingCSPDetails: CSPDetails, env: LambdaEnvironment, tunnelCSPReporterUri?: string | undefined) => string[]; | ||
} | ||
//# sourceMappingURL=csp-injection-service.d.ts.map |
@@ -12,9 +12,9 @@ "use strict"; | ||
constructor() { | ||
this.getInjectableCSP = (existingCspDetails, env, tunnelCspReporterUri) => { | ||
const reportUri = this.getCSPReportUri(env, tunnelCspReporterUri); | ||
this.getInjectableCSP = (existingCSPDetails, env, tunnelCSPReporterUri) => { | ||
const reportUri = tunnelCSPReporterUri || this.getCSPReportUri(env); | ||
const defaultSrc = `'self'`; | ||
const imgSrc = ["'self'", 'data:', 'blob:', gravatarUrl, ...avatarCdnHosts[env]].join(' '); | ||
const mediaSrc = ["'self'", 'data:', 'blob:'].join(' '); | ||
const scriptSrc = ["'self'", this.getForgeGlobalCSP(env), ...existingCspDetails['script-src']].join(' '); | ||
const styleSrc = ["'self'", ...existingCspDetails['style-src']].join(' '); | ||
const scriptSrc = ["'self'", this.getForgeGlobalCSP(env), ...existingCSPDetails['script-src']].join(' '); | ||
const styleSrc = ["'self'", ...existingCSPDetails['style-src']].join(' '); | ||
return [ | ||
@@ -32,5 +32,5 @@ `default-src ${defaultSrc}`, | ||
} | ||
getCSPReportUri(env, tunnelCspReporterUri) { | ||
if (tunnelCspReporterUri) | ||
return tunnelCspReporterUri; | ||
getCSPReportUri(env, tunnelCSPReporterUri) { | ||
if (tunnelCSPReporterUri) | ||
return tunnelCSPReporterUri; | ||
if (env === 'prod') | ||
@@ -37,0 +37,0 @@ return 'https://web-security-reports.services.atlassian.com/csp-report/forge-cdn'; |
{ | ||
"name": "@forge/csp", | ||
"version": "1.0.0", | ||
"version": "1.0.1-next.0", | ||
"description": "Contains the CSP configuration for Custom UI resources in Forge", | ||
@@ -14,3 +14,3 @@ "main": "out/index.js", | ||
"devDependencies": { | ||
"@forge/cli-shared": "^1.0.0", | ||
"@forge/cli-shared": "^1.0.1-next.0", | ||
"@types/jest": "^26.0.0" | ||
@@ -17,0 +17,0 @@ }, |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8400
2