auth-monitorias-uniandes 0.1.2-beta.6 → 0.1.2-beta.60
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/lib/{build/app.component.d.ts → app.component.d.ts} +4 -1
- package/lib/{build/app.component.js → app.component.js} +10 -2
- package/lib/app.component.js.map +1 -0
- package/lib/{build/app.component.metadata.json → app.component.metadata.json} +1 -1
- package/lib/{build/app.module.js → app.module.js} +14 -10
- package/lib/app.module.js.map +1 -0
- package/lib/app.module.metadata.json +1 -0
- package/lib/auth-monitorias/auth-monitorias.module.d.ts +5 -0
- package/lib/{build/auth-monitorias → auth-monitorias}/auth-monitorias.module.js +17 -3
- package/lib/auth-monitorias/auth-monitorias.module.js.map +1 -0
- package/lib/auth-monitorias/auth-monitorias.module.metadata.json +1 -0
- package/lib/auth-monitorias/common/SearchPersonParams.model.d.ts +11 -0
- package/lib/auth-monitorias/common/SearchPersonParams.model.js +9 -0
- package/lib/auth-monitorias/common/SearchPersonParams.model.js.map +1 -0
- package/lib/auth-monitorias/common/SearchPersonParams.model.metadata.json +1 -0
- package/lib/auth-monitorias/common/constants.js.map +1 -0
- package/lib/auth-monitorias/common/currentUser.model.js.map +1 -0
- package/lib/auth-monitorias/common/enviromentOptions.d.ts +7 -0
- package/lib/auth-monitorias/common/enviromentOptions.js +9 -0
- package/lib/auth-monitorias/common/enviromentOptions.js.map +1 -0
- package/lib/auth-monitorias/common/enviromentOptions.metadata.json +1 -0
- package/lib/auth-monitorias/common/login.model.js.map +1 -0
- package/lib/auth-monitorias/common/mock.js.map +1 -0
- package/lib/auth-monitorias/common/person.model.d.ts +13 -0
- package/lib/auth-monitorias/common/person.model.js +9 -0
- package/lib/auth-monitorias/common/person.model.js.map +1 -0
- package/lib/auth-monitorias/common/person.model.metadata.json +1 -0
- package/lib/auth-monitorias/common/roles-type.enum.js.map +1 -0
- package/lib/auth-monitorias/common/safe.pipe.js.map +1 -0
- package/lib/auth-monitorias/directives/hide-for-roles.directive.js.map +1 -0
- package/lib/auth-monitorias/directives/read-only-for-roles.directive.js.map +1 -0
- package/lib/auth-monitorias/directives/show-for-roles.directive.js.map +1 -0
- package/lib/{build/auth-monitorias → auth-monitorias}/index.d.ts +1 -1
- package/lib/{build/auth-monitorias → auth-monitorias}/index.js +1 -1
- package/lib/auth-monitorias/index.js.map +1 -0
- package/lib/{build/auth-monitorias → auth-monitorias}/index.metadata.json +1 -1
- package/lib/auth-monitorias/interceptors/auth.interceptor.d.ts +8 -0
- package/lib/auth-monitorias/interceptors/auth.interceptor.js +26 -0
- package/lib/auth-monitorias/interceptors/auth.interceptor.js.map +1 -0
- package/lib/auth-monitorias/interceptors/auth.interceptor.metadata.json +1 -0
- package/lib/{build/auth-monitorias → auth-monitorias}/services/auth-guard.service.js +3 -1
- package/lib/auth-monitorias/services/auth-guard.service.js.map +1 -0
- package/lib/auth-monitorias/services/auth-guard.service.metadata.json +1 -0
- package/lib/auth-monitorias/services/auth-locator.service.d.ts +13 -0
- package/lib/auth-monitorias/services/auth-locator.service.js +60 -0
- package/lib/auth-monitorias/services/auth-locator.service.js.map +1 -0
- package/lib/auth-monitorias/services/auth-locator.service.metadata.json +1 -0
- package/lib/auth-monitorias/services/auth-resolver.service.js.map +1 -0
- package/lib/{build/auth-monitorias → auth-monitorias}/services/auth.service.d.ts +30 -2
- package/lib/{build/auth-monitorias → auth-monitorias}/services/auth.service.js +103 -8
- package/lib/auth-monitorias/services/auth.service.js.map +1 -0
- package/lib/auth-monitorias/services/auth.service.metadata.json +1 -0
- package/lib/constants.d.ts +2 -0
- package/lib/{build/constants.js → constants.js} +1 -0
- package/lib/constants.js.map +1 -0
- package/lib/{build/constants.metadata.json → constants.metadata.json} +1 -1
- package/lib/encryption/encryption.module.d.ts +2 -0
- package/lib/encryption/encryption.module.js +18 -0
- package/lib/encryption/encryption.module.js.map +1 -0
- package/lib/encryption/encryption.module.metadata.json +1 -0
- package/lib/encryption/index.d.ts +3 -0
- package/lib/encryption/index.js +9 -0
- package/lib/encryption/index.js.map +1 -0
- package/lib/encryption/index.metadata.json +1 -0
- package/lib/encryption/interceptors/encryption.interceptor.d.ts +12 -0
- package/lib/encryption/interceptors/encryption.interceptor.js +109 -0
- package/lib/encryption/interceptors/encryption.interceptor.js.map +1 -0
- package/lib/encryption/interceptors/encryption.interceptor.metadata.json +1 -0
- package/lib/encryption/rsa-public-key.d.ts +2 -0
- package/lib/encryption/rsa-public-key.js +5 -0
- package/lib/encryption/rsa-public-key.js.map +1 -0
- package/lib/encryption/rsa-public-key.metadata.json +1 -0
- package/lib/encryption/services/encryption.service.d.ts +13 -0
- package/lib/encryption/services/encryption.service.js +211 -0
- package/lib/encryption/services/encryption.service.js.map +1 -0
- package/lib/encryption/services/encryption.service.metadata.json +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/{build/index.js → index.js} +2 -0
- package/lib/index.js.map +1 -0
- package/lib/index.metadata.json +1 -0
- package/lib/session-models-monitorias/index.d.ts +4 -0
- package/lib/session-models-monitorias/index.js +10 -0
- package/lib/session-models-monitorias/index.js.map +1 -0
- package/lib/session-models-monitorias/index.metadata.json +1 -0
- package/lib/session-models-monitorias/models/dependency.model.d.ts +10 -0
- package/lib/session-models-monitorias/models/dependency.model.js +9 -0
- package/lib/session-models-monitorias/models/dependency.model.js.map +1 -0
- package/lib/session-models-monitorias/models/dependency.model.metadata.json +1 -0
- package/lib/session-models-monitorias/models/program.model.d.ts +10 -0
- package/lib/session-models-monitorias/models/program.model.js +10 -0
- package/lib/session-models-monitorias/models/program.model.js.map +1 -0
- package/lib/session-models-monitorias/models/program.model.metadata.json +1 -0
- package/lib/session-models-monitorias/services/session-program-monitoria.service.d.ts +46 -0
- package/lib/session-models-monitorias/services/session-program-monitoria.service.js +161 -0
- package/lib/session-models-monitorias/services/session-program-monitoria.service.js.map +1 -0
- package/lib/session-models-monitorias/services/session-program-monitoria.service.metadata.json +1 -0
- package/lib/session-models-monitorias/session-models-monitorias.module.d.ts +2 -0
- package/lib/session-models-monitorias/session-models-monitorias.module.js +22 -0
- package/lib/session-models-monitorias/session-models-monitorias.module.js.map +1 -0
- package/lib/session-models-monitorias/session-models-monitorias.module.metadata.json +1 -0
- package/package.json +5 -5
- package/lib/build/app.component.js.map +0 -1
- package/lib/build/app.module.js.map +0 -1
- package/lib/build/app.module.metadata.json +0 -1
- package/lib/build/auth-monitorias/auth-monitorias.module.d.ts +0 -2
- package/lib/build/auth-monitorias/auth-monitorias.module.js.map +0 -1
- package/lib/build/auth-monitorias/auth-monitorias.module.metadata.json +0 -1
- package/lib/build/auth-monitorias/common/constants.js.map +0 -1
- package/lib/build/auth-monitorias/common/currentUser.model.js.map +0 -1
- package/lib/build/auth-monitorias/common/login.model.js.map +0 -1
- package/lib/build/auth-monitorias/common/mock.js.map +0 -1
- package/lib/build/auth-monitorias/common/roles-type.enum.js.map +0 -1
- package/lib/build/auth-monitorias/common/safe.pipe.js.map +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/idle-logout/idle-logout.component.d.ts +0 -22
- package/lib/build/auth-monitorias/components/idlelogout/idle-logout/idle-logout.component.js +0 -66
- package/lib/build/auth-monitorias/components/idlelogout/idle-logout/idle-logout.component.js.map +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/idle-logout/idle-logout.component.metadata.json +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/idlelogout.module.d.ts +0 -2
- package/lib/build/auth-monitorias/components/idlelogout/idlelogout.module.js +0 -23
- package/lib/build/auth-monitorias/components/idlelogout/idlelogout.module.js.map +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/idlelogout.module.metadata.json +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/index.d.ts +0 -2
- package/lib/build/auth-monitorias/components/idlelogout/index.js +0 -8
- package/lib/build/auth-monitorias/components/idlelogout/index.js.map +0 -1
- package/lib/build/auth-monitorias/components/idlelogout/index.metadata.json +0 -1
- package/lib/build/auth-monitorias/directives/hide-for-roles.directive.js.map +0 -1
- package/lib/build/auth-monitorias/directives/read-only-for-roles.directive.js.map +0 -1
- package/lib/build/auth-monitorias/directives/show-for-roles.directive.js.map +0 -1
- package/lib/build/auth-monitorias/index.js.map +0 -1
- package/lib/build/auth-monitorias/services/auth-guard.service.js.map +0 -1
- package/lib/build/auth-monitorias/services/auth-guard.service.metadata.json +0 -1
- package/lib/build/auth-monitorias/services/auth-locator.service.d.ts +0 -7
- package/lib/build/auth-monitorias/services/auth-locator.service.js +0 -41
- package/lib/build/auth-monitorias/services/auth-locator.service.js.map +0 -1
- package/lib/build/auth-monitorias/services/auth-locator.service.metadata.json +0 -1
- package/lib/build/auth-monitorias/services/auth-resolver.service.js.map +0 -1
- package/lib/build/auth-monitorias/services/auth.service.js.map +0 -1
- package/lib/build/auth-monitorias/services/auth.service.metadata.json +0 -1
- package/lib/build/constants.d.ts +0 -1
- package/lib/build/constants.js.map +0 -1
- package/lib/build/index.d.ts +0 -1
- package/lib/build/index.js.map +0 -1
- package/lib/build/index.metadata.json +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.config.d.ts +0 -14
- package/lib/node_modules/angular-user-idle/user-idle.config.js +0 -9
- package/lib/node_modules/angular-user-idle/user-idle.config.js.map +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.config.metadata.json +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.module.d.ts +0 -8
- package/lib/node_modules/angular-user-idle/user-idle.module.js +0 -28
- package/lib/node_modules/angular-user-idle/user-idle.module.js.map +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.module.metadata.json +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.service.d.ts +0 -72
- package/lib/node_modules/angular-user-idle/user-idle.service.js +0 -185
- package/lib/node_modules/angular-user-idle/user-idle.service.js.map +0 -1
- package/lib/node_modules/angular-user-idle/user-idle.service.metadata.json +0 -1
- /package/lib/{build/app.module.d.ts → app.module.d.ts} +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/constants.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/constants.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/constants.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/currentUser.model.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/currentUser.model.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/currentUser.model.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/login.model.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/login.model.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/login.model.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/mock.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/mock.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/mock.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/roles-type.enum.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/roles-type.enum.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/roles-type.enum.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/safe.pipe.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/safe.pipe.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/common/safe.pipe.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/hide-for-roles.directive.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/hide-for-roles.directive.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/hide-for-roles.directive.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/read-only-for-roles.directive.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/read-only-for-roles.directive.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/read-only-for-roles.directive.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/show-for-roles.directive.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/show-for-roles.directive.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/directives/show-for-roles.directive.metadata.json +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/services/auth-guard.service.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/services/auth-resolver.service.d.ts +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/services/auth-resolver.service.js +0 -0
- /package/lib/{build/auth-monitorias → auth-monitorias}/services/auth-resolver.service.metadata.json +0 -0
|
@@ -9,12 +9,17 @@ require("rxjs/add/operator/share");
|
|
|
9
9
|
var auth_locator_service_1 = require("./auth-locator.service");
|
|
10
10
|
var ErrorObservable_1 = require("rxjs/observable/ErrorObservable");
|
|
11
11
|
var constants_1 = require("../../constants");
|
|
12
|
+
var SearchPersonParams_model_1 = require("../common/SearchPersonParams.model");
|
|
13
|
+
var enviromentOptions_1 = require("../common/enviromentOptions");
|
|
14
|
+
var CryptoJS = require("crypto-js");
|
|
12
15
|
var AuthService = /** @class */ (function () {
|
|
13
|
-
function AuthService(http, urlService) {
|
|
16
|
+
function AuthService(options, http, urlService) {
|
|
14
17
|
this.http = http;
|
|
15
18
|
this.urlService = urlService;
|
|
16
19
|
this.onSubject = new Subject_1.Subject();
|
|
17
20
|
this.currentUserChanges = this.onSubject.asObservable().share();
|
|
21
|
+
this.options = null;
|
|
22
|
+
this.options = options;
|
|
18
23
|
this.headers = new http_1.HttpHeaders({ 'Content-Type': 'application/json', 'Accept': 'application/json, text/plain' });
|
|
19
24
|
this.start();
|
|
20
25
|
}
|
|
@@ -40,7 +45,6 @@ var AuthService = /** @class */ (function () {
|
|
|
40
45
|
* @param urlLogin
|
|
41
46
|
*/
|
|
42
47
|
function (userLogin, urlLogin) {
|
|
43
|
-
//return this.http.get('assets/user.json',{headers: this.headers}) // For debug
|
|
44
48
|
return this.http.post(urlLogin ? urlLogin : this.urlService.getDefaultUrlLogin(), userLogin, { headers: this.headers })
|
|
45
49
|
.catch(this.handleError);
|
|
46
50
|
};
|
|
@@ -57,6 +61,38 @@ var AuthService = /** @class */ (function () {
|
|
|
57
61
|
return this.http.get(urlLogout ? urlLogout : this.urlService.getDefaultUrlLogout(), { headers: this.headers })
|
|
58
62
|
.catch(this.handleError);
|
|
59
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* Do login into monitorias via SAML
|
|
67
|
+
* @param urlLogin
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* Do login into monitorias via SAML
|
|
72
|
+
* @param urlLogin
|
|
73
|
+
*/
|
|
74
|
+
AuthService.prototype.doSamlLogin = /**
|
|
75
|
+
*
|
|
76
|
+
* Do login into monitorias via SAML
|
|
77
|
+
* @param urlLogin
|
|
78
|
+
*/
|
|
79
|
+
function (urlLogin) {
|
|
80
|
+
window.top.location.href = (urlLogin ? urlLogin : this.urlService.getDefaultUrlLogin());
|
|
81
|
+
return this.http.get('about:blank', { headers: this.headers });
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Do saml logout in monitorias
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* Do saml logout in monitorias
|
|
88
|
+
*/
|
|
89
|
+
AuthService.prototype.doSamlLogout = /**
|
|
90
|
+
* Do saml logout in monitorias
|
|
91
|
+
*/
|
|
92
|
+
function (urlLogout) {
|
|
93
|
+
window.top.location.href = (urlLogout ? urlLogout : this.urlService.getDefaultUrlSingleLogout());
|
|
94
|
+
return this.http.get('about:blank', { headers: this.headers });
|
|
95
|
+
};
|
|
60
96
|
/**
|
|
61
97
|
* Get current User from monitorias
|
|
62
98
|
* @param urlMe
|
|
@@ -84,6 +120,28 @@ var AuthService = /** @class */ (function () {
|
|
|
84
120
|
return user;
|
|
85
121
|
});
|
|
86
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* Returns the data of the person searching with the username
|
|
126
|
+
* @param username
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* Returns the data of the person searching with the username
|
|
131
|
+
* @param username
|
|
132
|
+
*/
|
|
133
|
+
AuthService.prototype.searchPersons = /**
|
|
134
|
+
*
|
|
135
|
+
* Returns the data of the person searching with the username
|
|
136
|
+
* @param username
|
|
137
|
+
*/
|
|
138
|
+
function (username) {
|
|
139
|
+
//return this.http.get('assets/user.json',{headers: this.headers}) // For debug
|
|
140
|
+
var params = new SearchPersonParams_model_1.SearchPersonParamsModel();
|
|
141
|
+
params.username = username;
|
|
142
|
+
return this.http.post(this.urlService.getUrlSearchPerson(), params, { headers: this.headers })
|
|
143
|
+
.catch(this.handleError);
|
|
144
|
+
};
|
|
87
145
|
/**
|
|
88
146
|
* Get current Roles
|
|
89
147
|
*/
|
|
@@ -236,13 +294,13 @@ var AuthService = /** @class */ (function () {
|
|
|
236
294
|
* @param error
|
|
237
295
|
*/
|
|
238
296
|
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
297
|
+
* Handler error
|
|
298
|
+
* @param error
|
|
299
|
+
*/
|
|
242
300
|
AuthService.prototype.handleError = /**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
301
|
+
* Handler error
|
|
302
|
+
* @param error
|
|
303
|
+
*/
|
|
246
304
|
function (error) {
|
|
247
305
|
if (error.error instanceof ErrorEvent) {
|
|
248
306
|
console.error('An error occurred:', error.error.message);
|
|
@@ -253,11 +311,48 @@ var AuthService = /** @class */ (function () {
|
|
|
253
311
|
return new ErrorObservable_1.ErrorObservable(error);
|
|
254
312
|
};
|
|
255
313
|
;
|
|
314
|
+
/**
|
|
315
|
+
* encode in base 64
|
|
316
|
+
* @param input
|
|
317
|
+
*/
|
|
318
|
+
/**
|
|
319
|
+
* encode in base 64
|
|
320
|
+
* @param input
|
|
321
|
+
*/
|
|
322
|
+
AuthService.prototype.encode = /**
|
|
323
|
+
* encode in base 64
|
|
324
|
+
* @param input
|
|
325
|
+
*/
|
|
326
|
+
function (input) {
|
|
327
|
+
// PROCESS
|
|
328
|
+
var encodedWord = CryptoJS.enc.Utf8.parse(input); // encodedWord Array object
|
|
329
|
+
var encoded = CryptoJS.enc.Base64.stringify(encodedWord);
|
|
330
|
+
return encoded;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* decode in base 64
|
|
334
|
+
* @param input
|
|
335
|
+
*/
|
|
336
|
+
/**
|
|
337
|
+
* decode in base 64
|
|
338
|
+
* @param input
|
|
339
|
+
*/
|
|
340
|
+
AuthService.prototype.decode = /**
|
|
341
|
+
* decode in base 64
|
|
342
|
+
* @param input
|
|
343
|
+
*/
|
|
344
|
+
function (input) {
|
|
345
|
+
// PROCESS
|
|
346
|
+
var encodedWord = CryptoJS.enc.Base64.parse(input); // encodedWord via Base64.parse()
|
|
347
|
+
var decoded = CryptoJS.enc.Utf8.stringify(encodedWord); // decode encodedWord via Utf8.stringify()
|
|
348
|
+
return decoded;
|
|
349
|
+
};
|
|
256
350
|
AuthService.decorators = [
|
|
257
351
|
{ type: core_1.Injectable },
|
|
258
352
|
];
|
|
259
353
|
/** @nocollapse */
|
|
260
354
|
AuthService.ctorParameters = function () { return [
|
|
355
|
+
{ type: enviromentOptions_1.EnviromentOptions, decorators: [{ type: core_1.Optional },] },
|
|
261
356
|
{ type: http_1.HttpClient, },
|
|
262
357
|
{ type: auth_locator_service_1.AuthLocatorService, },
|
|
263
358
|
]; };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../build/auth-monitorias/services/auth.service.ts"],"names":[],"mappings":";;AAAA,sCAAqD;AACrD,6CAA8F;AAE9F,iCAA+B;AAC/B,mCAAgC;AAChC,wCAAuC;AACvC,mCAAiC;AACjC,+DAA4D;AAC5D,mEAAkE;AAGlE,6CAAmD;AACn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eAAQ;gBA1BJ,iBAAU;gBAMV,yCAAkB;;sBAP3B;;AAkBa,kCAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AuthService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":17,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":27,"character":5}}],null,null],"parameters":[{"__symbolic":"reference","module":"../common/enviromentOptions","name":"EnviromentOptions","line":27,"character":25},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":28,"character":18},{"__symbolic":"reference","module":"./auth-locator.service","name":"AuthLocatorService","line":29,"character":24}]}],"ngOnDestroy":[{"__symbolic":"method"}],"doLogin":[{"__symbolic":"method"}],"doLogout":[{"__symbolic":"method"}],"doSamlLogin":[{"__symbolic":"method"}],"doSamlLogout":[{"__symbolic":"method"}],"getCurrentUser":[{"__symbolic":"method"}],"searchPersons":[{"__symbolic":"method"}],"getCurrentRoles":[{"__symbolic":"method"}],"saveCurrentUserInLS":[{"__symbolic":"method"}],"deleteCurrentUserInLS":[{"__symbolic":"method"}],"getCurrentUserFromLS":[{"__symbolic":"method"}],"getRolesPermitted":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"storageEventListener":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"normalizeLocalStorageItem":[{"__symbolic":"method"}],"handleError":[{"__symbolic":"method"}],"encode":[{"__symbolic":"method"}],"decode":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../build/constants.ts"],"names":[],"mappings":";;AAAa,QAAA,gBAAgB,GAAG,aAAa;AAChC,QAAA,mBAAmB,GAAG,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"LOCALSTORAGENAME":"currentUser"}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"LOCALSTORAGENAME":"currentUser","LOCALSTORAGEPROGRAM":"currentProgram"}}]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var core_1 = require("@angular/core");
|
|
4
|
+
var encryption_service_1 = require("./services/encryption.service");
|
|
5
|
+
var EncryptionModule = /** @class */ (function () {
|
|
6
|
+
function EncryptionModule() {
|
|
7
|
+
}
|
|
8
|
+
EncryptionModule.decorators = [
|
|
9
|
+
{ type: core_1.NgModule, args: [{
|
|
10
|
+
providers: [
|
|
11
|
+
encryption_service_1.EncryptionService
|
|
12
|
+
]
|
|
13
|
+
},] },
|
|
14
|
+
];
|
|
15
|
+
return EncryptionModule;
|
|
16
|
+
}());
|
|
17
|
+
exports.EncryptionModule = EncryptionModule;
|
|
18
|
+
//# sourceMappingURL=encryption.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.module.js","sourceRoot":"","sources":["../../build/encryption/encryption.module.ts"],"names":[],"mappings":";;AAAA,sCAAyC;AAEzC,oEAAkE;;;;;gBAEjE,eAAQ,SAAC;oBACR,SAAS,EAAE;wBACT,sCAAiB;qBAClB;iBACF;;2BARD;;AAUa,4CAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"EncryptionModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"providers":[{"__symbolic":"reference","module":"./services/encryption.service","name":"EncryptionService","line":6,"character":4}]}]}]}}}]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
__export(require("./encryption.module"));
|
|
7
|
+
__export(require("./interceptors/encryption.interceptor"));
|
|
8
|
+
__export(require("./rsa-public-key"));
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../build/encryption/index.ts"],"names":[],"mappings":";;;;;AAAA,yCAAmC;AACnC,2DAAsD;AACtD,sCAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./encryption.module"},{"from":"./interceptors/encryption.interceptor"},{"from":"./rsa-public-key"}]}]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { EncryptionService } from '../services/encryption.service';
|
|
4
|
+
export declare class EncryptionInterceptor implements HttpInterceptor {
|
|
5
|
+
private rsaPublicKey;
|
|
6
|
+
private encryptionService;
|
|
7
|
+
private endpointsToEncrypt;
|
|
8
|
+
constructor(rsaPublicKey: string, encryptionService: EncryptionService);
|
|
9
|
+
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
10
|
+
private encryptLastUrlSegment(request, urlSegments, queryString?);
|
|
11
|
+
private encryptBody(request);
|
|
12
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [0, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
var core_1 = require("@angular/core");
|
|
39
|
+
var from_1 = require("rxjs/observable/from");
|
|
40
|
+
var operators_1 = require("rxjs/operators");
|
|
41
|
+
var encryption_service_1 = require("../services/encryption.service");
|
|
42
|
+
var rsa_public_key_1 = require("../rsa-public-key");
|
|
43
|
+
var EncryptionInterceptor = /** @class */ (function () {
|
|
44
|
+
function EncryptionInterceptor(rsaPublicKey, encryptionService) {
|
|
45
|
+
this.rsaPublicKey = rsaPublicKey;
|
|
46
|
+
this.encryptionService = encryptionService;
|
|
47
|
+
this.endpointsToEncrypt = ['getPerson', 'getStudent', 'getStudentByUsername'];
|
|
48
|
+
}
|
|
49
|
+
EncryptionInterceptor.prototype.intercept = function (request, next) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var _a = request.urlWithParams.split('?'), url = _a[0], queryString = _a[1];
|
|
52
|
+
var urlSegments = url.split('/').filter(Boolean);
|
|
53
|
+
var endpointSegment = urlSegments[urlSegments.length - 2];
|
|
54
|
+
var requestPromise = Promise.resolve(request);
|
|
55
|
+
if (request.method === 'GET' && urlSegments.includes('core') && this.endpointsToEncrypt.includes(endpointSegment)) {
|
|
56
|
+
requestPromise = requestPromise.then(function (req) { return _this.encryptLastUrlSegment(req, urlSegments, queryString); });
|
|
57
|
+
}
|
|
58
|
+
if (request.body && urlSegments.includes('core')) {
|
|
59
|
+
requestPromise = requestPromise.then(function (req) { return _this.encryptBody(req); });
|
|
60
|
+
}
|
|
61
|
+
return from_1.from(requestPromise).pipe(operators_1.switchMap(function (clonedReq) { return next.handle(clonedReq); }));
|
|
62
|
+
};
|
|
63
|
+
EncryptionInterceptor.prototype.encryptLastUrlSegment = function (request, urlSegments, queryString) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var lastIndex, _a, _b, protocol, newUrl;
|
|
66
|
+
return __generator(this, function (_c) {
|
|
67
|
+
switch (_c.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
lastIndex = (urlSegments.length - 1);
|
|
70
|
+
_a = urlSegments;
|
|
71
|
+
_b = lastIndex;
|
|
72
|
+
return [4 /*yield*/, this.encryptionService.encryptValue(urlSegments[lastIndex], this.rsaPublicKey)];
|
|
73
|
+
case 1:
|
|
74
|
+
_a[_b] = _c.sent();
|
|
75
|
+
protocol = request.url.startsWith('https') ? 'https://' : 'http://';
|
|
76
|
+
newUrl = protocol + urlSegments.slice(1).join('/');
|
|
77
|
+
if (queryString) {
|
|
78
|
+
newUrl += "?" + queryString;
|
|
79
|
+
}
|
|
80
|
+
return [2 /*return*/, request.clone({ url: newUrl })];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
EncryptionInterceptor.prototype.encryptBody = function (request) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
+
var encrypted;
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0: return [4 /*yield*/, this.encryptionService.encryptValue(request.body, this.rsaPublicKey)];
|
|
91
|
+
case 1:
|
|
92
|
+
encrypted = _a.sent();
|
|
93
|
+
return [2 /*return*/, request.clone({ body: { payload: encrypted } })];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
EncryptionInterceptor.decorators = [
|
|
99
|
+
{ type: core_1.Injectable },
|
|
100
|
+
];
|
|
101
|
+
/** @nocollapse */
|
|
102
|
+
EncryptionInterceptor.ctorParameters = function () { return [
|
|
103
|
+
{ type: undefined, decorators: [{ type: core_1.Inject, args: [rsa_public_key_1.RSA_PUBLIC_KEY,] },] },
|
|
104
|
+
{ type: encryption_service_1.EncryptionService, },
|
|
105
|
+
]; };
|
|
106
|
+
return EncryptionInterceptor;
|
|
107
|
+
}());
|
|
108
|
+
exports.EncryptionInterceptor = EncryptionInterceptor;
|
|
109
|
+
//# sourceMappingURL=encryption.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.interceptor.js","sourceRoot":"","sources":["../../../build/encryption/interceptors/encryption.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAmD;AAGnD,6CAA4C;AAC5C,4CAA2C;AAG3C,qEAAmE;AAEnE,oDAAmD;;IAO/C,+BAEY,cACA,iBAAqC;QADrC,iBAAY,GAAZ,YAAY;QACZ,sBAAiB,GAAjB,iBAAiB,CAAoB;kCALpB,CAAC,WAAW,EAAE,YAAY,EAAE,sBAAsB,CAAC;KAM3E;IAEL,yCAAS,GAAT,UAAU,OAAyB,EAAE,IAAiB;QAAtD,iBAoBC;QAlBG,2CAAQ,WAAG,EAAE,mBAAW,CAAsC;QAC9D,IAAM,WAAW,GAAY,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5D,IAAM,eAAe,GAAQ,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEjE,IAAI,cAAc,GAAW,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtD,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAChH,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,KAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,EAAzD,CAAyD,CAAC,CAAC;SAC1G;QAED,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,WAAW,CAAC,QAAQ,CAAC,MA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wBAAtF,SAAS,GAAG,SAA0E;wBAC5F,sBAAO,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,EAAC;;;;KAE1D;;gBAzDJ,iBAAU;;;;gDAMF,aAAM,SAAC,+BAAc;gBAVrB,sCAAiB;;gCAP1B;;AAYa,sDAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"EncryptionInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":9},"arguments":[{"__symbolic":"reference","module":"../rsa-public-key","name":"RSA_PUBLIC_KEY","line":17,"character":16}]}],null],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../services/encryption.service","name":"EncryptionService","line":19,"character":36}]}],"intercept":[{"__symbolic":"method"}],"encryptLastUrlSegment":[{"__symbolic":"method"}],"encryptBody":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsa-public-key.js","sourceRoot":"","sources":["../../build/encryption/rsa-public-key.ts"],"names":[],"mappings":";;AAAA,sCAA+C;AAElC,QAAA,cAAc,GAAG,IAAI,qBAAc,CAAS,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"RSA_PUBLIC_KEY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":34},"arguments":["RSA_PUBLIC_KEY"]}}}]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class EncryptionService {
|
|
2
|
+
private generateAesGcmKey();
|
|
3
|
+
private generateAesGcmIv();
|
|
4
|
+
private encryptValueWithAesGcm(aesKey, iv, value);
|
|
5
|
+
private exportAesKeyToRaw(aesKey);
|
|
6
|
+
private pemPublicKeyToArrayBuffer(pem);
|
|
7
|
+
private importRsaOaepPublicKey(pem);
|
|
8
|
+
private encryptAesKeyWithRsaOaep(aesKeyRaw, rsaPublicKey);
|
|
9
|
+
private encodeBase64Url(buffer);
|
|
10
|
+
private buildEncryptedToken(encryptedAesKey, iv, encryptedData);
|
|
11
|
+
private safeExecute<T>(step, fn);
|
|
12
|
+
encryptValue(value: string | Record<string, any>, rsaPublicKeyPem: string): Promise<string>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [0, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
var core_1 = require("@angular/core");
|
|
39
|
+
var EncryptionService = /** @class */ (function () {
|
|
40
|
+
function EncryptionService() {
|
|
41
|
+
}
|
|
42
|
+
// Genera una clave simétrica AES-GCM de 256 bits
|
|
43
|
+
// Genera una clave simétrica AES-GCM de 256 bits
|
|
44
|
+
EncryptionService.prototype.generateAesGcmKey =
|
|
45
|
+
// Genera una clave simétrica AES-GCM de 256 bits
|
|
46
|
+
function () {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
return [2 /*return*/, crypto.subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt'])];
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
// Genera un vector de inicialización (IV) aleatorio de 12 bytes para AES-GCM
|
|
54
|
+
// Genera un vector de inicialización (IV) aleatorio de 12 bytes para AES-GCM
|
|
55
|
+
EncryptionService.prototype.generateAesGcmIv =
|
|
56
|
+
// Genera un vector de inicialización (IV) aleatorio de 12 bytes para AES-GCM
|
|
57
|
+
function () {
|
|
58
|
+
return crypto.getRandomValues(new Uint8Array(12));
|
|
59
|
+
};
|
|
60
|
+
// Cifra el valor usando AES-GCM con la clave y IV proporcionados
|
|
61
|
+
// Cifra el valor usando AES-GCM con la clave y IV proporcionados
|
|
62
|
+
EncryptionService.prototype.encryptValueWithAesGcm =
|
|
63
|
+
// Cifra el valor usando AES-GCM con la clave y IV proporcionados
|
|
64
|
+
function (aesKey, iv, value) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var subtle, encoder, valueAsString;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
subtle = crypto.subtle;
|
|
69
|
+
encoder = new TextEncoder();
|
|
70
|
+
valueAsString = typeof value === 'string' ? value : JSON.stringify(value);
|
|
71
|
+
return [2 /*return*/, subtle.encrypt({
|
|
72
|
+
name: 'AES-GCM',
|
|
73
|
+
iv: iv
|
|
74
|
+
}, aesKey, encoder.encode(valueAsString))];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
// Exporta una clave AES-GCM a formato binario (raw)
|
|
79
|
+
// Exporta una clave AES-GCM a formato binario (raw)
|
|
80
|
+
EncryptionService.prototype.exportAesKeyToRaw =
|
|
81
|
+
// Exporta una clave AES-GCM a formato binario (raw)
|
|
82
|
+
function (aesKey) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var subtle;
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
subtle = crypto.subtle;
|
|
87
|
+
return [2 /*return*/, subtle.exportKey('raw', aesKey)];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
// Convierte una clave pública RSA en formato PEM a ArrayBuffer
|
|
92
|
+
// Convierte una clave pública RSA en formato PEM a ArrayBuffer
|
|
93
|
+
EncryptionService.prototype.pemPublicKeyToArrayBuffer =
|
|
94
|
+
// Convierte una clave pública RSA en formato PEM a ArrayBuffer
|
|
95
|
+
function (pem) {
|
|
96
|
+
var cleanPem = pem.replace(/\s+/g, '');
|
|
97
|
+
var binary = atob(cleanPem);
|
|
98
|
+
var buffer = new Uint8Array(binary.length);
|
|
99
|
+
for (var i = 0; i < binary.length; i++) {
|
|
100
|
+
buffer[i] = binary.charCodeAt(i);
|
|
101
|
+
}
|
|
102
|
+
return buffer.buffer;
|
|
103
|
+
};
|
|
104
|
+
// Importa una clave pública RSA para cifrado usando RSA-OAEP
|
|
105
|
+
// Importa una clave pública RSA para cifrado usando RSA-OAEP
|
|
106
|
+
EncryptionService.prototype.importRsaOaepPublicKey =
|
|
107
|
+
// Importa una clave pública RSA para cifrado usando RSA-OAEP
|
|
108
|
+
function (pem) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
+
var subtle;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
subtle = crypto.subtle;
|
|
113
|
+
return [2 /*return*/, subtle.importKey('spki', this.pemPublicKeyToArrayBuffer(pem), { name: 'RSA-OAEP', hash: { name: 'SHA-1' } }, true, ['encrypt'])];
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
// Cifra una clave AES usando una clave pública RSA-OAEP
|
|
118
|
+
// Cifra una clave AES usando una clave pública RSA-OAEP
|
|
119
|
+
EncryptionService.prototype.encryptAesKeyWithRsaOaep =
|
|
120
|
+
// Cifra una clave AES usando una clave pública RSA-OAEP
|
|
121
|
+
function (aesKeyRaw, rsaPublicKey) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var subtle;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
subtle = crypto.subtle;
|
|
126
|
+
return [2 /*return*/, subtle.encrypt({ name: 'RSA-OAEP' }, rsaPublicKey, aesKeyRaw)];
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
// Codifica bytes en formato Base64URL seguro para transporte
|
|
131
|
+
// Codifica bytes en formato Base64URL seguro para transporte
|
|
132
|
+
EncryptionService.prototype.encodeBase64Url =
|
|
133
|
+
// Codifica bytes en formato Base64URL seguro para transporte
|
|
134
|
+
function (buffer) {
|
|
135
|
+
var bytes = buffer instanceof ArrayBuffer ? new Uint8Array(buffer) : buffer;
|
|
136
|
+
var binary = '';
|
|
137
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
138
|
+
binary += String.fromCharCode(bytes[i]);
|
|
139
|
+
}
|
|
140
|
+
var base64 = btoa(binary);
|
|
141
|
+
return base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
142
|
+
};
|
|
143
|
+
// Construye el token final con formato encryptedKey.iv.encryptedData (k.iv.d)
|
|
144
|
+
// Construye el token final con formato encryptedKey.iv.encryptedData (k.iv.d)
|
|
145
|
+
EncryptionService.prototype.buildEncryptedToken =
|
|
146
|
+
// Construye el token final con formato encryptedKey.iv.encryptedData (k.iv.d)
|
|
147
|
+
function (encryptedAesKey, iv, encryptedData) {
|
|
148
|
+
return (this.encodeBase64Url(encryptedAesKey) +
|
|
149
|
+
'.' +
|
|
150
|
+
this.encodeBase64Url(iv) +
|
|
151
|
+
'.' +
|
|
152
|
+
this.encodeBase64Url(encryptedData));
|
|
153
|
+
};
|
|
154
|
+
// Ejecuta una función y registra errores en consola
|
|
155
|
+
// Ejecuta una función y registra errores en consola
|
|
156
|
+
EncryptionService.prototype.safeExecute =
|
|
157
|
+
// Ejecuta una función y registra errores en consola
|
|
158
|
+
function (step, fn) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
+
var error_1;
|
|
161
|
+
return __generator(this, function (_a) {
|
|
162
|
+
switch (_a.label) {
|
|
163
|
+
case 0:
|
|
164
|
+
_a.trys.push([0, 2, , 3]);
|
|
165
|
+
return [4 /*yield*/, fn()];
|
|
166
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
167
|
+
case 2:
|
|
168
|
+
error_1 = _a.sent();
|
|
169
|
+
console.error("[Encryption] " + step + " failed", error_1);
|
|
170
|
+
throw error_1;
|
|
171
|
+
case 3: return [2 /*return*/];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
EncryptionService.prototype.encryptValue = function (value, rsaPublicKeyPem) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
+
var _this = this;
|
|
179
|
+
var aesKey, iv, encryptedData, aesKeyRaw, rsaPublicKey, encryptedAesKey;
|
|
180
|
+
return __generator(this, function (_a) {
|
|
181
|
+
switch (_a.label) {
|
|
182
|
+
case 0: return [4 /*yield*/, this.safeExecute('AES key generation', function () { return _this.generateAesGcmKey(); })];
|
|
183
|
+
case 1:
|
|
184
|
+
aesKey = _a.sent();
|
|
185
|
+
return [4 /*yield*/, this.safeExecute('AES IV generation', function () { return _this.generateAesGcmIv(); })];
|
|
186
|
+
case 2:
|
|
187
|
+
iv = _a.sent();
|
|
188
|
+
return [4 /*yield*/, this.safeExecute('AES encryption', function () { return _this.encryptValueWithAesGcm(aesKey, iv, value); })];
|
|
189
|
+
case 3:
|
|
190
|
+
encryptedData = _a.sent();
|
|
191
|
+
return [4 /*yield*/, this.safeExecute('AES key export', function () { return _this.exportAesKeyToRaw(aesKey); })];
|
|
192
|
+
case 4:
|
|
193
|
+
aesKeyRaw = _a.sent();
|
|
194
|
+
return [4 /*yield*/, this.safeExecute('RSA public key import', function () { return _this.importRsaOaepPublicKey(rsaPublicKeyPem); })];
|
|
195
|
+
case 5:
|
|
196
|
+
rsaPublicKey = _a.sent();
|
|
197
|
+
return [4 /*yield*/, this.safeExecute('AES key RSA encryption', function () { return _this.encryptAesKeyWithRsaOaep(aesKeyRaw, rsaPublicKey); })];
|
|
198
|
+
case 6:
|
|
199
|
+
encryptedAesKey = _a.sent();
|
|
200
|
+
return [2 /*return*/, this.buildEncryptedToken(encryptedAesKey, iv, encryptedData)];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
EncryptionService.decorators = [
|
|
206
|
+
{ type: core_1.Injectable },
|
|
207
|
+
];
|
|
208
|
+
return EncryptionService;
|
|
209
|
+
}());
|
|
210
|
+
exports.EncryptionService = EncryptionService;
|
|
211
|
+
//# sourceMappingURL=encryption.service.js.map
|