@igo2/auth 17.0.0-next.3 → 17.0.0-next.4
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/esm2022/monitoring/auth-monitoring/auth-monitoring.provider.mjs +24 -0
- package/esm2022/monitoring/auth-monitoring/auth-monitoring.service.mjs +54 -0
- package/esm2022/monitoring/igo2-auth-monitoring.mjs +5 -0
- package/esm2022/monitoring/public_api.mjs +3 -0
- package/esm2022/public_api.mjs +1 -3
- package/fesm2022/igo2-auth-monitoring.mjs +81 -0
- package/fesm2022/igo2-auth-monitoring.mjs.map +1 -0
- package/fesm2022/igo2-auth.mjs +3 -71
- package/fesm2022/igo2-auth.mjs.map +1 -1
- package/form/src/auth-form/auth-intern.theme.scss +19 -0
- package/form/src/auth-form.theme.scss +9 -0
- package/{lib → monitoring}/auth-monitoring/auth-monitoring.service.d.ts +1 -1
- package/monitoring/index.d.ts +5 -0
- package/monitoring/public_api.d.ts +2 -0
- package/package.json +9 -3
- package/public_api.d.ts +0 -2
- package/esm2022/lib/auth-monitoring/auth-monitoring.provider.mjs +0 -24
- package/esm2022/lib/auth-monitoring/auth-monitoring.service.mjs +0 -54
- package/esm2022/lib/shared/index.mjs +0 -10
- package/lib/shared/index.d.ts +0 -9
- /package/{lib → monitoring}/auth-monitoring/auth-monitoring.provider.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { APP_INITIALIZER, Injector } from '@angular/core';
|
|
2
|
+
import { ConfigService } from '@igo2/core/config';
|
|
3
|
+
import { MONITORING_OPTIONS } from '@igo2/core/monitoring';
|
|
4
|
+
import { AuthMonitoringService } from './auth-monitoring.service';
|
|
5
|
+
export function provideAuthUserMonitoring(options) {
|
|
6
|
+
if (!options) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
provide: AuthMonitoringService,
|
|
12
|
+
useClass: AuthMonitoringService,
|
|
13
|
+
deps: [ConfigService, MONITORING_OPTIONS, Injector]
|
|
14
|
+
},
|
|
15
|
+
// Force instantiate Tracing service to avoid require it in any constructor.
|
|
16
|
+
{
|
|
17
|
+
provide: APP_INITIALIZER,
|
|
18
|
+
useFactory: () => () => { },
|
|
19
|
+
deps: [AuthMonitoringService],
|
|
20
|
+
multi: true
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1tb25pdG9yaW5nLnByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYXV0aC9tb25pdG9yaW5nL3NyYy9hdXRoLW1vbml0b3JpbmcvYXV0aC1tb25pdG9yaW5nLnByb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFZLE1BQU0sZUFBZSxDQUFDO0FBRXBFLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNsRCxPQUFPLEVBRUwsa0JBQWtCLEVBQ25CLE1BQU0sdUJBQXVCLENBQUM7QUFFL0IsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFbEUsTUFBTSxVQUFVLHlCQUF5QixDQUN2QyxPQUFvQztJQUVwQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDYixPQUFPLEVBQUUsQ0FBQztJQUNaLENBQUM7SUFFRCxPQUFPO1FBQ0w7WUFDRSxPQUFPLEVBQUUscUJBQXFCO1lBQzlCLFFBQVEsRUFBRSxxQkFBcUI7WUFDL0IsSUFBSSxFQUFFLENBQUMsYUFBYSxFQUFFLGtCQUFrQixFQUFFLFFBQVEsQ0FBQztTQUNwRDtRQUNELDRFQUE0RTtRQUM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G4gICAgLy8gRm9yY2UgaW5zdGFudGlhdGUgVHJhY2luZyBzZXJ2aWNlIHRvIGF2b2lkIHJlcXVpcmUgaXQgaW4gYW55IGNvbnN0cnVjdG9yLlxyXG4gICAge1xyXG4gICAgICBwcm92aWRlOiBBUFBfSU5JVElBTElaRVIsXHJcbiAgICAgIHVzZUZhY3Rvcnk6ICgpID0+ICgpID0+IHt9LFxyXG4gICAgICBkZXBzOiBbQXV0aE1vbml0b3JpbmdTZXJ2aWNlXSxcclxuICAgICAgbXVsdGk6IHRydWVcclxuICAgIH1cclxuICBdO1xyXG59XHJcbiJdfQ==
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Inject, Injectable, Injector, Optional } from '@angular/core';
|
|
2
|
+
import { AuthService } from '@igo2/auth';
|
|
3
|
+
import { ConfigService } from '@igo2/core/config';
|
|
4
|
+
import { MONITORING_OPTIONS, identifySentryUser } from '@igo2/core/monitoring';
|
|
5
|
+
import { first, switchMap } from 'rxjs';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@igo2/core/config";
|
|
8
|
+
export class AuthMonitoringService {
|
|
9
|
+
configService;
|
|
10
|
+
monitoringOptions;
|
|
11
|
+
injector;
|
|
12
|
+
// The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
|
|
13
|
+
authService;
|
|
14
|
+
constructor(configService, monitoringOptions, injector) {
|
|
15
|
+
this.configService = configService;
|
|
16
|
+
this.monitoringOptions = monitoringOptions;
|
|
17
|
+
this.injector = injector;
|
|
18
|
+
if (!this.monitoringOptions?.identifyUser) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.configService.isLoaded$
|
|
22
|
+
.pipe(first((isLoaded) => isLoaded), switchMap(() => {
|
|
23
|
+
this.authService = this.injector.get(AuthService);
|
|
24
|
+
return this.authService?.authenticate$;
|
|
25
|
+
}))
|
|
26
|
+
.subscribe((isAuthenticated) => {
|
|
27
|
+
const user = isAuthenticated ? this.authService.user : null;
|
|
28
|
+
this._identifyUser(user);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
_identifyUser(user) {
|
|
32
|
+
switch (this.monitoringOptions.provider) {
|
|
33
|
+
case 'sentry':
|
|
34
|
+
identifySentryUser(user);
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i1.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root'
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: undefined, decorators: [{
|
|
49
|
+
type: Optional
|
|
50
|
+
}, {
|
|
51
|
+
type: Inject,
|
|
52
|
+
args: [MONITORING_OPTIONS]
|
|
53
|
+
}] }, { type: i0.Injector }] });
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1tb25pdG9yaW5nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hdXRoL21vbml0b3Jpbmcvc3JjL2F1dGgtbW9uaXRvcmluZy9hdXRoLW1vbml0b3Jpbmcuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQ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ICAgICAgcmV0dXJuIHRoaXMuYXV0aFNlcnZpY2U/LmF1dGhlbnRpY2F0ZSQ7XHJcbiAgICAgICAgfSlcclxuICAgICAgKVxyXG4gICAgICAuc3Vic2NyaWJlKChpc0F1dGhlbnRpY2F0ZWQpID0+IHtcclxuICAgICAgICBjb25zdCB1c2VyID0gaXNBdXRoZW50aWNhdGVkID8gdGhpcy5hdXRoU2VydmljZS51c2VyIDogbnVsbDtcclxuICAgICAgICB0aGlzLl9pZGVudGlmeVVzZXIodXNlcik7XHJcbiAgICAgIH0pO1xyXG4gIH1cclxuXHJcbiAgcHJpdmF0ZSBfaWRlbnRpZnlVc2VyKHVzZXI6IFVzZXIgfCBudWxsKTogdm9pZCB7XHJcbiAgICBzd2l0Y2ggKHRoaXMubW9uaXRvcmluZ09wdGlvbnMucHJvdmlkZXIpIHtcclxuICAgICAgY2FzZSAnc2VudHJ5JzpcclxuICAgICAgICBpZGVudGlmeVNlbnRyeVVzZXIodXNlcik7XHJcbiAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICBkZWZhdWx0OlxyXG4gICAgICAgIGJyZWFrO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWdvMi1hdXRoLW1vbml0b3JpbmcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9hdXRoL21vbml0b3Jpbmcvc3JjL2lnbzItYXV0aC1tb25pdG9yaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './auth-monitoring/auth-monitoring.provider';
|
|
2
|
+
export * from './auth-monitoring/auth-monitoring.service';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2F1dGgvbW9uaXRvcmluZy9zcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDRDQUE0QyxDQUFDO0FBQzNELGNBQWMsMkNBQTJDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2F1dGgtbW9uaXRvcmluZy9hdXRoLW1vbml0b3JpbmcucHJvdmlkZXInO1xuZXhwb3J0ICogZnJvbSAnLi9hdXRoLW1vbml0b3JpbmcvYXV0aC1tb25pdG9yaW5nLnNlcnZpY2UnO1xuIl19
|
package/esm2022/public_api.mjs
CHANGED
|
@@ -10,6 +10,4 @@ export * from './lib/shared/auth.interceptor';
|
|
|
10
10
|
export * from './lib/shared/auth.interface';
|
|
11
11
|
export * from './lib/shared/token.interface';
|
|
12
12
|
export * from './lib/shared/token.service';
|
|
13
|
-
|
|
14
|
-
export * from './lib/auth-monitoring/auth-monitoring.service';
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2F1dGgvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7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Bmcm9tICcuL2xpYi9zaGFyZWQvdG9rZW4uaW50ZXJmYWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NoYXJlZC90b2tlbi5zZXJ2aWNlJztcbiJdfQ==
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Optional, Inject, Injector, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import * as i1 from '@igo2/core/config';
|
|
4
|
+
import { ConfigService } from '@igo2/core/config';
|
|
5
|
+
import { identifySentryUser, MONITORING_OPTIONS } from '@igo2/core/monitoring';
|
|
6
|
+
import { AuthService } from '@igo2/auth';
|
|
7
|
+
import { first, switchMap } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
class AuthMonitoringService {
|
|
10
|
+
configService;
|
|
11
|
+
monitoringOptions;
|
|
12
|
+
injector;
|
|
13
|
+
// The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
|
|
14
|
+
authService;
|
|
15
|
+
constructor(configService, monitoringOptions, injector) {
|
|
16
|
+
this.configService = configService;
|
|
17
|
+
this.monitoringOptions = monitoringOptions;
|
|
18
|
+
this.injector = injector;
|
|
19
|
+
if (!this.monitoringOptions?.identifyUser) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.configService.isLoaded$
|
|
23
|
+
.pipe(first((isLoaded) => isLoaded), switchMap(() => {
|
|
24
|
+
this.authService = this.injector.get(AuthService);
|
|
25
|
+
return this.authService?.authenticate$;
|
|
26
|
+
}))
|
|
27
|
+
.subscribe((isAuthenticated) => {
|
|
28
|
+
const user = isAuthenticated ? this.authService.user : null;
|
|
29
|
+
this._identifyUser(user);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
_identifyUser(user) {
|
|
33
|
+
switch (this.monitoringOptions.provider) {
|
|
34
|
+
case 'sentry':
|
|
35
|
+
identifySentryUser(user);
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i1.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{
|
|
47
|
+
providedIn: 'root'
|
|
48
|
+
}]
|
|
49
|
+
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: undefined, decorators: [{
|
|
50
|
+
type: Optional
|
|
51
|
+
}, {
|
|
52
|
+
type: Inject,
|
|
53
|
+
args: [MONITORING_OPTIONS]
|
|
54
|
+
}] }, { type: i0.Injector }] });
|
|
55
|
+
|
|
56
|
+
function provideAuthUserMonitoring(options) {
|
|
57
|
+
if (!options) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
provide: AuthMonitoringService,
|
|
63
|
+
useClass: AuthMonitoringService,
|
|
64
|
+
deps: [ConfigService, MONITORING_OPTIONS, Injector]
|
|
65
|
+
},
|
|
66
|
+
// Force instantiate Tracing service to avoid require it in any constructor.
|
|
67
|
+
{
|
|
68
|
+
provide: APP_INITIALIZER,
|
|
69
|
+
useFactory: () => () => { },
|
|
70
|
+
deps: [AuthMonitoringService],
|
|
71
|
+
multi: true
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generated bundle index. Do not edit.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
export { AuthMonitoringService, provideAuthUserMonitoring };
|
|
81
|
+
//# sourceMappingURL=igo2-auth-monitoring.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Inject, Injectable, Injector, Optional } from '@angular/core';\r\n\r\nimport { AuthService, User } from '@igo2/auth';\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS,\r\n identifySentryUser\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { first, switchMap } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthMonitoringService {\r\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\r\n authService?: AuthService;\r\n\r\n constructor(\r\n private configService: ConfigService,\r\n @Optional()\r\n @Inject(MONITORING_OPTIONS)\r\n private monitoringOptions: AnyMonitoringOptions | null,\r\n private injector: Injector\r\n ) {\r\n if (!this.monitoringOptions?.identifyUser) {\r\n return;\r\n }\r\n\r\n this.configService.isLoaded$\r\n .pipe(\r\n first((isLoaded) => isLoaded),\r\n switchMap(() => {\r\n this.authService = this.injector.get(AuthService);\r\n return this.authService?.authenticate$;\r\n })\r\n )\r\n .subscribe((isAuthenticated) => {\r\n const user = isAuthenticated ? this.authService.user : null;\r\n this._identifyUser(user);\r\n });\r\n }\r\n\r\n private _identifyUser(user: User | null): void {\r\n switch (this.monitoringOptions.provider) {\r\n case 'sentry':\r\n identifySentryUser(user);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n}\r\n","import { APP_INITIALIZER, Injector, Provider } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { AuthMonitoringService } from './auth-monitoring.service';\r\n\r\nexport function provideAuthUserMonitoring(\r\n options: AnyMonitoringOptions | null\r\n): Provider[] {\r\n if (!options) {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n provide: AuthMonitoringService,\r\n useClass: AuthMonitoringService,\r\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\r\n },\r\n // Force instantiate Tracing service to avoid require it in any constructor.\r\n {\r\n provide: APP_INITIALIZER,\r\n useFactory: () => () => {},\r\n deps: [AuthMonitoringService],\r\n multi: true\r\n }\r\n ];\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,qBAAqB,CAAA;AAKtB,IAAA,aAAA,CAAA;AAGA,IAAA,iBAAA,CAAA;AACA,IAAA,QAAA,CAAA;;AAPV,IAAA,WAAW,CAAe;AAE1B,IAAA,WAAA,CACU,aAA4B,EAG5B,iBAA8C,EAC9C,QAAkB,EAAA;QAJlB,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAG5B,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAA6B;QAC9C,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AAE1B,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC,OAAO;SACR;QAED,IAAI,CAAC,aAAa,CAAC,SAAS;AACzB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAAK;YACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAClD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC;AACzC,SAAC,CAAC,CACH;AACA,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IA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EAAE,qBAAqB;AAC/B,YAAA,IAAI,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,QAAQ,CAAC;AACpD,SAAA;;AAED,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,UAAU,EAAE,MAAM,SAAQ;YAC1B,IAAI,EAAE,CAAC,qBAAqB,CAAC;AAC7B,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;KACF,CAAC;AACJ;;AC/BA;;AAEG;;;;"}
|
package/fesm2022/igo2-auth.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import * as i1 from '@angular/common/http';
|
|
2
2
|
import { HttpHeaders } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Optional
|
|
4
|
+
import { Injectable, Optional } from '@angular/core';
|
|
5
5
|
import * as i3 from '@angular/router';
|
|
6
6
|
import * as i2 from '@igo2/core/config';
|
|
7
7
|
import { ConfigService } from '@igo2/core/config';
|
|
8
8
|
import * as i4 from '@igo2/core/language';
|
|
9
9
|
import * as i5 from '@igo2/core/message';
|
|
10
10
|
import { Base64 } from '@igo2/utils';
|
|
11
|
-
import { BehaviorSubject, of
|
|
11
|
+
import { BehaviorSubject, of } from 'rxjs';
|
|
12
12
|
import { tap, catchError, map } from 'rxjs/operators';
|
|
13
13
|
import { globalCacheBusterNotifier } from 'ts-cacheable';
|
|
14
14
|
import { jwtDecode } from 'jwt-decode';
|
|
15
15
|
import { Md5 } from 'ts-md5';
|
|
16
|
-
import { identifySentryUser, MONITORING_OPTIONS } from '@igo2/core/monitoring';
|
|
17
16
|
|
|
18
17
|
class TokenService {
|
|
19
18
|
injector;
|
|
@@ -493,73 +492,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
493
492
|
}]
|
|
494
493
|
}], ctorParameters: () => [{ type: i2.ConfigService }, { type: TokenService }, { type: i1.HttpClient }] });
|
|
495
494
|
|
|
496
|
-
class AuthMonitoringService {
|
|
497
|
-
configService;
|
|
498
|
-
monitoringOptions;
|
|
499
|
-
injector;
|
|
500
|
-
// The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
|
|
501
|
-
authService;
|
|
502
|
-
constructor(configService, monitoringOptions, injector) {
|
|
503
|
-
this.configService = configService;
|
|
504
|
-
this.monitoringOptions = monitoringOptions;
|
|
505
|
-
this.injector = injector;
|
|
506
|
-
if (!this.monitoringOptions?.identifyUser) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
this.configService.isLoaded$
|
|
510
|
-
.pipe(first((isLoaded) => isLoaded), switchMap(() => {
|
|
511
|
-
this.authService = this.injector.get(AuthService);
|
|
512
|
-
return this.authService?.authenticate$;
|
|
513
|
-
}))
|
|
514
|
-
.subscribe((isAuthenticated) => {
|
|
515
|
-
const user = isAuthenticated ? this.authService.user : null;
|
|
516
|
-
this._identifyUser(user);
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
_identifyUser(user) {
|
|
520
|
-
switch (this.monitoringOptions.provider) {
|
|
521
|
-
case 'sentry':
|
|
522
|
-
identifySentryUser(user);
|
|
523
|
-
break;
|
|
524
|
-
default:
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i2.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
529
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
530
|
-
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
532
|
-
type: Injectable,
|
|
533
|
-
args: [{
|
|
534
|
-
providedIn: 'root'
|
|
535
|
-
}]
|
|
536
|
-
}], ctorParameters: () => [{ type: i2.ConfigService }, { type: undefined, decorators: [{
|
|
537
|
-
type: Optional
|
|
538
|
-
}, {
|
|
539
|
-
type: Inject,
|
|
540
|
-
args: [MONITORING_OPTIONS]
|
|
541
|
-
}] }, { type: i0.Injector }] });
|
|
542
|
-
|
|
543
|
-
function provideAuthUserMonitoring(options) {
|
|
544
|
-
if (!options) {
|
|
545
|
-
return [];
|
|
546
|
-
}
|
|
547
|
-
return [
|
|
548
|
-
{
|
|
549
|
-
provide: AuthMonitoringService,
|
|
550
|
-
useClass: AuthMonitoringService,
|
|
551
|
-
deps: [ConfigService, MONITORING_OPTIONS, Injector]
|
|
552
|
-
},
|
|
553
|
-
// Force instantiate Tracing service to avoid require it in any constructor.
|
|
554
|
-
{
|
|
555
|
-
provide: APP_INITIALIZER,
|
|
556
|
-
useFactory: () => () => { },
|
|
557
|
-
deps: [AuthMonitoringService],
|
|
558
|
-
multi: true
|
|
559
|
-
}
|
|
560
|
-
];
|
|
561
|
-
}
|
|
562
|
-
|
|
563
495
|
/*
|
|
564
496
|
* Public API Surface of auth
|
|
565
497
|
*/
|
|
@@ -568,5 +500,5 @@ function provideAuthUserMonitoring(options) {
|
|
|
568
500
|
* Generated bundle index. Do not edit.
|
|
569
501
|
*/
|
|
570
502
|
|
|
571
|
-
export { AdminGuard, AuthGuard, AuthInterceptor,
|
|
503
|
+
export { AdminGuard, AuthGuard, AuthInterceptor, AuthService, LoggedGuard, ProfilsGuard, TokenService };
|
|
572
504
|
//# sourceMappingURL=igo2-auth.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-auth.mjs","sources":["../../../packages/auth/src/lib/shared/token.service.ts","../../../packages/auth/src/lib/shared/auth.service.ts","../../../packages/auth/src/lib/shared/logged.guard.ts","../../../packages/auth/src/lib/shared/auth.guard.ts","../../../packages/auth/src/lib/shared/admin.guard.ts","../../../packages/auth/src/lib/shared/profils.guard.ts","../../../packages/auth/src/lib/shared/auth.interceptor.ts","../../../packages/auth/src/lib/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/src/lib/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/src/public_api.ts","../../../packages/auth/src/igo2-auth.ts"],"sourcesContent":["import { Injectable, Injector } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { jwtDecode } from 'jwt-decode';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { IgoJwtPayload } from './token.interface';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class TokenService {\r\n private options?: AuthOptions;\r\n private tokenKey: string;\r\n\r\n constructor(private injector: Injector) {\r\n const config = this.injector.get<ConfigService>(ConfigService);\r\n this.options = config.getConfig('auth');\r\n this.tokenKey = this.options?.tokenKey;\r\n }\r\n\r\n set(token: string) {\r\n localStorage.setItem(this.tokenKey, token);\r\n }\r\n\r\n remove() {\r\n localStorage.removeItem(this.tokenKey);\r\n }\r\n\r\n get(): string {\r\n return localStorage.getItem(this.tokenKey);\r\n }\r\n\r\n decode(): IgoJwtPayload | null {\r\n const token = this.get();\r\n if (!token) {\r\n return;\r\n }\r\n return jwtDecode(token) satisfies IgoJwtPayload;\r\n }\r\n\r\n isExpired() {\r\n const jwt = this.decode();\r\n const currentTime = new Date().getTime() / 1000;\r\n if (jwt && currentTime < jwt.exp) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable, Optional } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport { LanguageService } from '@igo2/core/language';\r\nimport { MessageService } from '@igo2/core/message';\r\nimport { Base64 } from '@igo2/utils';\r\n\r\nimport { BehaviorSubject, Observable, of } from 'rxjs';\r\nimport { catchError, tap } from 'rxjs/operators';\r\nimport { globalCacheBusterNotifier } from 'ts-cacheable';\r\n\r\nimport { AuthOptions, IInfosUser, User } from './auth.interface';\r\nimport { IgoJwtPayload } from './token.interface';\r\nimport { TokenService } from './token.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthService {\r\n public authenticate$ = new BehaviorSubject<boolean>(undefined);\r\n public logged$ = new BehaviorSubject<boolean>(undefined);\r\n public redirectUrl: string;\r\n public languageForce = false;\r\n private anonymous = false;\r\n private authOptions: AuthOptions;\r\n\r\n get hasAuthService() {\r\n return this.authOptions?.url !== undefined;\r\n }\r\n\r\n get user(): User | null {\r\n const decodedToken = this.decodeToken();\r\n return decodedToken?.user ? decodedToken.user : null;\r\n }\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private tokenService: TokenService,\r\n private config: ConfigService,\r\n private languageService: LanguageService,\r\n private messageService: MessageService,\r\n @Optional() private router: Router\r\n ) {\r\n this.authOptions = this.config.getConfig('auth');\r\n this.authenticate$.next(this.authenticated);\r\n this.authenticate$.subscribe((authenticated) => {\r\n this.logged$.next(authenticated);\r\n globalCacheBusterNotifier.next();\r\n });\r\n }\r\n\r\n login(username: string, password: string): Observable<void> {\r\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\r\n\r\n const body = {\r\n username,\r\n password: this.encodePassword(password)\r\n };\r\n\r\n return this.loginCall(body, myHeader);\r\n }\r\n\r\n loginWithToken(\r\n token: string,\r\n type: string,\r\n infosUser?: IInfosUser\r\n ): Observable<void> {\r\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\r\n\r\n const body = {\r\n token,\r\n typeConnection: type,\r\n infosUser\r\n };\r\n\r\n return this.loginCall(body, myHeader);\r\n }\r\n\r\n loginAnonymous(): Observable<boolean> {\r\n this.anonymous = true;\r\n this.logged$.next(true);\r\n return of(true);\r\n }\r\n\r\n refresh(): Observable<void> {\r\n return this.http.post(`${this.authOptions?.url}/refresh`, {}).pipe(\r\n tap((data: any) => {\r\n this.tokenService.set(data.token);\r\n }),\r\n catchError((err) => {\r\n err.error.caught = true;\r\n throw err;\r\n })\r\n );\r\n }\r\n\r\n logout(): Observable<boolean> {\r\n this.anonymous = false;\r\n this.tokenService.remove();\r\n this.authenticate$.next(false);\r\n return of(true);\r\n }\r\n\r\n isAuthenticated(): boolean {\r\n return !this.tokenService.isExpired();\r\n }\r\n\r\n getToken(): string {\r\n return this.tokenService.get();\r\n }\r\n\r\n decodeToken(): IgoJwtPayload | null {\r\n if (this.isAuthenticated()) {\r\n return this.tokenService.decode();\r\n }\r\n return;\r\n }\r\n\r\n goToRedirectUrl() {\r\n if (!this.router) {\r\n return;\r\n }\r\n const redirectUrl = this.redirectUrl || this.router.url;\r\n\r\n if (redirectUrl === this.authOptions.loginRoute) {\r\n const homeRoute = this.authOptions.homeRoute || '/';\r\n this.router.navigateByUrl(homeRoute);\r\n } else if (redirectUrl) {\r\n this.router.navigateByUrl(redirectUrl);\r\n }\r\n }\r\n\r\n getUserInfo(): Observable<User> {\r\n const url = this.authOptions?.url + '/info';\r\n return this.http.get<User>(url);\r\n }\r\n\r\n getProfils(): Observable<{ profils: string[] }> {\r\n return this.http.get<{ profils: string[] }>(\r\n `${this.authOptions?.url}/profils`\r\n );\r\n }\r\n\r\n updateUser(user: User): Observable<User> {\r\n return this.http.patch<User>(this.authOptions?.url, user);\r\n }\r\n\r\n private encodePassword(password: string) {\r\n return Base64.encode(password);\r\n }\r\n\r\n // authenticated or anonymous\r\n get logged(): boolean {\r\n return this.authenticated || this.isAnonymous;\r\n }\r\n\r\n get isAnonymous(): boolean {\r\n return this.anonymous;\r\n }\r\n\r\n get authenticated(): boolean {\r\n return this.isAuthenticated();\r\n }\r\n\r\n get isAdmin(): boolean {\r\n const token = this.decodeToken();\r\n if (token?.user?.isAdmin) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private loginCall(body, headers) {\r\n return this.http\r\n .post(`${this.authOptions?.url}/login`, body, { headers })\r\n .pipe(\r\n tap((data: any) => {\r\n this.tokenService.set(data.token);\r\n const tokenDecoded = this.decodeToken();\r\n if (tokenDecoded?.user) {\r\n if (tokenDecoded.user.locale && !this.languageForce) {\r\n this.languageService.setLanguage(tokenDecoded.user.locale);\r\n }\r\n if (tokenDecoded.user.isExpired) {\r\n this.messageService.alert('igo.auth.error.Password expired');\r\n }\r\n }\r\n this.authenticate$.next(true);\r\n }),\r\n catchError((err) => {\r\n err.error.caught = true;\r\n throw err;\r\n })\r\n );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class LoggedGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.logged) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.authenticated) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AdminGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.isAdmin) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { map } from 'rxjs/operators';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ProfilsGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n return this.authService.getProfils().pipe(\r\n map((profils: { profils: string[] }) => {\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (\r\n profils &&\r\n profils.profils &&\r\n profils.profils.some((v) => authConfig.profilsGuard.indexOf(v) !== -1)\r\n ) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n })\r\n );\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport {\r\n HttpEvent,\r\n HttpHandler,\r\n HttpInterceptor,\r\n HttpRequest\r\n} from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { Observable } from 'rxjs';\r\nimport { Md5 } from 'ts-md5';\r\n\r\nimport {\r\n AuthByKeyOptions,\r\n AuthOptions,\r\n WithCredentialsOptions\r\n} from './auth.interface';\r\nimport { TokenService } from './token.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthInterceptor implements HttpInterceptor {\r\n private authOptions: AuthOptions;\r\n private refreshInProgress = false;\r\n private trustHosts: string[];\r\n private hostsWithCredentials: WithCredentialsOptions[];\r\n private hostsWithAuthByKey: AuthByKeyOptions[];\r\n\r\n constructor(\r\n private config: ConfigService,\r\n private tokenService: TokenService,\r\n private http: HttpClient\r\n ) {\r\n this.authOptions = this.config.getConfig('auth') as AuthOptions;\r\n\r\n this.trustHosts = this.authOptions?.trustHosts || [];\r\n this.trustHosts.push(window.location.hostname);\r\n\r\n this.hostsWithCredentials = this.authOptions?.hostsWithCredentials || [];\r\n this.hostsWithAuthByKey = this.authOptions?.hostsByKey || [];\r\n }\r\n\r\n intercept(\r\n originalReq: HttpRequest<any>,\r\n next: HttpHandler\r\n ): Observable<HttpEvent<any>> {\r\n const withCredentials = this.handleHostsWithCredentials(originalReq.url);\r\n let req = originalReq.clone();\r\n const hostWithKey = this.handleHostsAuthByKey(originalReq.url);\r\n if (hostWithKey) {\r\n req = req.clone({\r\n params: req.params.set(hostWithKey.key, hostWithKey.value)\r\n });\r\n }\r\n if (withCredentials) {\r\n req = originalReq.clone({\r\n withCredentials\r\n });\r\n return next.handle(req);\r\n }\r\n this.refreshToken();\r\n const token = this.tokenService.get();\r\n const element = document.createElement('a');\r\n element.href = req.url;\r\n if (element.host === '') {\r\n element.href = element.href; // FIX IE11, DO NOT REMOVE\r\n }\r\n\r\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\r\n return next.handle(req);\r\n }\r\n\r\n const authHeader = `Bearer ${token}`;\r\n let authReq = req.clone({\r\n headers: req.headers.set('Authorization', authHeader)\r\n });\r\n\r\n const tokenDecoded = this.tokenService.decode();\r\n if (authReq.params.get('_i') === 'true' && tokenDecoded?.user?.sourceId) {\r\n const hashUser = Md5.hashStr(tokenDecoded.user.sourceId) as string;\r\n authReq = authReq.clone({\r\n params: authReq.params.set('_i', hashUser)\r\n });\r\n } else if (authReq.params.get('_i') === 'true') {\r\n authReq = authReq.clone({\r\n params: authReq.params.delete('_i')\r\n });\r\n }\r\n\r\n return next.handle(authReq);\r\n }\r\n\r\n interceptXhr(xhr, url: string): boolean {\r\n const withCredentials = this.handleHostsWithCredentials(url);\r\n if (withCredentials) {\r\n xhr.withCredentials = withCredentials;\r\n return true;\r\n }\r\n\r\n this.refreshToken();\r\n const element = document.createElement('a');\r\n element.href = url;\r\n\r\n const token = this.tokenService.get();\r\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\r\n return false;\r\n }\r\n xhr.setRequestHeader('Authorization', 'Bearer ' + token);\r\n return true;\r\n }\r\n\r\n alterUrlWithKeyAuth(url: string): string {\r\n const hostWithKey = this.handleHostsAuthByKey(url);\r\n let interceptedUrl = url;\r\n if (hostWithKey) {\r\n const urlDecomposed = interceptedUrl.split(/[?&]/);\r\n let urlWithKeyAdded = urlDecomposed.shift();\r\n const paramsToKeep = urlDecomposed.filter((p) => p.length !== 0);\r\n paramsToKeep.push(`${hostWithKey.key}=${hostWithKey.value}`);\r\n if (paramsToKeep.length) {\r\n urlWithKeyAdded += '?' + paramsToKeep.join('&');\r\n }\r\n return urlWithKeyAdded;\r\n }\r\n return;\r\n }\r\n\r\n private handleHostsWithCredentials(reqUrl: string) {\r\n let withCredentials = false;\r\n for (const hostWithCredentials of this.hostsWithCredentials) {\r\n const domainRegex = new RegExp(hostWithCredentials.domainRegFilters);\r\n if (domainRegex.test(reqUrl)) {\r\n withCredentials =\r\n hostWithCredentials.withCredentials !== undefined\r\n ? hostWithCredentials.withCredentials\r\n : undefined;\r\n break;\r\n }\r\n }\r\n return withCredentials;\r\n }\r\n\r\n private handleHostsAuthByKey(reqUrl: string): { key: string; value: string } {\r\n let hostWithKey;\r\n for (const hostWithAuthByKey of this.hostsWithAuthByKey) {\r\n const domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);\r\n if (domainRegex.test(reqUrl)) {\r\n var replace = `${hostWithAuthByKey.keyProperty}=${hostWithAuthByKey.keyValue}`;\r\n var keyAdded = new RegExp(replace, 'gm');\r\n if (!keyAdded.test(reqUrl)) {\r\n hostWithKey = {\r\n key: hostWithAuthByKey.keyProperty,\r\n value: hostWithAuthByKey.keyValue\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n return hostWithKey;\r\n }\r\n\r\n refreshToken() {\r\n const jwt = this.tokenService.decode();\r\n const currentTime = new Date().getTime() / 1000;\r\n\r\n if (\r\n !this.refreshInProgress &&\r\n jwt &&\r\n currentTime < jwt.exp &&\r\n currentTime > jwt.exp - 1800\r\n ) {\r\n this.refreshInProgress = true;\r\n\r\n const url = this.authOptions?.url;\r\n return this.http.post(`${url}/refresh`, {}).subscribe(\r\n (data: any) => {\r\n this.tokenService.set(data.token);\r\n this.refreshInProgress = false;\r\n },\r\n (err) => {\r\n err.error.caught = true;\r\n return err;\r\n }\r\n );\r\n }\r\n }\r\n}\r\n","import { Inject, Injectable, Injector, Optional } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS,\r\n identifySentryUser\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { first, switchMap } from 'rxjs';\r\n\r\nimport { AuthService, User } from '../shared';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthMonitoringService {\r\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\r\n authService?: AuthService;\r\n\r\n constructor(\r\n private configService: ConfigService,\r\n @Optional()\r\n @Inject(MONITORING_OPTIONS)\r\n private monitoringOptions: AnyMonitoringOptions | null,\r\n private injector: Injector\r\n ) {\r\n if (!this.monitoringOptions?.identifyUser) {\r\n return;\r\n }\r\n\r\n this.configService.isLoaded$\r\n .pipe(\r\n first((isLoaded) => isLoaded),\r\n switchMap(() => {\r\n this.authService = this.injector.get(AuthService);\r\n return this.authService?.authenticate$;\r\n })\r\n )\r\n .subscribe((isAuthenticated) => {\r\n const user = isAuthenticated ? this.authService.user : null;\r\n this._identifyUser(user);\r\n });\r\n }\r\n\r\n private _identifyUser(user: User | null): void {\r\n switch (this.monitoringOptions.provider) {\r\n case 'sentry':\r\n identifySentryUser(user);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n}\r\n","import { APP_INITIALIZER, Injector, Provider } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { AuthMonitoringService } from './auth-monitoring.service';\r\n\r\nexport function provideAuthUserMonitoring(\r\n options: AnyMonitoringOptions | null\r\n): Provider[] {\r\n if (!options) {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n provide: AuthMonitoringService,\r\n useClass: AuthMonitoringService,\r\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\r\n },\r\n // Force instantiate Tracing service to avoid require it in any constructor.\r\n {\r\n provide: APP_INITIALIZER,\r\n useFactory: () => () => {},\r\n deps: [AuthMonitoringService],\r\n multi: true\r\n }\r\n ];\r\n}\r\n","/*\n * Public API Surface of auth\n */\nexport * from './lib/shared/auth.service';\nexport * from './lib/shared/logged.guard';\nexport * from './lib/shared/auth.guard';\nexport * from './lib/shared/admin.guard';\nexport * from './lib/shared/profils.guard';\nexport * from './lib/shared/auth.interceptor';\nexport * from './lib/shared/auth.interface';\nexport * from './lib/shared/token.interface';\nexport * from './lib/shared/token.service';\nexport * from './lib/auth-monitoring/auth-monitoring.provider';\nexport * from './lib/auth-monitoring/auth-monitoring.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.TokenService","i3","i6","i1.AuthService","i1"],"mappings":";;;;;;;;;;;;;;;;;MAYa,YAAY,CAAA;AAIH,IAAA,QAAA,CAAA;AAHZ,IAAA,OAAO,CAAe;AACtB,IAAA,QAAQ,CAAS;AAEzB,IAAA,WAAA,CAAoB,QAAkB,EAAA;QAAlB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAgB,aAAa,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;KACxC;AAED,IAAA,GAAG,CAAC,KAAa,EAAA;QACf,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,GAAA;AACJ,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACxC;IAED,GAAG,GAAA;QACD,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC5C;IAED,MAAM,GAAA;AACJ,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;AACD,QAAA,OAAO,SAAS,CAAC,KAAK,CAAyB,CAAC;KACjD;IAED,SAAS,GAAA;AACP,QAA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EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;0BAOI,QAAQ;;0BACR,MAAM;2BAAC,kBAAkB,CAAA;;;ACbxB,SAAU,yBAAyB,CACvC,OAAoC,EAAA;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,EAAE,CAAC;KACX;IAED,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,IAAI,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,QAAQ,CAAC;AACpD,SAAA;;AAED,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,UAAU,EAAE,MAAM,SAAQ;YAC1B,IAAI,EAAE,CAAC,qBAAqB,CAAC;AAC7B,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;KACF,CAAC;AACJ;;AC/BA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"igo2-auth.mjs","sources":["../../../packages/auth/src/lib/shared/token.service.ts","../../../packages/auth/src/lib/shared/auth.service.ts","../../../packages/auth/src/lib/shared/logged.guard.ts","../../../packages/auth/src/lib/shared/auth.guard.ts","../../../packages/auth/src/lib/shared/admin.guard.ts","../../../packages/auth/src/lib/shared/profils.guard.ts","../../../packages/auth/src/lib/shared/auth.interceptor.ts","../../../packages/auth/src/public_api.ts","../../../packages/auth/src/igo2-auth.ts"],"sourcesContent":["import { Injectable, Injector } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { jwtDecode } from 'jwt-decode';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { IgoJwtPayload } from './token.interface';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class TokenService {\r\n private options?: AuthOptions;\r\n private tokenKey: string;\r\n\r\n constructor(private injector: Injector) {\r\n const config = this.injector.get<ConfigService>(ConfigService);\r\n this.options = config.getConfig('auth');\r\n this.tokenKey = this.options?.tokenKey;\r\n }\r\n\r\n set(token: string) {\r\n localStorage.setItem(this.tokenKey, token);\r\n }\r\n\r\n remove() {\r\n localStorage.removeItem(this.tokenKey);\r\n }\r\n\r\n get(): string {\r\n return localStorage.getItem(this.tokenKey);\r\n }\r\n\r\n decode(): IgoJwtPayload | null {\r\n const token = this.get();\r\n if (!token) {\r\n return;\r\n }\r\n return jwtDecode(token) satisfies IgoJwtPayload;\r\n }\r\n\r\n isExpired() {\r\n const jwt = this.decode();\r\n const currentTime = new Date().getTime() / 1000;\r\n if (jwt && currentTime < jwt.exp) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable, Optional } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport { LanguageService } from '@igo2/core/language';\r\nimport { MessageService } from '@igo2/core/message';\r\nimport { Base64 } from '@igo2/utils';\r\n\r\nimport { BehaviorSubject, Observable, of } from 'rxjs';\r\nimport { catchError, tap } from 'rxjs/operators';\r\nimport { globalCacheBusterNotifier } from 'ts-cacheable';\r\n\r\nimport { AuthOptions, IInfosUser, User } from './auth.interface';\r\nimport { IgoJwtPayload } from './token.interface';\r\nimport { TokenService } from './token.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthService {\r\n public authenticate$ = new BehaviorSubject<boolean>(undefined);\r\n public logged$ = new BehaviorSubject<boolean>(undefined);\r\n public redirectUrl: string;\r\n public languageForce = false;\r\n private anonymous = false;\r\n private authOptions: AuthOptions;\r\n\r\n get hasAuthService() {\r\n return this.authOptions?.url !== undefined;\r\n }\r\n\r\n get user(): User | null {\r\n const decodedToken = this.decodeToken();\r\n return decodedToken?.user ? decodedToken.user : null;\r\n }\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private tokenService: TokenService,\r\n private config: ConfigService,\r\n private languageService: LanguageService,\r\n private messageService: MessageService,\r\n @Optional() private router: Router\r\n ) {\r\n this.authOptions = this.config.getConfig('auth');\r\n this.authenticate$.next(this.authenticated);\r\n this.authenticate$.subscribe((authenticated) => {\r\n this.logged$.next(authenticated);\r\n globalCacheBusterNotifier.next();\r\n });\r\n }\r\n\r\n login(username: string, password: string): Observable<void> {\r\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\r\n\r\n const body = {\r\n username,\r\n password: this.encodePassword(password)\r\n };\r\n\r\n return this.loginCall(body, myHeader);\r\n }\r\n\r\n loginWithToken(\r\n token: string,\r\n type: string,\r\n infosUser?: IInfosUser\r\n ): Observable<void> {\r\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\r\n\r\n const body = {\r\n token,\r\n typeConnection: type,\r\n infosUser\r\n };\r\n\r\n return this.loginCall(body, myHeader);\r\n }\r\n\r\n loginAnonymous(): Observable<boolean> {\r\n this.anonymous = true;\r\n this.logged$.next(true);\r\n return of(true);\r\n }\r\n\r\n refresh(): Observable<void> {\r\n return this.http.post(`${this.authOptions?.url}/refresh`, {}).pipe(\r\n tap((data: any) => {\r\n this.tokenService.set(data.token);\r\n }),\r\n catchError((err) => {\r\n err.error.caught = true;\r\n throw err;\r\n })\r\n );\r\n }\r\n\r\n logout(): Observable<boolean> {\r\n this.anonymous = false;\r\n this.tokenService.remove();\r\n this.authenticate$.next(false);\r\n return of(true);\r\n }\r\n\r\n isAuthenticated(): boolean {\r\n return !this.tokenService.isExpired();\r\n }\r\n\r\n getToken(): string {\r\n return this.tokenService.get();\r\n }\r\n\r\n decodeToken(): IgoJwtPayload | null {\r\n if (this.isAuthenticated()) {\r\n return this.tokenService.decode();\r\n }\r\n return;\r\n }\r\n\r\n goToRedirectUrl() {\r\n if (!this.router) {\r\n return;\r\n }\r\n const redirectUrl = this.redirectUrl || this.router.url;\r\n\r\n if (redirectUrl === this.authOptions.loginRoute) {\r\n const homeRoute = this.authOptions.homeRoute || '/';\r\n this.router.navigateByUrl(homeRoute);\r\n } else if (redirectUrl) {\r\n this.router.navigateByUrl(redirectUrl);\r\n }\r\n }\r\n\r\n getUserInfo(): Observable<User> {\r\n const url = this.authOptions?.url + '/info';\r\n return this.http.get<User>(url);\r\n }\r\n\r\n getProfils(): Observable<{ profils: string[] }> {\r\n return this.http.get<{ profils: string[] }>(\r\n `${this.authOptions?.url}/profils`\r\n );\r\n }\r\n\r\n updateUser(user: User): Observable<User> {\r\n return this.http.patch<User>(this.authOptions?.url, user);\r\n }\r\n\r\n private encodePassword(password: string) {\r\n return Base64.encode(password);\r\n }\r\n\r\n // authenticated or anonymous\r\n get logged(): boolean {\r\n return this.authenticated || this.isAnonymous;\r\n }\r\n\r\n get isAnonymous(): boolean {\r\n return this.anonymous;\r\n }\r\n\r\n get authenticated(): boolean {\r\n return this.isAuthenticated();\r\n }\r\n\r\n get isAdmin(): boolean {\r\n const token = this.decodeToken();\r\n if (token?.user?.isAdmin) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private loginCall(body, headers) {\r\n return this.http\r\n .post(`${this.authOptions?.url}/login`, body, { headers })\r\n .pipe(\r\n tap((data: any) => {\r\n this.tokenService.set(data.token);\r\n const tokenDecoded = this.decodeToken();\r\n if (tokenDecoded?.user) {\r\n if (tokenDecoded.user.locale && !this.languageForce) {\r\n this.languageService.setLanguage(tokenDecoded.user.locale);\r\n }\r\n if (tokenDecoded.user.isExpired) {\r\n this.messageService.alert('igo.auth.error.Password expired');\r\n }\r\n }\r\n this.authenticate$.next(true);\r\n }),\r\n catchError((err) => {\r\n err.error.caught = true;\r\n throw err;\r\n })\r\n );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class LoggedGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.logged) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.authenticated) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AdminGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (this.authService.isAdmin) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n Router,\r\n RouterStateSnapshot\r\n} from '@angular/router';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { map } from 'rxjs/operators';\r\n\r\nimport { AuthOptions } from './auth.interface';\r\nimport { AuthService } from './auth.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ProfilsGuard {\r\n constructor(\r\n private authService: AuthService,\r\n private config: ConfigService,\r\n private router: Router\r\n ) {}\r\n\r\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n return this.authService.getProfils().pipe(\r\n map((profils: { profils: string[] }) => {\r\n const authConfig = this.config.getConfig('auth') as AuthOptions;\r\n if (\r\n profils &&\r\n profils.profils &&\r\n profils.profils.some((v) => authConfig.profilsGuard.indexOf(v) !== -1)\r\n ) {\r\n return true;\r\n }\r\n\r\n this.authService.redirectUrl = state.url;\r\n\r\n if (authConfig?.loginRoute) {\r\n this.router.navigateByUrl(authConfig.loginRoute);\r\n }\r\n\r\n return false;\r\n })\r\n );\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport {\r\n HttpEvent,\r\n HttpHandler,\r\n HttpInterceptor,\r\n HttpRequest\r\n} from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\n\r\nimport { Observable } from 'rxjs';\r\nimport { Md5 } from 'ts-md5';\r\n\r\nimport {\r\n AuthByKeyOptions,\r\n AuthOptions,\r\n WithCredentialsOptions\r\n} from './auth.interface';\r\nimport { TokenService } from './token.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthInterceptor implements HttpInterceptor {\r\n private authOptions: AuthOptions;\r\n private refreshInProgress = false;\r\n private trustHosts: string[];\r\n private hostsWithCredentials: WithCredentialsOptions[];\r\n private hostsWithAuthByKey: AuthByKeyOptions[];\r\n\r\n constructor(\r\n private config: ConfigService,\r\n private tokenService: TokenService,\r\n private http: HttpClient\r\n ) {\r\n this.authOptions = this.config.getConfig('auth') as AuthOptions;\r\n\r\n this.trustHosts = this.authOptions?.trustHosts || [];\r\n this.trustHosts.push(window.location.hostname);\r\n\r\n this.hostsWithCredentials = this.authOptions?.hostsWithCredentials || [];\r\n this.hostsWithAuthByKey = this.authOptions?.hostsByKey || [];\r\n }\r\n\r\n intercept(\r\n originalReq: HttpRequest<any>,\r\n next: HttpHandler\r\n ): Observable<HttpEvent<any>> {\r\n const withCredentials = this.handleHostsWithCredentials(originalReq.url);\r\n let req = originalReq.clone();\r\n const hostWithKey = this.handleHostsAuthByKey(originalReq.url);\r\n if (hostWithKey) {\r\n req = req.clone({\r\n params: req.params.set(hostWithKey.key, hostWithKey.value)\r\n });\r\n }\r\n if (withCredentials) {\r\n req = originalReq.clone({\r\n withCredentials\r\n });\r\n return next.handle(req);\r\n }\r\n this.refreshToken();\r\n const token = this.tokenService.get();\r\n const element = document.createElement('a');\r\n element.href = req.url;\r\n if (element.host === '') {\r\n element.href = element.href; // FIX IE11, DO NOT REMOVE\r\n }\r\n\r\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\r\n return next.handle(req);\r\n }\r\n\r\n const authHeader = `Bearer ${token}`;\r\n let authReq = req.clone({\r\n headers: req.headers.set('Authorization', authHeader)\r\n });\r\n\r\n const tokenDecoded = this.tokenService.decode();\r\n if (authReq.params.get('_i') === 'true' && tokenDecoded?.user?.sourceId) {\r\n const hashUser = Md5.hashStr(tokenDecoded.user.sourceId) as string;\r\n authReq = authReq.clone({\r\n params: authReq.params.set('_i', hashUser)\r\n });\r\n } else if (authReq.params.get('_i') === 'true') {\r\n authReq = authReq.clone({\r\n params: authReq.params.delete('_i')\r\n });\r\n }\r\n\r\n return next.handle(authReq);\r\n }\r\n\r\n interceptXhr(xhr, url: string): boolean {\r\n const withCredentials = this.handleHostsWithCredentials(url);\r\n if (withCredentials) {\r\n xhr.withCredentials = withCredentials;\r\n return true;\r\n }\r\n\r\n this.refreshToken();\r\n const element = document.createElement('a');\r\n element.href = url;\r\n\r\n const token = this.tokenService.get();\r\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\r\n return false;\r\n }\r\n xhr.setRequestHeader('Authorization', 'Bearer ' + token);\r\n return true;\r\n }\r\n\r\n alterUrlWithKeyAuth(url: string): string {\r\n const hostWithKey = this.handleHostsAuthByKey(url);\r\n let interceptedUrl = url;\r\n if (hostWithKey) {\r\n const urlDecomposed = interceptedUrl.split(/[?&]/);\r\n let urlWithKeyAdded = urlDecomposed.shift();\r\n const paramsToKeep = urlDecomposed.filter((p) => p.length !== 0);\r\n paramsToKeep.push(`${hostWithKey.key}=${hostWithKey.value}`);\r\n if (paramsToKeep.length) {\r\n urlWithKeyAdded += '?' + paramsToKeep.join('&');\r\n }\r\n return urlWithKeyAdded;\r\n }\r\n return;\r\n }\r\n\r\n private handleHostsWithCredentials(reqUrl: string) {\r\n let withCredentials = false;\r\n for (const hostWithCredentials of this.hostsWithCredentials) {\r\n const domainRegex = new RegExp(hostWithCredentials.domainRegFilters);\r\n if (domainRegex.test(reqUrl)) {\r\n withCredentials =\r\n hostWithCredentials.withCredentials !== undefined\r\n ? hostWithCredentials.withCredentials\r\n : undefined;\r\n break;\r\n }\r\n }\r\n return withCredentials;\r\n }\r\n\r\n private handleHostsAuthByKey(reqUrl: string): { key: string; value: string } {\r\n let hostWithKey;\r\n for (const hostWithAuthByKey of this.hostsWithAuthByKey) {\r\n const domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);\r\n if (domainRegex.test(reqUrl)) {\r\n var replace = `${hostWithAuthByKey.keyProperty}=${hostWithAuthByKey.keyValue}`;\r\n var keyAdded = new RegExp(replace, 'gm');\r\n if (!keyAdded.test(reqUrl)) {\r\n hostWithKey = {\r\n key: hostWithAuthByKey.keyProperty,\r\n value: hostWithAuthByKey.keyValue\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n return hostWithKey;\r\n }\r\n\r\n refreshToken() {\r\n const jwt = this.tokenService.decode();\r\n const currentTime = new Date().getTime() / 1000;\r\n\r\n if (\r\n !this.refreshInProgress &&\r\n jwt &&\r\n currentTime < jwt.exp &&\r\n currentTime > jwt.exp - 1800\r\n ) {\r\n this.refreshInProgress = true;\r\n\r\n const url = this.authOptions?.url;\r\n return this.http.post(`${url}/refresh`, {}).subscribe(\r\n (data: any) => {\r\n this.tokenService.set(data.token);\r\n this.refreshInProgress = false;\r\n },\r\n (err) => {\r\n err.error.caught = true;\r\n return err;\r\n }\r\n );\r\n }\r\n }\r\n}\r\n","/*\n * Public API Surface of auth\n */\nexport * from './lib/shared/auth.service';\nexport * from './lib/shared/logged.guard';\nexport * from './lib/shared/auth.guard';\nexport * from './lib/shared/admin.guard';\nexport * from './lib/shared/profils.guard';\nexport * from './lib/shared/auth.interceptor';\nexport * from './lib/shared/auth.interface';\nexport * from './lib/shared/token.interface';\nexport * from './lib/shared/token.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.TokenService","i3","i6","i1.AuthService","i1"],"mappings":";;;;;;;;;;;;;;;;MAYa,YAAY,CAAA;AAIH,IAAA,QAAA,CAAA;AAHZ,IAAA,OAAO,CAAe;AACtB,IAAA,QAAQ,CAAS;AAEzB,IAAA,WAAA,CAAoB,QAAkB,EAAA;QAAlB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QACpC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AAA,EAAA,KAAA,EAAAC,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACvBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin theme($theme) {
|
|
5
|
+
@include color($theme);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@mixin color($theme) {
|
|
9
|
+
$background: map-get($theme, background);
|
|
10
|
+
|
|
11
|
+
igo-auth-intern {
|
|
12
|
+
.loading-container {
|
|
13
|
+
background-color: change-color(
|
|
14
|
+
$color: mat.get-color-from-palette($background, status-bar),
|
|
15
|
+
$alpha: 0.64
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
|
+
import { AuthService } from '@igo2/auth';
|
|
2
3
|
import { ConfigService } from '@igo2/core/config';
|
|
3
4
|
import { AnyMonitoringOptions } from '@igo2/core/monitoring';
|
|
4
|
-
import { AuthService } from '../shared';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class AuthMonitoringService {
|
|
7
7
|
private configService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igo2/auth",
|
|
3
|
-
"version": "17.0.0-next.
|
|
3
|
+
"version": "17.0.0-next.4",
|
|
4
4
|
"description": "IGO Library",
|
|
5
5
|
"author": "IGO Community",
|
|
6
6
|
"keywords": [
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
},
|
|
61
61
|
"./package.json": {
|
|
62
62
|
"default": "./package.json"
|
|
63
|
+
},
|
|
64
|
+
"./monitoring": {
|
|
65
|
+
"types": "./monitoring/index.d.ts",
|
|
66
|
+
"esm2022": "./esm2022/monitoring/igo2-auth-monitoring.mjs",
|
|
67
|
+
"esm": "./esm2022/monitoring/igo2-auth-monitoring.mjs",
|
|
68
|
+
"default": "./fesm2022/igo2-auth-monitoring.mjs"
|
|
63
69
|
}
|
|
64
70
|
},
|
|
65
71
|
"dependencies": {
|
|
@@ -77,8 +83,8 @@
|
|
|
77
83
|
"@angular/router": "^17.0.6",
|
|
78
84
|
"@azure/msal-angular": "^3.0.4",
|
|
79
85
|
"@azure/msal-browser": "^3.0.4",
|
|
80
|
-
"@igo2/core": "^17.0.0-next.
|
|
81
|
-
"@igo2/utils": "^17.0.0-next.
|
|
86
|
+
"@igo2/core": "^17.0.0-next.4",
|
|
87
|
+
"@igo2/utils": "^17.0.0-next.4",
|
|
82
88
|
"rxjs": "^7.8.0"
|
|
83
89
|
},
|
|
84
90
|
"engines": {
|
package/public_api.d.ts
CHANGED
|
@@ -7,5 +7,3 @@ export * from './lib/shared/auth.interceptor';
|
|
|
7
7
|
export * from './lib/shared/auth.interface';
|
|
8
8
|
export * from './lib/shared/token.interface';
|
|
9
9
|
export * from './lib/shared/token.service';
|
|
10
|
-
export * from './lib/auth-monitoring/auth-monitoring.provider';
|
|
11
|
-
export * from './lib/auth-monitoring/auth-monitoring.service';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { APP_INITIALIZER, Injector } from '@angular/core';
|
|
2
|
-
import { ConfigService } from '@igo2/core/config';
|
|
3
|
-
import { MONITORING_OPTIONS } from '@igo2/core/monitoring';
|
|
4
|
-
import { AuthMonitoringService } from './auth-monitoring.service';
|
|
5
|
-
export function provideAuthUserMonitoring(options) {
|
|
6
|
-
if (!options) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
return [
|
|
10
|
-
{
|
|
11
|
-
provide: AuthMonitoringService,
|
|
12
|
-
useClass: AuthMonitoringService,
|
|
13
|
-
deps: [ConfigService, MONITORING_OPTIONS, Injector]
|
|
14
|
-
},
|
|
15
|
-
// Force instantiate Tracing service to avoid require it in any constructor.
|
|
16
|
-
{
|
|
17
|
-
provide: APP_INITIALIZER,
|
|
18
|
-
useFactory: () => () => { },
|
|
19
|
-
deps: [AuthMonitoringService],
|
|
20
|
-
multi: true
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1tb25pdG9yaW5nLnByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYXV0aC9zcmMvbGliL2F1dGgtbW9uaXRvcmluZy9hdXRoLW1vbml0b3JpbmcucHJvdmlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGVBQWUsRUFBRSxRQUFRLEVBQVksTUFBTSxlQUFlLENBQUM7QUFFcEUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ2xELE9BQU8sRUFFTCxrQkFBa0IsRUFDbkIsTUFBTSx1QkFBdUIsQ0FBQztBQUUvQixPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUVsRSxNQUFNLFVBQVUseUJBQXlCLENBQ3ZDLE9BQW9DO0lBRXBDLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUNiLE9BQ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xuICAgIHtcclxuICAgICAgcHJvdmlkZTogQXV0aE1vbml0b3JpbmdTZXJ2aWNlLFxyXG4gICAgICB1c2VDbGFzczogQXV0aE1vbml0b3JpbmdTZXJ2aWNlLFxyXG4gICAgICBkZXBzOiBbQ29uZmlnU2VydmljZSwgTU9OSVRPUklOR19PUFRJT05TLCBJbmplY3Rvcl1cclxuICAgIH0sXHJcbiAgICAvLyBGb3JjZSBpbnN0YW50aWF0ZSBUcmFjaW5nIHNlcnZpY2UgdG8gYXZvaWQgcmVxdWlyZSBpdCBpbiBhbnkgY29uc3RydWN0b3IuXHJcbiAgICB7XHJcbiAgICAgIHByb3ZpZGU6IEFQUF9JTklUSUFMSVpFUixcclxuICAgICAgdXNlRmFjdG9yeTogKCkgPT4gKCkgPT4ge30sXHJcbiAgICAgIGRlcHM6IFtBdXRoTW9uaXRvcmluZ1NlcnZpY2VdLFxyXG4gICAgICBtdWx0aTogdHJ1ZVxyXG4gICAgfVxyXG4gIF07XHJcbn1cclxuIl19
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Inject, Injectable, Injector, Optional } from '@angular/core';
|
|
2
|
-
import { ConfigService } from '@igo2/core/config';
|
|
3
|
-
import { MONITORING_OPTIONS, identifySentryUser } from '@igo2/core/monitoring';
|
|
4
|
-
import { first, switchMap } from 'rxjs';
|
|
5
|
-
import { AuthService } from '../shared';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@igo2/core/config";
|
|
8
|
-
export class AuthMonitoringService {
|
|
9
|
-
configService;
|
|
10
|
-
monitoringOptions;
|
|
11
|
-
injector;
|
|
12
|
-
// The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
|
|
13
|
-
authService;
|
|
14
|
-
constructor(configService, monitoringOptions, injector) {
|
|
15
|
-
this.configService = configService;
|
|
16
|
-
this.monitoringOptions = monitoringOptions;
|
|
17
|
-
this.injector = injector;
|
|
18
|
-
if (!this.monitoringOptions?.identifyUser) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
this.configService.isLoaded$
|
|
22
|
-
.pipe(first((isLoaded) => isLoaded), switchMap(() => {
|
|
23
|
-
this.authService = this.injector.get(AuthService);
|
|
24
|
-
return this.authService?.authenticate$;
|
|
25
|
-
}))
|
|
26
|
-
.subscribe((isAuthenticated) => {
|
|
27
|
-
const user = isAuthenticated ? this.authService.user : null;
|
|
28
|
-
this._identifyUser(user);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
_identifyUser(user) {
|
|
32
|
-
switch (this.monitoringOptions.provider) {
|
|
33
|
-
case 'sentry':
|
|
34
|
-
identifySentryUser(user);
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i1.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
42
|
-
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
44
|
-
type: Injectable,
|
|
45
|
-
args: [{
|
|
46
|
-
providedIn: 'root'
|
|
47
|
-
}]
|
|
48
|
-
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: undefined, decorators: [{
|
|
49
|
-
type: Optional
|
|
50
|
-
}, {
|
|
51
|
-
type: Inject,
|
|
52
|
-
args: [MONITORING_OPTIONS]
|
|
53
|
-
}] }, { type: i0.Injector }] });
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC1tb25pdG9yaW5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uICAgICAgLnBpcGUoXHJcbiAgICAgICAgZmlyc3QoKGlzTG9hZGVkKSA9PiBpc0xvYWRlZCksXHJcbiAgICAgICAgc3dpdGNoTWFwKCgpID0+IHtcclxuICAgICAgICAgIHRoaXMuYXV0aFNlcnZpY2UgPSB0aGlzLmluamVjdG9yLmdldChBdXRoU2VydmljZSk7XHJcbiAgICAgICAgICByZXR1cm4gdGhpcy5hdXRoU2VydmljZT8uYXV0aGVudGljYXRlJDtcclxuICAgICAgICB9KVxyXG4gICAgICApXHJcbiAgICAgIC5zdWJzY3JpYmUoKGlzQXV0aGVudGljYXRlZCkgPT4ge1xyXG4gICAgICAgIGNvbnN0IHVzZXIgPSBpc0F1dGhlbnRpY2F0ZWQgPyB0aGlzLmF1dGhTZXJ2aWNlLnVzZXIgOiBudWxsO1xyXG4gICAgICAgIHRoaXMuX2lkZW50aWZ5VXNlcih1c2VyKTtcclxuICAgICAgfSk7XHJcbiAgfVxyXG5cclxuICBwcml2YXRlIF9pZGVudGlmeVVzZXIodXNlcjogVXNlciB8IG51bGwpOiB2b2lkIHtcclxuICAgIHN3aXRjaCAodGhpcy5tb25pdG9yaW5nT3B0aW9ucy5wcm92aWRlcikge1xyXG4gICAgICBjYXNlICdzZW50cnknOlxyXG4gICAgICAgIGlkZW50aWZ5U2VudHJ5VXNlcih1c2VyKTtcclxuICAgICAgICBicmVhaztcclxuXHJcbiAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgYnJlYWs7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './token.service';
|
|
2
|
-
export * from './token.interface';
|
|
3
|
-
export * from './auth.service';
|
|
4
|
-
export * from './auth.interface';
|
|
5
|
-
export * from './auth.interceptor';
|
|
6
|
-
export * from './logged.guard';
|
|
7
|
-
export * from './auth.guard';
|
|
8
|
-
export * from './admin.guard';
|
|
9
|
-
export * from './profils.guard';
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hdXRoL3NyYy9saWIvc2hhcmVkL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsaUJBQWlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3Rva2VuLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi90b2tlbi5pbnRlcmZhY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9hdXRoLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9hdXRoLmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2F1dGguaW50ZXJjZXB0b3InO1xuZXhwb3J0ICogZnJvbSAnLi9sb2dnZWQuZ3VhcmQnO1xuZXhwb3J0ICogZnJvbSAnLi9hdXRoLmd1YXJkJztcbmV4cG9ydCAqIGZyb20gJy4vYWRtaW4uZ3VhcmQnO1xuZXhwb3J0ICogZnJvbSAnLi9wcm9maWxzLmd1YXJkJztcbiJdfQ==
|
package/lib/shared/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './token.service';
|
|
2
|
-
export * from './token.interface';
|
|
3
|
-
export * from './auth.service';
|
|
4
|
-
export * from './auth.interface';
|
|
5
|
-
export * from './auth.interceptor';
|
|
6
|
-
export * from './logged.guard';
|
|
7
|
-
export * from './auth.guard';
|
|
8
|
-
export * from './admin.guard';
|
|
9
|
-
export * from './profils.guard';
|
|
File without changes
|