@nsshunt/stsoauth2plugin 0.1.22 → 0.1.25
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/dist/Utils/CryptoUtils.js +32 -0
- package/dist/Utils/CryptoUtils.js.map +1 -0
- package/dist/Utils/QueryParams.js +49 -0
- package/dist/Utils/QueryParams.js.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.js +8 -0
- package/dist/index.test.js.map +1 -0
- package/dist/stsStorage.js +152 -0
- package/dist/stsStorage.js.map +1 -0
- package/dist/stsoauth2manager.js +325 -0
- package/dist/stsoauth2manager.js.map +1 -0
- package/dist/stsoauth2types.js +29 -0
- package/dist/stsoauth2types.js.map +1 -0
- package/dist/stsoauth2worker.js +553 -0
- package/dist/stsoauth2worker.js.map +1 -0
- package/package.json +3 -6
- package/src/stsoauth2manager.ts +2 -4
- package/src/stsoauth2types.ts +1 -3
- package/types/stsoauth2manager.d.ts.map +1 -1
- package/types/stsoauth2types.d.ts +1 -2
- package/types/stsoauth2types.d.ts.map +1 -1
- package/package-vite-backup.json +0 -62
- package/vite.config.ts +0 -120
package/src/stsoauth2manager.ts
CHANGED
|
@@ -10,8 +10,6 @@ import { IAuthorizeOptions, IAuthorizeResponse, IAuthorizeErrorResponse, Authent
|
|
|
10
10
|
ISTSOAuth2ManagerOptions, IOauth2ListenerMessage, IOauth2ListenerMessageResponse,
|
|
11
11
|
IOauth2ListenerCommand, StsOauth2WorkerFactory } from './stsoauth2types'
|
|
12
12
|
|
|
13
|
-
import { Router } from 'vue-router' //@@ only need the type
|
|
14
|
-
|
|
15
13
|
import { IStsStorage, ClientStorageType, ClientStorageFactory } from './stsStorage'
|
|
16
14
|
|
|
17
15
|
//import createPersistedState from "vuex-persistedstate"; // https://www.npmjs.com/package/vuex-persistedstate
|
|
@@ -21,7 +19,7 @@ import jwt_decode from "jwt-decode";
|
|
|
21
19
|
// STS Client SDK for SPAs
|
|
22
20
|
export class STSOAuth2Manager {
|
|
23
21
|
#storageManager = null;
|
|
24
|
-
#router:
|
|
22
|
+
#router: any = null;
|
|
25
23
|
#store = null;
|
|
26
24
|
#cUtils = new CryptoUtils();
|
|
27
25
|
#qParams = new QueryParams();
|
|
@@ -60,7 +58,7 @@ export class STSOAuth2Manager {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
this.#worker.onerror = function(error) {
|
|
63
|
-
console.log(`this.#worker.onerror = [${error}]`); // green
|
|
61
|
+
console.log(`this.#worker.onerror = [${JSON.stringify(error)}]`); // green
|
|
64
62
|
};
|
|
65
63
|
|
|
66
64
|
const {
|
package/src/stsoauth2types.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Router } from 'vue-router'
|
|
2
|
-
|
|
3
1
|
export enum AuthorizeOptionsResponseType {
|
|
4
2
|
CODE = 'code',
|
|
5
3
|
ID_TOKEN = 'id_token',
|
|
@@ -105,7 +103,7 @@ export interface IOauth2ListenerMessageResponse {
|
|
|
105
103
|
export type StsOauth2WorkerFactory = () => Worker
|
|
106
104
|
|
|
107
105
|
export interface ISTSOAuth2ManagerOptions {
|
|
108
|
-
router:
|
|
106
|
+
router: any
|
|
109
107
|
authenticateEvent?: AuthenticateEvent
|
|
110
108
|
workerFactory?: StsOauth2WorkerFactory
|
|
111
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stsoauth2manager.d.ts","sourceRoot":"","sources":["../src/stsoauth2manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAKpE,OAAO,EACN,wBAAwB,EACwB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"stsoauth2manager.d.ts","sourceRoot":"","sources":["../src/stsoauth2manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAKpE,OAAO,EACN,wBAAwB,EACwB,MAAM,kBAAkB,CAAA;AASzE,qBAAa,gBAAgB;;gBAkBhB,GAAG,KAAA,EAAE,OAAO,EAAE,wBAAwB;IA8PlD,cAAc,QAAY,QAAQ,OAAO,CAAC,CAQzC;IAED,SAAS,QAAa,QAAQ,IAAI,CAAC,CASlC;IAED,cAAc,cAAqB,UAAU,KAAG,QAAQ,OAAO,CAAC,CAoB/D;IAED,MAAM,QAAa,QAAQ,OAAO,CAAC,CAQlC;CACD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Router } from 'vue-router';
|
|
2
1
|
export declare enum AuthorizeOptionsResponseType {
|
|
3
2
|
CODE = "code",
|
|
4
3
|
ID_TOKEN = "id_token",
|
|
@@ -84,7 +83,7 @@ export interface IOauth2ListenerMessageResponse {
|
|
|
84
83
|
}
|
|
85
84
|
export declare type StsOauth2WorkerFactory = () => Worker;
|
|
86
85
|
export interface ISTSOAuth2ManagerOptions {
|
|
87
|
-
router:
|
|
86
|
+
router: any;
|
|
88
87
|
authenticateEvent?: AuthenticateEvent;
|
|
89
88
|
workerFactory?: StsOauth2WorkerFactory;
|
|
90
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stsoauth2types.d.ts","sourceRoot":"","sources":["../src/stsoauth2types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"stsoauth2types.d.ts","sourceRoot":"","sources":["../src/stsoauth2types.ts"],"names":[],"mappings":"AAAA,oBAAY,4BAA4B;IACvC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;CACf;AAED,oBAAY,4BAA4B;IACvC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,SAAS,cAAc;CACvB;AAGD,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,4BAA4B,EAAE,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,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AAY,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAI3D,oBAAY,sBAAsB;IACjC,eAAe,mBAAmB;IAClC,SAAS,cAAc;IACvB,eAAe,mBAAmB;IAClC,MAAM,WAAW;IACjB,kBAAkB,sBAAsB;IACxC,KAAK,UAAU;CACf;AAED,MAAM,WAAW,sBAAsB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,OAAO,CAAC,EAAE,GAAG,CAAA;CACb;AAED,MAAM,WAAW,8BAA8B;IAC9C,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,OAAO,EAAE,GAAG,CAAA;CACZ;AAED,oBAAY,sBAAsB,GAAG,MAAM,MAAM,CAAA;AAEjD,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,GAAG,CAAA;IACX,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,aAAa,CAAC,EAAE,sBAAsB,CAAA;CACtC"}
|
package/package-vite-backup.json
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nsshunt/stsoauth2plugin",
|
|
3
|
-
"version": "0.1.21",
|
|
4
|
-
"description": "STS OAuth2 VUE Plugin",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist",
|
|
7
|
-
"src",
|
|
8
|
-
"types"
|
|
9
|
-
],
|
|
10
|
-
"main": "./dist/stsoauth2plugin.umd.js",
|
|
11
|
-
"module": "./dist/stsoauth2plugin.es.js",
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/stsoauth2plugin.es.js",
|
|
15
|
-
"require": "./dist/stsoauth2plugin.umd.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"types": "./types/index.d.ts",
|
|
19
|
-
"scripts": {
|
|
20
|
-
"lint": "eslint . --ext js,jsx,ts,tsx --fix",
|
|
21
|
-
"test": "jest --detectOpenHandles --no-cache",
|
|
22
|
-
"testwatch": "jest --watchAll --detectOpenHandles --no-cache",
|
|
23
|
-
"build": "tsc",
|
|
24
|
-
"build2": "tsc && vite build"
|
|
25
|
-
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/nsshunt/stsoauth2plugin.git"
|
|
29
|
-
},
|
|
30
|
-
"author": "STS",
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"bugs": {
|
|
33
|
-
"url": "https://github.com/nsshunt/stsoauth2plugin/issues"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@babel/preset-env": "^7.18.2",
|
|
37
|
-
"@babel/preset-typescript": "^7.17.12",
|
|
38
|
-
"@tsconfig/node18": "^1.0.0",
|
|
39
|
-
"@types/debug": "^4.1.7",
|
|
40
|
-
"@types/jest": "^27.5.1",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
42
|
-
"@typescript-eslint/parser": "^5.27.0",
|
|
43
|
-
"eslint": "^8.16.0",
|
|
44
|
-
"jest": "^28.0.2",
|
|
45
|
-
"prettier": "^2.6.2",
|
|
46
|
-
"supertest": "^6.2.2",
|
|
47
|
-
"ts-loader": "^9.3.0",
|
|
48
|
-
"typescript": "^4.7.3"
|
|
49
|
-
},
|
|
50
|
-
"homepage": "https://github.com/nsshunt/stsoauth2plugin#readme",
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@nsshunt/stsutils": "^1.15.1",
|
|
53
|
-
"axios": "^0.27.2",
|
|
54
|
-
"debug": "^4.3.4",
|
|
55
|
-
"es-cookie": "^1.3.2",
|
|
56
|
-
"http-status-codes": "^2.2.0",
|
|
57
|
-
"jwt-decode": "^3.1.2",
|
|
58
|
-
"vite": "^2.9.12",
|
|
59
|
-
"vue-router": "^4.0.16",
|
|
60
|
-
"vue-tsc": "^0.37.3"
|
|
61
|
-
}
|
|
62
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
//import { fileURLToPath, URL } from 'url'
|
|
2
|
-
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
4
|
-
//import vue from '@vitejs/plugin-vue'
|
|
5
|
-
import path from 'path'
|
|
6
|
-
//import fs from 'fs';
|
|
7
|
-
|
|
8
|
-
// https://vitejs.dev/config/
|
|
9
|
-
export default ({ mode }) => {
|
|
10
|
-
//export default defineConfig({
|
|
11
|
-
//process.env = {...process.env, ...loadEnv(mode, process.cwd())};
|
|
12
|
-
// https://github.com/vitejs/vite/issues/1930
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
let envpath = `./.env.${mode}`;
|
|
16
|
-
require('dotenv').config({ path: envpath });
|
|
17
|
-
|
|
18
|
-
console.log(process.env);
|
|
19
|
-
console.log(mode);
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
return defineConfig({
|
|
23
|
-
|
|
24
|
-
build: {
|
|
25
|
-
lib: {
|
|
26
|
-
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
27
|
-
name: 'stsoauth2plugin',
|
|
28
|
-
fileName: (format) => `stsoauth2plugin.${format}.js`,
|
|
29
|
-
//formats: ['es']
|
|
30
|
-
},
|
|
31
|
-
rollupOptions: {
|
|
32
|
-
// make sure to externalize deps that shouldn't be bundled
|
|
33
|
-
// into your library
|
|
34
|
-
external: [
|
|
35
|
-
'vue',
|
|
36
|
-
'vue-router',
|
|
37
|
-
'vue-tsc',
|
|
38
|
-
'axios',
|
|
39
|
-
'debug',
|
|
40
|
-
'jwt-decode',
|
|
41
|
-
'vite',
|
|
42
|
-
'http-status-codes'
|
|
43
|
-
],
|
|
44
|
-
output: {
|
|
45
|
-
// Provide global variables to use in the UMD build
|
|
46
|
-
// for externalized deps
|
|
47
|
-
globals: {
|
|
48
|
-
vue: 'Vue',
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/*
|
|
52
|
-
output: {
|
|
53
|
-
// Provide global variables to use in the UMD build
|
|
54
|
-
// for externalized deps
|
|
55
|
-
globals: {
|
|
56
|
-
vue: 'Vue',
|
|
57
|
-
debug: 'Debug',
|
|
58
|
-
'jwt-decode': 'jwt-decode',
|
|
59
|
-
axios: 'axios'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
*/
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
define: {
|
|
66
|
-
'process.argv': [ process.cwd() ], //@@ only required because of colors - delete ...
|
|
67
|
-
'process.env': { ...process.env },
|
|
68
|
-
// Define process properties used by various imports
|
|
69
|
-
'process.pid': 0,
|
|
70
|
-
'process.stdout': null,
|
|
71
|
-
'process.stderr': null,
|
|
72
|
-
'process.platform': null
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/*
|
|
76
|
-
plugins: [vue()],
|
|
77
|
-
define: {
|
|
78
|
-
'process.argv': [ process.cwd() ], //@@ only required because of colors - delete ...
|
|
79
|
-
'process.env': { ...process.env },
|
|
80
|
-
// Define process properties used by various imports
|
|
81
|
-
'process.pid': 0,
|
|
82
|
-
'process.stdout': null,
|
|
83
|
-
'process.stderr': null,
|
|
84
|
-
'process.platform': null
|
|
85
|
-
},
|
|
86
|
-
resolve: {
|
|
87
|
-
alias: {
|
|
88
|
-
//'@': path.resolve(__dirname, 'src'),
|
|
89
|
-
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
base: '/',
|
|
94
|
-
|
|
95
|
-
// serve --ssl-cert "/etc/letsencrypt/live/stsmda.org/fullchain.pem" --ssl-key "/etc/letsencrypt/live/stsmda.org/privkey.pem" -p 3010 dist
|
|
96
|
-
|
|
97
|
-
server: {
|
|
98
|
-
host: 'stsauth01.stsmda.org'
|
|
99
|
-
,https: {
|
|
100
|
-
key: fs.readFileSync('/etc/letsencrypt/live/stsmda.org/privkey.pem'),
|
|
101
|
-
cert: fs.readFileSync('/etc/letsencrypt/live/stsmda.org/fullchain.pem'),
|
|
102
|
-
passphrase: ''
|
|
103
|
-
}
|
|
104
|
-
,port: 3010 // was working using 3007
|
|
105
|
-
,hmr: {
|
|
106
|
-
protocol: 'wss',
|
|
107
|
-
//host: '192.168.14.1',
|
|
108
|
-
host: 'stsauth01.stsmda.org',
|
|
109
|
-
port: 3010
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
worker: {
|
|
114
|
-
format: 'es'
|
|
115
|
-
}
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|