@intuitionrobotics/user-account 0.45.1 → 0.46.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/app-backend/api/_user-account.js +2 -20
- package/app-backend/api/_user-account.js.map +1 -1
- package/app-backend/api/v1/account/_assert.d.ts +3 -2
- package/app-backend/api/v1/account/_assert.js +6 -24
- package/app-backend/api/v1/account/_assert.js.map +1 -1
- package/app-backend/api/v1/account/create.js +6 -24
- package/app-backend/api/v1/account/create.js.map +1 -1
- package/app-backend/api/v1/account/list.js +6 -24
- package/app-backend/api/v1/account/list.js.map +1 -1
- package/app-backend/api/v1/account/login-saml.js +4 -22
- package/app-backend/api/v1/account/login-saml.js.map +1 -1
- package/app-backend/api/v1/account/login.js +12 -24
- package/app-backend/api/v1/account/login.js.map +1 -1
- package/app-backend/api/v1/account/logout.js +9 -26
- package/app-backend/api/v1/account/logout.js.map +1 -1
- package/app-backend/api/v1/account/upsert.js +10 -9
- package/app-backend/api/v1/account/upsert.js.map +1 -1
- package/app-backend/api/v1/account/validate.js +6 -24
- package/app-backend/api/v1/account/validate.js.map +1 -1
- package/app-backend/apis/add-new-account.d.ts +3 -3
- package/app-backend/apis/add-new-account.js +12 -24
- package/app-backend/apis/add-new-account.js.map +1 -1
- package/app-backend/core/module-pack.d.ts +0 -2
- package/app-backend/core/module-pack.js +0 -30
- package/app-backend/core/module-pack.js.map +1 -1
- package/app-backend/modules/AccountModule.d.ts +10 -7
- package/app-backend/modules/AccountModule.js +55 -79
- package/app-backend/modules/AccountModule.js.map +1 -1
- package/app-backend/modules/JWTBuilder.d.ts +1 -1
- package/app-backend/modules/JWTBuilder.js +6 -5
- package/app-backend/modules/JWTBuilder.js.map +1 -1
- package/app-backend/modules/SamlModule.d.ts +3 -2
- package/app-backend/modules/SamlModule.js +7 -23
- package/app-backend/modules/SamlModule.js.map +1 -1
- package/app-backend/modules/SecretsModule.d.ts +4 -2
- package/app-backend/modules/SecretsModule.js +30 -27
- package/app-backend/modules/SecretsModule.js.map +1 -1
- package/app-backend/modules/{_imports.d.ts → types.d.ts} +1 -2
- package/app-backend/modules/types.js +3 -0
- package/app-backend/modules/types.js.map +1 -0
- package/app-frontend/core/module-pack.d.ts +0 -1
- package/app-frontend/core/module-pack.js +0 -29
- package/app-frontend/core/module-pack.js.map +1 -1
- package/app-frontend/modules/AccountModule.d.ts +3 -2
- package/app-frontend/modules/AccountModule.js +38 -50
- package/app-frontend/modules/AccountModule.js.map +1 -1
- package/index.d.ts +0 -2
- package/index.js +0 -31
- package/index.js.map +1 -1
- package/package.json +5 -6
- package/shared/api.d.ts +1 -1
- package/shared/api.js +0 -18
- package/shared/api.js.map +1 -1
- package/shared/utils/AuthenticationConsts.js.map +1 -1
- package/app-backend/api/v1/account/_imports.d.ts +0 -4
- package/app-backend/api/v1/account/_imports.js +0 -36
- package/app-backend/api/v1/account/_imports.js.map +0 -1
- package/app-backend/modules/_imports.js +0 -32
- package/app-backend/modules/_imports.js.map +0 -1
- package/app-frontend/ui/Component_Login.d.ts +0 -21
- package/app-frontend/ui/Component_Login.js +0 -86
- package/app-frontend/ui/Component_Login.js.map +0 -1
- package/app-frontend/ui/Component_Register.d.ts +0 -17
- package/app-frontend/ui/Component_Register.js +0 -92
- package/app-frontend/ui/Component_Register.js.map +0 -1
- package/backend.d.ts +0 -2
- package/backend.js +0 -33
- package/backend.js.map +0 -1
- package/frontend.d.ts +0 -3
- package/frontend.js +0 -34
- package/frontend.js.map +0 -1
- package/shared/types.d.ts +0 -0
- package/shared/types.js +0 -20
- package/shared/types.js.map +0 -1
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SecretsModule = exports.SecretsModule_Class = exports.TokenExpiredException = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const exceptions_1 = require("@intuitionrobotics/thunderstorm/app-backend/exceptions");
|
|
5
|
+
const exceptions_2 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
6
|
+
const module_1 = require("@intuitionrobotics/ts-common/core/module");
|
|
7
|
+
const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
|
|
8
|
+
const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
|
|
6
9
|
const jws = require("jws");
|
|
10
|
+
const AuthenticationConsts_1 = require("../../shared/utils/AuthenticationConsts");
|
|
7
11
|
const JWTBuilder_1 = require("./JWTBuilder");
|
|
8
|
-
|
|
9
|
-
class TokenExpiredException extends backend_1.ApiException {
|
|
12
|
+
class TokenExpiredException extends exceptions_1.ApiException {
|
|
10
13
|
constructor(message, cause) {
|
|
11
14
|
super(401, message, cause);
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
exports.TokenExpiredException = TokenExpiredException;
|
|
15
|
-
class SecretsModule_Class extends
|
|
18
|
+
class SecretsModule_Class extends module_1.Module {
|
|
16
19
|
constructor() {
|
|
17
20
|
super("SecretsModule");
|
|
18
21
|
this.DEFAULT_ISS = "TOOLS";
|
|
19
|
-
this.AUTHENTICATION_PREFIX =
|
|
20
|
-
this.AUTHENTICATION_KEY =
|
|
22
|
+
this.AUTHENTICATION_PREFIX = AuthenticationConsts_1.AUTHENTICATION_PREFIX;
|
|
23
|
+
this.AUTHENTICATION_KEY = AuthenticationConsts_1.AUTHENTICATION_KEY;
|
|
21
24
|
this.getAuthSecret = (kid) => {
|
|
22
25
|
return this.getSecret(kid);
|
|
23
26
|
};
|
|
24
27
|
this.getConfig = () => {
|
|
25
28
|
if (!this.config)
|
|
26
|
-
throw new
|
|
29
|
+
throw new exceptions_2.BadImplementationException(`Missing config, check SecretsModule's config`);
|
|
27
30
|
if (!this.config.secrets)
|
|
28
|
-
throw new
|
|
31
|
+
throw new exceptions_2.BadImplementationException(`Missing 'secrets' key in config, check SecretsModule's config`);
|
|
29
32
|
return this.config.secrets;
|
|
30
33
|
};
|
|
31
34
|
this.isExpired = (token) => {
|
|
32
|
-
return this.getExpiration(token) <
|
|
35
|
+
return this.getExpiration(token) < date_time_tools_1.currentTimeMillies();
|
|
33
36
|
};
|
|
34
37
|
this.generateJwt = (payload, kid, algorithm = "HS256") => {
|
|
35
38
|
const secret = this.getAuthSecret(kid);
|
|
36
39
|
return new JWTBuilder_1.JWTBuilder(algorithm)
|
|
37
40
|
// This is a default that can be overwritten by the claims
|
|
38
|
-
.setExpiration(Math.floor((
|
|
41
|
+
.setExpiration(Math.floor((date_time_tools_1.currentTimeMillies() + date_time_tools_1.Day) / 1000))
|
|
39
42
|
.addClaims(payload)
|
|
40
43
|
.setIssuer(this.getIss())
|
|
41
44
|
.setKeyID(secret.kid)
|
|
@@ -50,13 +53,13 @@ class SecretsModule_Class extends ts_common_1.Module {
|
|
|
50
53
|
this.decodeJwt = (jwt) => {
|
|
51
54
|
return jws.decode(jwt);
|
|
52
55
|
};
|
|
53
|
-
this.
|
|
56
|
+
this.setConfig({ validateKeyId: "AUTH_SECRET" });
|
|
54
57
|
}
|
|
55
58
|
getSecret(k) {
|
|
56
59
|
var _a, _b;
|
|
57
60
|
const secret = ((_a = process.env) === null || _a === void 0 ? void 0 : _a[k]) || ((_b = this.getConfig()) === null || _b === void 0 ? void 0 : _b[k]);
|
|
58
61
|
if (!secret)
|
|
59
|
-
throw new
|
|
62
|
+
throw new exceptions_2.BadImplementationException(`Missing secret with key ${k} in SecretsModule`);
|
|
60
63
|
return {
|
|
61
64
|
kid: k,
|
|
62
65
|
value: secret
|
|
@@ -65,7 +68,7 @@ class SecretsModule_Class extends ts_common_1.Module {
|
|
|
65
68
|
validateRequestAndCheckExpiration(request, scopes) {
|
|
66
69
|
const token = this.validateRequest(request, scopes);
|
|
67
70
|
if (this.isExpired(token)) {
|
|
68
|
-
const cause = `The JWT passed is not valid, check. With payload: ${
|
|
71
|
+
const cause = `The JWT passed is not valid, check. With payload: ${tools_1.__stringify(token.payload)}. The JWT passed is expired`;
|
|
69
72
|
throw new TokenExpiredException(cause);
|
|
70
73
|
}
|
|
71
74
|
return token.payload;
|
|
@@ -76,18 +79,18 @@ class SecretsModule_Class extends ts_common_1.Module {
|
|
|
76
79
|
const authToken = this.extractAuthToken(request);
|
|
77
80
|
const token = this.decodeJwt(authToken);
|
|
78
81
|
if (!token)
|
|
79
|
-
throw new
|
|
82
|
+
throw new exceptions_1.ApiException(401, "Could not decode token " + authToken);
|
|
80
83
|
const kid = token.header.kid || this.config.validateKeyId;
|
|
81
84
|
if (!kid)
|
|
82
|
-
throw new
|
|
85
|
+
throw new exceptions_1.ApiException(401, "Could not deduce which key to use in order to verify the token, please specify a key ID");
|
|
83
86
|
const secret = this.getAuthSecret(kid);
|
|
84
87
|
const verified = jws.verify(authToken, token.header.alg, secret.value);
|
|
85
|
-
let cause = `The JWT passed is not valid, check. With payload: ${
|
|
88
|
+
let cause = `The JWT passed is not valid, check. With payload: ${tools_1.__stringify(token.payload)} and header ${tools_1.__stringify(token.header)}.`;
|
|
86
89
|
if (!verified)
|
|
87
|
-
throw new
|
|
90
|
+
throw new exceptions_1.ApiException(401, cause);
|
|
88
91
|
if (!((_a = token.payload) === null || _a === void 0 ? void 0 : _a[JWTBuilder_1.EXPIRES_AT])) {
|
|
89
92
|
cause += ` The JWT is missing the expiration claim`;
|
|
90
|
-
throw new
|
|
93
|
+
throw new exceptions_1.ApiException(401, cause);
|
|
91
94
|
}
|
|
92
95
|
const scopesToValidate = (_b = token.payload) === null || _b === void 0 ? void 0 : _b.scopes;
|
|
93
96
|
if (scopesToValidate)
|
|
@@ -98,36 +101,36 @@ class SecretsModule_Class extends ts_common_1.Module {
|
|
|
98
101
|
const scopesToValidate = _scopesToValidate.split(",");
|
|
99
102
|
const isValidScope = scopesToValidate.some(s => scopes.includes(s));
|
|
100
103
|
if (!isValidScope)
|
|
101
|
-
throw new
|
|
104
|
+
throw new exceptions_1.ApiException(403, `User doesn't have valid scopes. It needs ${scopes.join(",")} but it has ${_scopesToValidate}`);
|
|
102
105
|
}
|
|
103
106
|
extractAuthToken(request) {
|
|
104
107
|
const authHead = request.header(this.AUTHENTICATION_KEY);
|
|
105
108
|
if (authHead === undefined)
|
|
106
|
-
throw new
|
|
109
|
+
throw new exceptions_2.BadImplementationException("Missing Authorization header");
|
|
107
110
|
if (!authHead)
|
|
108
|
-
throw new
|
|
111
|
+
throw new exceptions_2.BadImplementationException('The Authorization header is empty');
|
|
109
112
|
const parts = authHead.split(" ");
|
|
110
113
|
if (parts.length !== 2 || parts[0] !== this.AUTHENTICATION_PREFIX)
|
|
111
|
-
throw new
|
|
114
|
+
throw new exceptions_2.BadImplementationException(`The Authorization header is malformed` + "\n"
|
|
112
115
|
+ `Value: ${authHead}` + "\n"
|
|
113
116
|
+ `Expected Value: ${this.AUTHENTICATION_PREFIX} [token]`);
|
|
114
117
|
const authToken = parts[1].trim();
|
|
115
118
|
if (!authToken)
|
|
116
|
-
throw new
|
|
119
|
+
throw new exceptions_2.BadImplementationException(`The token provided is empty`);
|
|
117
120
|
return authToken;
|
|
118
121
|
}
|
|
119
122
|
getExpiration(token) {
|
|
120
123
|
let exp = token.payload[JWTBuilder_1.EXPIRES_AT];
|
|
121
124
|
if (!exp)
|
|
122
125
|
return exp;
|
|
123
|
-
const now =
|
|
126
|
+
const now = date_time_tools_1.currentTimeMillies();
|
|
124
127
|
const cutOff = 1000000000000; // 3-3-1973 in milliseconds
|
|
125
128
|
const isInSeconds = exp < cutOff;
|
|
126
129
|
if (isInSeconds)
|
|
127
130
|
exp = exp * 1000;
|
|
128
|
-
const year = 365 *
|
|
131
|
+
const year = 365 * date_time_tools_1.Day;
|
|
129
132
|
if (exp < now - year || exp > now + (year))
|
|
130
|
-
throw new
|
|
133
|
+
throw new exceptions_2.BadImplementationException(`The JWT passed is not valid. Payload: ${tools_1.__stringify(token.payload)}.` +
|
|
131
134
|
`Malformed JWT, expiry date is not valid, check the exp format, assumed to be in ${isInSeconds ? "seconds" : "milliseconds"}`);
|
|
132
135
|
return exp;
|
|
133
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretsModule.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/SecretsModule.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SecretsModule.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/SecretsModule.ts"],"names":[],"mappings":";;;AAAA,uFAAoF;AAEpF,6EAAwF;AACxF,qEAAgE;AAChE,wFAA2F;AAC3F,oEAAqE;AAErE,2BAA2B;AAE3B,kFAAkG;AAClG,6CAAoD;AAEpD,MAAa,qBACT,SAAQ,yBAAY;IACpB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AALD,sDAKC;AAeD,MAAa,mBACT,SAAQ,eAAc;IAMtB;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QANnB,gBAAW,GAAG,OAAO,CAAC;QAEvB,0BAAqB,GAAG,4CAAqB,CAAC;QAC9C,uBAAkB,GAAG,yCAAkB,CAAC;QAkBxC,kBAAa,GAAG,CAAC,GAAW,EAAU,EAAE;YAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAC;QAEM,cAAS,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,MAAM;gBACZ,MAAM,IAAI,uCAA0B,CAAC,8CAA8C,CAAC,CAAC;YAEzF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;gBACpB,MAAM,IAAI,uCAA0B,CAAC,+DAA+D,CAAC,CAAC;YAE1G,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC;QAyEK,cAAS,GAAG,CAAC,KAAgB,EAAE,EAAE;YACpC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,oCAAkB,EAAE,CAAC;QAC5D,CAAC,CAAC;QAoBF,gB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AQ,EAAE,GAAG,IAAI;kBAC3B,mBAAmB,IAAI,CAAC,qBAAqB,UAAU,CAC5D,CAAC;QAEN,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,SAAS;YACV,MAAM,IAAI,uCAA0B,CAAC,6BAA6B,CAAC,CAAC;QAExE,OAAO,SAAS,CAAC;IACrB,CAAC;IAMM,aAAa,CAAC,KAAgB;QACjC,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAU,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG;YACJ,OAAO,GAAG,CAAC;QAEf,MAAM,GAAG,GAAG,oCAAkB,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAA,2BAA2B;QACxD,MAAM,WAAW,GAAG,GAAG,GAAG,MAAM,CAAC;QACjC,IAAI,WAAW;YACX,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;QAErB,MAAM,IAAI,GAAG,GAAG,GAAG,qBAAG,CAAC;QACvB,IAAI,GAAG,GAAG,GAAG,GAAG,IAAI,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;YACtC,MAAM,IAAI,uCAA0B,CAAC,yCAAyC,mBAAW,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG;gBACvG,mFAAmF,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;QACvI,OAAO,GAAG,CAAC;IACf,CAAC;CAuBJ;AAvJD,kDAuJC;AAEY,QAAA,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AuditBy, DB_Object } from "@intuitionrobotics/ts-common";
|
|
2
|
-
export * from "../../index";
|
|
1
|
+
import { AuditBy, DB_Object } from "@intuitionrobotics/ts-common/utils/types";
|
|
3
2
|
export declare type RequestBody_SamlAssertOptions = {
|
|
4
3
|
request_body: {
|
|
5
4
|
SAMLResponse: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,37 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
3
|
exports.Frontend_ModulePack_Users = void 0;
|
|
32
4
|
const AccountModule_1 = require("../modules/AccountModule");
|
|
33
5
|
exports.Frontend_ModulePack_Users = [
|
|
34
6
|
AccountModule_1.AccountModule,
|
|
35
7
|
];
|
|
36
|
-
__exportStar(require("../modules/AccountModule"), exports);
|
|
37
8
|
//# sourceMappingURL=module-pack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-frontend/core/module-pack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-frontend/core/module-pack.ts"],"names":[],"mappings":";;;AACA,4DAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACrC,6BAAa;CAChB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OnUnauthenticatedResponse
|
|
1
|
+
import { StorageKey } from "@intuitionrobotics/thunderstorm/app-frontend/modules/StorageModule";
|
|
2
|
+
import { OnUnauthenticatedResponse } from "@intuitionrobotics/thunderstorm/app-frontend/core/Thunder";
|
|
3
3
|
import { Request_CreateAccount, Request_LoginAccount, RequestParams_LoginSAML, UI_Account } from "../../shared/api";
|
|
4
|
+
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
4
5
|
export declare const StorageKey_UserEmail: StorageKey<string>;
|
|
5
6
|
export declare const StorageKey_JWT: StorageKey<string>;
|
|
6
7
|
export declare const RequestKey_AccountCreate = "account-create";
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -28,13 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
10
|
};
|
|
29
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
12
|
exports.AccountModule = exports.AccountModule_Class = exports.LoggedStatus = exports.RequestKey_ValidateSession = exports.RequestKey_AccountLoginSAML = exports.RequestKey_AccountLogin = exports.RequestKey_AccountCreate = exports.StorageKey_JWT = exports.StorageKey_UserEmail = void 0;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
13
|
+
const StorageModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/StorageModule");
|
|
14
|
+
const XhrHttpModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/http/XhrHttpModule");
|
|
15
|
+
const ToasterModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/toaster/ToasterModule");
|
|
16
|
+
const HistoryModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/HistoryModule");
|
|
17
|
+
const thunder_dispatcher_1 = require("@intuitionrobotics/thunderstorm/app-frontend/core/thunder-dispatcher");
|
|
33
18
|
const api_1 = require("../../shared/api");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
const AuthenticationConsts_1 = require("../../shared/utils/AuthenticationConsts");
|
|
20
|
+
const module_1 = require("@intuitionrobotics/ts-common/core/module");
|
|
21
|
+
const consts_1 = require("@intuitionrobotics/thunderstorm/shared/consts");
|
|
22
|
+
const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
|
|
23
|
+
const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
|
|
24
|
+
exports.StorageKey_UserEmail = new StorageModule_1.StorageKey(`storage-${api_1.QueryParam_Email}`);
|
|
25
|
+
exports.StorageKey_JWT = new StorageModule_1.StorageKey(`storage-${api_1.QueryParam_JWT}`);
|
|
38
26
|
exports.RequestKey_AccountCreate = "account-create";
|
|
39
27
|
exports.RequestKey_AccountLogin = "account-login";
|
|
40
28
|
exports.RequestKey_AccountLoginSAML = "account-login-saml";
|
|
@@ -45,8 +33,8 @@ var LoggedStatus;
|
|
|
45
33
|
LoggedStatus[LoggedStatus["LOGGED_OUT"] = 1] = "LOGGED_OUT";
|
|
46
34
|
LoggedStatus[LoggedStatus["LOGGED_IN"] = 2] = "LOGGED_IN";
|
|
47
35
|
})(LoggedStatus = exports.LoggedStatus || (exports.LoggedStatus = {}));
|
|
48
|
-
const dispatch_onAccountsLoaded = new
|
|
49
|
-
class AccountModule_Class extends
|
|
36
|
+
const dispatch_onAccountsLoaded = new thunder_dispatcher_1.ThunderDispatcher("__onAccountsLoaded");
|
|
37
|
+
class AccountModule_Class extends module_1.Module {
|
|
50
38
|
constructor() {
|
|
51
39
|
super("AccountModule");
|
|
52
40
|
this.status = LoggedStatus.VALIDATING;
|
|
@@ -66,14 +54,14 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
66
54
|
this.dispatchUI_loginChanged.dispatchModule([]);
|
|
67
55
|
};
|
|
68
56
|
this.validateToken = () => {
|
|
69
|
-
|
|
70
|
-
.createRequest(
|
|
57
|
+
XhrHttpModule_1.XhrHttpModule
|
|
58
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
|
|
71
59
|
.setLabel(`Validate token...`)
|
|
72
60
|
.setRelativeUrl("/v1/account/validate")
|
|
73
61
|
.setOnError((request, resError) => {
|
|
74
62
|
if (request.getStatus() === 0) {
|
|
75
|
-
|
|
76
|
-
setTimeout(() => exports.AccountModule.validateToken(), 30 *
|
|
63
|
+
ToasterModule_1.ToastModule.toastError("Cannot reach Server... trying in 30 sec");
|
|
64
|
+
setTimeout(() => exports.AccountModule.validateToken(), 30 * date_time_tools_1.Second);
|
|
77
65
|
return;
|
|
78
66
|
}
|
|
79
67
|
exports.StorageKey_JWT.delete();
|
|
@@ -90,8 +78,8 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
90
78
|
this.setLoggedStatus(LoggedStatus.LOGGED_OUT);
|
|
91
79
|
};
|
|
92
80
|
this.listUsers = () => {
|
|
93
|
-
|
|
94
|
-
.createRequest(
|
|
81
|
+
XhrHttpModule_1.XhrHttpModule
|
|
82
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
|
|
95
83
|
.setLabel(`Fetching users...`)
|
|
96
84
|
.setRelativeUrl("/v1/account/query")
|
|
97
85
|
.execute((res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -99,20 +87,20 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
99
87
|
dispatch_onAccountsLoaded.dispatchUI([]);
|
|
100
88
|
}));
|
|
101
89
|
};
|
|
102
|
-
|
|
90
|
+
XhrHttpModule_1.XhrHttpModule.addDefaultResponseHandler((request) => {
|
|
103
91
|
var _a;
|
|
104
92
|
const status = request.getStatus();
|
|
105
93
|
if (status < 200 || status >= 300)
|
|
106
94
|
return false;
|
|
107
95
|
try {
|
|
108
|
-
const
|
|
109
|
-
frontend_1.XhrHttpModule.logDebug(`${request.key} Function execution id: ${functionExecutionId}`);
|
|
110
|
-
const jwt = request.getResponseHeader(thunderstorm_1.HeaderKey_JWT);
|
|
96
|
+
const jwt = request.getResponseHeader(consts_1.HeaderKey_JWT);
|
|
111
97
|
if (jwt)
|
|
112
98
|
exports.StorageKey_JWT.set(jwt);
|
|
99
|
+
const functionExecutionId = (_a = request === null || request === void 0 ? void 0 : request.getResponseHeader) === null || _a === void 0 ? void 0 : _a.call(request, consts_1.HeaderKey_FunctionExecutionId);
|
|
100
|
+
XhrHttpModule_1.XhrHttpModule.logDebug(`${request.key} Function execution id: ${functionExecutionId}`);
|
|
113
101
|
}
|
|
114
102
|
catch (e) {
|
|
115
|
-
|
|
103
|
+
XhrHttpModule_1.XhrHttpModule.logWarning(`${request.key} - Failed to retrieve headers from xhr call`, e);
|
|
116
104
|
}
|
|
117
105
|
return false;
|
|
118
106
|
});
|
|
@@ -121,15 +109,15 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
121
109
|
return this.accounts;
|
|
122
110
|
}
|
|
123
111
|
init() {
|
|
124
|
-
|
|
125
|
-
this.dispatchUI_loginChanged = new
|
|
126
|
-
const email =
|
|
127
|
-
const jwt =
|
|
112
|
+
XhrHttpModule_1.XhrHttpModule.addDefaultHeader(AuthenticationConsts_1.AUTHENTICATION_KEY, () => `${AuthenticationConsts_1.AUTHENTICATION_PREFIX} ${exports.StorageKey_JWT.get()}`);
|
|
113
|
+
this.dispatchUI_loginChanged = new thunder_dispatcher_1.ThunderDispatcher("onLoginStatusUpdated");
|
|
114
|
+
const email = HistoryModule_1.BrowserHistoryModule.getQueryParam(api_1.QueryParam_Email);
|
|
115
|
+
const jwt = HistoryModule_1.BrowserHistoryModule.getQueryParam(api_1.QueryParam_JWT);
|
|
128
116
|
if (email && jwt) {
|
|
129
117
|
exports.StorageKey_JWT.set(jwt);
|
|
130
118
|
exports.StorageKey_UserEmail.set(email);
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
HistoryModule_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_Email);
|
|
120
|
+
HistoryModule_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_JWT);
|
|
133
121
|
}
|
|
134
122
|
if (exports.StorageKey_JWT.get())
|
|
135
123
|
return exports.AccountModule.validateToken();
|
|
@@ -137,19 +125,19 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
137
125
|
this.setLoggedStatus(LoggedStatus.LOGGED_OUT);
|
|
138
126
|
}
|
|
139
127
|
create(request) {
|
|
140
|
-
|
|
141
|
-
.createRequest(
|
|
128
|
+
XhrHttpModule_1.XhrHttpModule
|
|
129
|
+
.createRequest(types_1.HttpMethod.POST, exports.RequestKey_AccountCreate)
|
|
142
130
|
.setRelativeUrl("/v1/account/create")
|
|
143
131
|
.setJsonBody(request)
|
|
144
132
|
.setLabel(`User register...`)
|
|
145
133
|
.setOnError("Error registering user")
|
|
146
134
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
|
|
135
|
+
ToasterModule_1.ToastModule.toastSuccess(`Account successfully created with email: ${response.email}`);
|
|
148
136
|
}));
|
|
149
137
|
}
|
|
150
138
|
login(request) {
|
|
151
|
-
|
|
152
|
-
.createRequest(
|
|
139
|
+
XhrHttpModule_1.XhrHttpModule
|
|
140
|
+
.createRequest(types_1.HttpMethod.POST, exports.RequestKey_AccountLogin)
|
|
153
141
|
.setRelativeUrl("/v1/account/login")
|
|
154
142
|
.setJsonBody(request)
|
|
155
143
|
.setLabel(`User login with password...`)
|
|
@@ -164,8 +152,8 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
164
152
|
this.setLoggedStatus(LoggedStatus.LOGGED_IN);
|
|
165
153
|
}
|
|
166
154
|
loginSAML(request) {
|
|
167
|
-
|
|
168
|
-
.createRequest(
|
|
155
|
+
XhrHttpModule_1.XhrHttpModule
|
|
156
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_AccountLoginSAML)
|
|
169
157
|
.setRelativeUrl("/v1/account/login-saml")
|
|
170
158
|
.setUrlParams(request)
|
|
171
159
|
.setLabel(`User login SAML...`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/AccountModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":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HANGED
package/index.js
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("./shared/api"), exports);
|
|
32
|
-
__exportStar(require("./shared/utils/AuthenticationConsts"), exports);
|
|
33
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuitionrobotics/user-account",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.00",
|
|
4
4
|
"description": "User Account",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"IR",
|
|
@@ -30,16 +30,15 @@
|
|
|
30
30
|
"build": "tsc"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@intuitionrobotics/firebase": "~0.
|
|
34
|
-
"@intuitionrobotics/thunderstorm": "~0.
|
|
35
|
-
"@intuitionrobotics/ts-common": "~0.
|
|
33
|
+
"@intuitionrobotics/firebase": "~0.46.0",
|
|
34
|
+
"@intuitionrobotics/thunderstorm": "~0.46.0",
|
|
35
|
+
"@intuitionrobotics/ts-common": "~0.46.0",
|
|
36
36
|
"react": "^16.0.0",
|
|
37
37
|
"jws": "^4.0.0",
|
|
38
|
-
"moment": "^2.29.4",
|
|
39
38
|
"saml2-js": "^4.0.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@intuitionrobotics/testelot": "~0.
|
|
41
|
+
"@intuitionrobotics/testelot": "~0.46.0",
|
|
43
42
|
"@types/node": "^16.0.0",
|
|
44
43
|
"@types/jws": "^3.2.4",
|
|
45
44
|
"@types/react": "^16.8.7",
|
package/shared/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiWithBody, ApiWithQuery } from "@intuitionrobotics/thunderstorm";
|
|
1
|
+
import { ApiWithBody, ApiWithQuery } from "@intuitionrobotics/thunderstorm/shared/types";
|
|
2
2
|
export declare const HeaderKey_SessionId = "x-session-id";
|
|
3
3
|
export declare const HeaderKey_Email = "x-email";
|
|
4
4
|
export declare const QueryParam_Email = "userEmail";
|
package/shared/api.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
3
|
exports.FrontType = exports.HeaderKey_CurrentPage = exports.QueryParam_RedirectUrl = exports.QueryParam_SessionId = exports.QueryParam_JWT = exports.QueryParam_Email = exports.HeaderKey_Email = exports.HeaderKey_SessionId = void 0;
|
|
22
4
|
exports.HeaderKey_SessionId = "x-session-id";
|
package/shared/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/main/shared/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/main/shared/api.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,eAAe,GAAG,SAAS,CAAC;AAE5B,QAAA,gBAAgB,GAAG,WAAW,CAAC;AAC/B,QAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,oBAAoB,GAAG,2BAAmB,CAAC;AAC3C,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,qBAAqB,GAAG,cAAc,CAAC;AAEpD,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,wBAAW,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationConsts.js","sourceRoot":"","sources":["../../../src/main/shared/utils/AuthenticationConsts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AuthenticationConsts.js","sourceRoot":"","sources":["../../../src/main/shared/utils/AuthenticationConsts.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AACjC,QAAA,kBAAkB,GAAG,eAAe,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("../../../../shared/api"), exports);
|
|
32
|
-
__exportStar(require("../../../modules/AccountModule"), exports);
|
|
33
|
-
__exportStar(require("../../../modules/SamlModule"), exports);
|
|
34
|
-
__exportStar(require("../../../modules/_imports"), exports);
|
|
35
|
-
// export * from "../../../../shared/types";
|
|
36
|
-
//# sourceMappingURL=_imports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_imports.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/_imports.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,yDAAuC;AACvC,iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,4CAA4C"}
|