@forge/csp 3.5.0 → 3.6.0-experimental-19bd64d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { LambdaEnvironment } from '@forge/cli-shared';
|
|
2
2
|
import { CSPDetails } from '../types';
|
|
3
|
+
export declare const ATLASSIAN_IMAGES_HOSTS: {
|
|
4
|
+
[microsEnv in LambdaEnvironment]: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS: string[];
|
|
3
7
|
export declare class CSPInjectionService {
|
|
4
8
|
private getCSPReportUri;
|
|
5
9
|
private getForgeGlobalCSP;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp-injection-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-injection-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"csp-injection-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-injection-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AA2CvD,eAAO,MAAM,sBAAsB,EAAE;KAAG,SAAS,IAAI,iBAAiB,GAAG,MAAM,EAAE;CAoChF,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IA8BlB,gBAAgB;4BAOD,UAAU;mBACnB,iBAAiB;;;;UAI1B,MAAM,EAAE,CA6DV;CACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CSPInjectionService = void 0;
|
|
3
|
+
exports.CSPInjectionService = exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = exports.ATLASSIAN_IMAGES_HOSTS = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const ATLASSIAN_API_GATEWAY_HOST = {
|
|
6
6
|
dev: 'https://api.dev.atlassian.com',
|
|
@@ -30,7 +30,7 @@ const ATLASSIAN_EMOJIS_HOST = {
|
|
|
30
30
|
'fedramp-stg': 'https://pf-emoji-service--cdn.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
|
|
31
31
|
'fedramp-prod': 'https://pf-emoji-service--cdn.us-east-1.prod.cdn.atlassian-us-gov-mod.com'
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
exports.ATLASSIAN_IMAGES_HOSTS = {
|
|
34
34
|
dev: [
|
|
35
35
|
`https://${ATLASSIAN_AVATAR_HOST['dev']}`,
|
|
36
36
|
`https://*.wp.com/${ATLASSIAN_AVATAR_HOST['dev']}/`,
|
|
@@ -67,7 +67,7 @@ const ATLASSIAN_IMAGES_HOSTS = {
|
|
|
67
67
|
ATLASSIAN_EMOJIS_HOST['fedramp-prod']
|
|
68
68
|
]
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
|
|
71
71
|
class CSPInjectionService {
|
|
72
72
|
getCSPReportUri(microsEnv) {
|
|
73
73
|
if (microsEnv === 'dev' || microsEnv === 'stg')
|
|
@@ -130,8 +130,8 @@ class CSPInjectionService {
|
|
|
130
130
|
'data:',
|
|
131
131
|
'blob:',
|
|
132
132
|
hostname,
|
|
133
|
-
...EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
|
|
134
|
-
...ATLASSIAN_IMAGES_HOSTS[microsEnv],
|
|
133
|
+
...exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
|
|
134
|
+
...exports.ATLASSIAN_IMAGES_HOSTS[microsEnv],
|
|
135
135
|
...this.getExistingCSPDetails(types_1.ExternalCspType.IMG_SRC, existingCSPDetails)
|
|
136
136
|
]
|
|
137
137
|
.filter((a) => a)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-experimental-19bd64d",
|
|
4
4
|
"description": "Contains the CSP configuration for Custom UI resources in Forge",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@forge/cli-shared": "6.5.
|
|
15
|
-
"@forge/manifest": "8.
|
|
14
|
+
"@forge/cli-shared": "6.5.2-next.1-experimental-19bd64d",
|
|
15
|
+
"@forge/manifest": "8.4.1-next.1-experimental-19bd64d",
|
|
16
16
|
"@types/jest": "^29.5.12",
|
|
17
17
|
"@types/node": "14.18.63"
|
|
18
18
|
},
|