@forge/csp 5.8.0 → 5.8.1-experimental-04cc2b9
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 +18 -0
- package/out/csp/csp-injection-service.d.ts +9 -9
- package/out/csp/csp-injection-service.d.ts.map +1 -1
- package/out/csp/csp-injection-service.js +6 -6
- package/out/csp/csp-processing-service.d.ts +1 -1
- package/out/csp/csp-processing-service.d.ts.map +1 -1
- package/out/types.d.ts +4 -6
- package/out/types.d.ts.map +1 -1
- package/out/types.js +1 -1
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @forge/csp
|
|
2
2
|
|
|
3
|
+
## 5.8.1-experimental-04cc2b9
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d9ef926: Adds support for TypeScript 5
|
|
8
|
+
|
|
9
|
+
## 5.8.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4f3fb5e: Updates emoji image src urls
|
|
14
|
+
|
|
15
|
+
## 5.8.1-next.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 4f3fb5e: Updates emoji image src urls
|
|
20
|
+
|
|
3
21
|
## 5.8.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { LambdaEnvironment } from '@forge/cli-shared';
|
|
2
2
|
import { CSPDetails } from '../types';
|
|
3
|
-
|
|
3
|
+
type StandardIcOptions = {
|
|
4
4
|
icLabel: string;
|
|
5
5
|
serviceName: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type GetICDomainIcOptions = {
|
|
8
8
|
serviceName?: string;
|
|
9
9
|
getICDomain: () => string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type IcOptions = StandardIcOptions | GetICDomainIcOptions;
|
|
12
12
|
export declare const getAtlassianImageHost: (microsEnv: LambdaEnvironment, icOptions?: IcOptions) => string[];
|
|
13
13
|
export declare const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS: string[];
|
|
14
14
|
export declare class CSPInjectionService {
|
|
@@ -21,12 +21,12 @@ export declare class CSPInjectionService {
|
|
|
21
21
|
getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain }: {
|
|
22
22
|
existingCSPDetails: CSPDetails;
|
|
23
23
|
microsEnv: LambdaEnvironment;
|
|
24
|
-
tunnelCSPReporterUri?: string
|
|
25
|
-
hostname?: string
|
|
26
|
-
isFedRAMP?: boolean
|
|
27
|
-
icOptions?: IcOptions
|
|
28
|
-
macroParentHost?: string
|
|
29
|
-
connectMacroParentDomain?: string
|
|
24
|
+
tunnelCSPReporterUri?: string;
|
|
25
|
+
hostname?: string;
|
|
26
|
+
isFedRAMP?: boolean;
|
|
27
|
+
icOptions?: IcOptions;
|
|
28
|
+
macroParentHost?: string;
|
|
29
|
+
connectMacroParentDomain?: string;
|
|
30
30
|
}) => string[];
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -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;AAEvD,
|
|
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;AAEvD,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,KAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AA+K1D,eAAO,MAAM,qBAAqB,GAAI,WAAW,iBAAiB,EAAE,YAAY,SAAS,KAAG,MAAM,EAWjG,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,iBAAiB;IAuElB,gBAAgB,GAAI,oIASxB;QACD,kBAAkB,EAAE,UAAU,CAAC;QAC/B,SAAS,EAAE,iBAAiB,CAAC;QAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC,KAAG,MAAM,EAAE,CAgGV;CACH"}
|
|
@@ -67,12 +67,12 @@ const ATLASSIAN_HOST = {
|
|
|
67
67
|
...makeICHosts((env, icOptions) => `https://teams-directory-frontend.services.${getICDomain(env, icOptions)}/bfa/`)
|
|
68
68
|
},
|
|
69
69
|
ATLASSIAN_EMOJIS_HOST: {
|
|
70
|
-
dev: 'https://pf-emoji-service
|
|
71
|
-
stg: 'https://pf-emoji-service
|
|
72
|
-
prod: 'https://pf-emoji-service
|
|
73
|
-
'fedramp-stg': 'https://pf-emoji-service
|
|
74
|
-
'fedramp-prod': 'https://pf-emoji-service
|
|
75
|
-
...makeICHosts((env, icOptions) => `https://pf-emoji-service
|
|
70
|
+
dev: 'https://pf-emoji-service.ddev.frontend.public.atl-paas.net',
|
|
71
|
+
stg: 'https://pf-emoji-service.stg-east.frontend.public.atl-paas.net',
|
|
72
|
+
prod: 'https://pf-emoji-service.prod-east.frontend.public.atl-paas.net',
|
|
73
|
+
'fedramp-stg': 'https://pf-emoji-service.frontend.staging.cdn.atlassian-us-gov-mod.com',
|
|
74
|
+
'fedramp-prod': 'https://pf-emoji-service.frontend.cdn.atlassian-us-gov-mod.com',
|
|
75
|
+
...makeICHosts((env, icOptions) => `https://pf-emoji-service.${getICDomain(env, icOptions)}/bfa/emoji-service/`)
|
|
76
76
|
},
|
|
77
77
|
ATLASSIAN_FOP_GE_HOST: {
|
|
78
78
|
dev: 'https://forge-outbound-proxy.dev.services.atlassian.com',
|
|
@@ -2,7 +2,7 @@ import type { Logger } from '@forge/cli-shared';
|
|
|
2
2
|
import type { Permissions } from '@forge/manifest';
|
|
3
3
|
import type { CheerioAPI, CheerioOptions } from 'cheerio/slim';
|
|
4
4
|
import { ContentPermissions, CSPDetails, DocumentBody } from '../types';
|
|
5
|
-
|
|
5
|
+
type CheerioLoader = (document: DocumentBody, options?: CheerioOptions) => CheerioAPI;
|
|
6
6
|
export declare class InvalidConnectSrc extends Error {
|
|
7
7
|
constructor();
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp-processing-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-processing-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAS,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"csp-processing-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-processing-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,C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
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type { Permissions } from '@forge/manifest';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export type DocumentBody = string | Buffer;
|
|
3
|
+
export type ContentPermissions = NonNullable<Permissions['content']>;
|
|
4
|
+
export type ExternalPermissions = NonNullable<Permissions['external']>;
|
|
7
5
|
export declare enum ExternalCspType {
|
|
8
6
|
IMG_SRC = "img-src",
|
|
9
7
|
MEDIA_SRC = "media-src",
|
|
@@ -13,5 +11,5 @@ export declare enum ExternalCspType {
|
|
|
13
11
|
FONT_SRC = "font-src",
|
|
14
12
|
FRAME_SRC = "frame-src"
|
|
15
13
|
}
|
|
16
|
-
export
|
|
14
|
+
export type CSPDetails = Record<ExternalCspType, string[]>;
|
|
17
15
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AACD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC,CAAC"}
|
package/out/types.js
CHANGED
|
@@ -10,4 +10,4 @@ var ExternalCspType;
|
|
|
10
10
|
ExternalCspType["CONNECT_SRC"] = "connect-src";
|
|
11
11
|
ExternalCspType["FONT_SRC"] = "font-src";
|
|
12
12
|
ExternalCspType["FRAME_SRC"] = "frame-src";
|
|
13
|
-
})(ExternalCspType
|
|
13
|
+
})(ExternalCspType || (exports.ExternalCspType = ExternalCspType = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1-experimental-04cc2b9",
|
|
4
4
|
"description": "Contains the CSP configuration for Custom UI resources in Forge",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -11,21 +11,26 @@
|
|
|
11
11
|
"clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@forge/cli-shared": "8.
|
|
15
|
-
"@forge/manifest": "12.
|
|
14
|
+
"@forge/cli-shared": "8.24.0-experimental-04cc2b9",
|
|
15
|
+
"@forge/manifest": "12.9.0-experimental-04cc2b9",
|
|
16
16
|
"@types/jest": "^29.5.14",
|
|
17
17
|
"@types/node": "20.19.1",
|
|
18
|
-
"cheerio": "^1.1.0"
|
|
18
|
+
"cheerio": "^1.1.0",
|
|
19
|
+
"typescript": "5.9.2"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"content-security-policy-parser": "^0.6.0"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
|
-
"cheerio": "^1.1.0"
|
|
25
|
+
"cheerio": "^1.1.0",
|
|
26
|
+
"typescript": ">=5.0.0"
|
|
25
27
|
},
|
|
26
28
|
"peerDependenciesMeta": {
|
|
27
29
|
"cheerio": {
|
|
28
30
|
"optional": true
|
|
31
|
+
},
|
|
32
|
+
"typescript": {
|
|
33
|
+
"optional": true
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|