@studyportals/cors 2.1.0-beta.0 → 2.2.1-0
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/package.json +8 -8
- package/src/domain/allowed-domain-reg-ex-list.d.ts +7 -4
- package/src/domain/allowed-domain-reg-ex-list.js +22 -10
- package/src/domain/cors.js +2 -1
- package/src/domain/enums/scope.d.ts +2 -1
- package/src/domain/enums/scope.js +1 -0
- package/src/implementations/express-middleware.js +2 -1
- package/src/implementations/options.js +2 -1
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/cors",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "mocha test/**/*.test.ts",
|
|
8
8
|
"test:watch": "mocha -w --reporter min test/**/*.test.ts",
|
|
9
|
-
"deploy-patch": "npm version patch && npm run deploy",
|
|
10
|
-
"deploy-minor": "npm version minor && npm run deploy",
|
|
11
|
-
"deploy-major": "npm version major && npm run deploy",
|
|
9
|
+
"deploy-patch": "npm version patch && npm run deploy && npm publish bin",
|
|
10
|
+
"deploy-minor": "npm version minor && npm run deploy && npm publish bin",
|
|
11
|
+
"deploy-major": "npm version major && npm run deploy && npm publish bin",
|
|
12
|
+
"deploy-beta": "npm version prerelease && npm run deploy && npm publish dist --tag beta",
|
|
12
13
|
"prepare-deployment": "cp package.json bin/package.json",
|
|
13
|
-
"deploy": "npm run build && npm run prepare-deployment
|
|
14
|
+
"deploy": "npm run build && npm run prepare-deployment",
|
|
14
15
|
"build": "rm -rf bin && tsc && rm -rf bin/test",
|
|
15
16
|
"lint": "tslint 'src/**/*.ts'",
|
|
16
17
|
"lint-fix": "tslint --fix 'src/**/*.ts'",
|
|
@@ -20,11 +21,10 @@
|
|
|
20
21
|
"author": "SP - Samurai Pizza Cats",
|
|
21
22
|
"license": "BSD3",
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"
|
|
24
|
+
"@types/express": "^4.17.3"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/chai": "^4.1.7",
|
|
27
|
-
"@types/express": "^4.17.3",
|
|
28
28
|
"@types/node": "^10.12.15",
|
|
29
29
|
"chai": "^4.2.0",
|
|
30
30
|
"mocha": "^5.2.0",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"ts-node": "^7.0.1",
|
|
35
35
|
"tslint": "^5.11.0",
|
|
36
36
|
"typemoq": "^2.1.0",
|
|
37
|
-
"typescript": "^
|
|
37
|
+
"typescript": "^3.8.3"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Environment } from './enums/environment';
|
|
2
1
|
export declare const AllowedDomainRegExList: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
0: {
|
|
3
|
+
0: RegExp[];
|
|
4
|
+
1: RegExp[];
|
|
5
|
+
};
|
|
6
|
+
1: {
|
|
7
|
+
0: RegExp[];
|
|
8
|
+
1: RegExp[];
|
|
6
9
|
};
|
|
7
10
|
};
|
|
@@ -5,19 +5,31 @@ const scope_1 = require("./enums/scope");
|
|
|
5
5
|
exports.AllowedDomainRegExList = {
|
|
6
6
|
[scope_1.Scope.Student]: {
|
|
7
7
|
[environment_1.Environment.Production]: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/scholarship\.mastersportal\.com/,
|
|
8
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.mastersportal\.(com|fyi)(?::3030)?$/,
|
|
9
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.bachelorsportal\.(com|fyi)(?::3030)?$/,
|
|
10
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.phdportal\.(com|fyi)(?::3030)?$/,
|
|
11
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.preparationcoursesportal\.(com|fyi)(?::3030)?$/,
|
|
12
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.distancelearningportal\.(com|fyi)(?::3030)?$/,
|
|
13
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.shortcoursesportal\.(com|fyi)(?::3030)?$/,
|
|
14
|
+
/^https?:\/\/studentemailing\.prtl\.co$/,
|
|
15
|
+
/^https?:\/\/scholarship\.mastersportal\.com$/,
|
|
16
|
+
/^https?:\/\/search-page\.prtl\.co$/,
|
|
18
17
|
],
|
|
19
18
|
[environment_1.Environment.Testing]: [
|
|
20
19
|
/(.*?)/,
|
|
21
20
|
],
|
|
22
21
|
},
|
|
22
|
+
[scope_1.Scope.Currency]: {
|
|
23
|
+
[environment_1.Environment.Production]: [
|
|
24
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.mastersportal\.(com|fyi)(?::3030)?$/,
|
|
25
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.bachelorsportal\.(com|fyi)(?::3030)?$/,
|
|
26
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.phdportal\.(com|fyi)(?::3030)?$/,
|
|
27
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.preparationcoursesportal\.(com|fyi)(?::3030)?$/,
|
|
28
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.distancelearningportal\.(com|fyi)(?::3030)?$/,
|
|
29
|
+
/^https?:\/\/(www(?:\.dev)?|cypress\.rc|[0-9]{4,16}(?:-bob)?\.rc)\.shortcoursesportal\.(com|fyi)(?::3030)?$/,
|
|
30
|
+
],
|
|
31
|
+
[environment_1.Environment.Testing]: [
|
|
32
|
+
/(.*?)/,
|
|
33
|
+
],
|
|
34
|
+
}
|
|
23
35
|
};
|
package/src/domain/cors.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
5
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
6
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
9
|
});
|
|
9
10
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
5
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
6
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
9
|
});
|
|
9
10
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
5
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
6
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
9
|
});
|
|
9
10
|
};
|