@valtimo/security 12.6.1 → 12.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,18 @@
1
+ import { Injectable } from '@angular/core';
1
2
  import { throwError } from 'rxjs';
2
3
  import { catchError } from 'rxjs/operators';
3
- import { Injectable } from '@angular/core';
4
4
  import { InterceptorSkip } from './error';
5
5
  import * as i0 from "@angular/core";
6
6
  import * as i1 from "ngx-toastr";
7
- import * as i2 from "ngx-logger";
8
7
  export class HttpErrorInterceptor {
9
- constructor(toastr, logger) {
8
+ constructor(toastr) {
10
9
  this.toastr = toastr;
11
- this.logger = logger;
12
10
  }
13
11
  intercept(request, next) {
14
12
  let skipStatusCodes = [];
15
13
  let response$;
16
14
  if (request.headers && request.headers.has(InterceptorSkip)) {
17
- skipStatusCodes = request.headers.get(InterceptorSkip).split(',');
15
+ skipStatusCodes = request.headers.get(InterceptorSkip)?.split(',') ?? [];
18
16
  const headers = request.headers.delete(InterceptorSkip);
19
17
  response$ = next.handle(request.clone({ headers }));
20
18
  }
@@ -23,7 +21,7 @@ export class HttpErrorInterceptor {
23
21
  }
24
22
  return response$.pipe(catchError((error) => {
25
23
  if (skipStatusCodes.find(skipStatusCode => skipStatusCode === 'all' || skipStatusCode === error.status.toString())) {
26
- return response$;
24
+ return throwError(() => error);
27
25
  }
28
26
  let errorMessage = '';
29
27
  if (error?.error instanceof ErrorEvent) {
@@ -52,10 +50,10 @@ export class HttpErrorInterceptor {
52
50
  enableHtml: true,
53
51
  tapToDismiss: false,
54
52
  });
55
- return throwError(errorMessage);
53
+ return throwError(() => error);
56
54
  }));
57
55
  }
58
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1.ToastrService }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable }); }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable }); }
59
57
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, providedIn: 'root' }); }
60
58
  }
61
59
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, decorators: [{
@@ -63,5 +61,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
63
61
  args: [{
64
62
  providedIn: 'root',
65
63
  }]
66
- }], ctorParameters: () => [{ type: i1.ToastrService }, { type: i2.NGXLogger }] });
67
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cC1lcnJvci5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3ZhbHRpbW8vc2VjdXJpdHkvc3JjL2xpYi9lcnJvci9odHRwLWVycm9yLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQSxPQUFPLEVBQWEsVUFBVSxFQUFDLE1BQU0sTUFBTSxDQUFDO0FBQzVDLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUMxQyxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXpDLE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxTQUFTLENBQUM7Ozs7QUFNeEMsTUFBTSxPQUFPLG9CQUFvQjtJQUMvQixZQUNVLE1BQXFCLEVBQ3JCLE1BQWlCO1FBRGpCLFdBQU0sR0FBTixNQUFNLENBQWU7UUFDckIsV0FBTSxHQUFOLE1BQU0sQ0F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hcm5pbmcoYCR7ZXJyb3JNZXNzYWdlfWAsIGBBbiB1bmV4cGVjdGVkIGVycm9yIG9jY3VycmVkYCwge1xuICAgICAgICAgIGVuYWJsZUh0bWw6IHRydWUsXG4gICAgICAgICAgdGFwVG9EaXNtaXNzOiBmYWxzZSxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0aHJvd0Vycm9yKGVycm9yTWVzc2FnZSk7XG4gICAgICB9KVxuICAgICk7XG4gIH1cbn1cbiJdfQ==
64
+ }], ctorParameters: () => [{ type: i1.ToastrService }] });
65
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cC1lcnJvci5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3ZhbHRpbW8vc2VjdXJpdHkvc3JjL2xpYi9lcnJvci9odHRwLWVycm9yLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCQSxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXpDLE9BQU8sRUFBYSxVQUFVLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFDNUMsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBQzFDLE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxTQUFTLENBQUM7OztBQUt4QyxNQUFNLE9BQU8sb0JBQW9CO0lBQy9CLFlBQTZCLE1BQXFCO1FBQXJCLFdBQU0sR0FBTixNQUFNLENBQWU7SUFBRyxDQUFDO0lBRXRELFNBQVMsQ0FBQyxPQUF5QixFQUFFLElBQWlCO1FBQ3BELElBQUksZUFBZSxHQUFhLEVBQUUsQ0FBQztRQUNuQyxJQUFJLFNBQXFDLENBQUM7UUFDMUMsSUFBSSxPQUFPLENBQUMsT0FBTyxJQUFJLE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ICAgfSk7XG4gICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcbiAgICAgIH0pXG4gICAgKTtcbiAgfVxufVxuIl19
@@ -103,15 +103,14 @@ const InterceptorSkip = 'X-Skip-Interceptor';
103
103
  const InterceptorSkipHeader = new HttpHeaders().set(InterceptorSkip, 'all');
104
104
 
105
105
  class HttpErrorInterceptor {
106
- constructor(toastr, logger) {
106
+ constructor(toastr) {
107
107
  this.toastr = toastr;
108
- this.logger = logger;
109
108
  }
110
109
  intercept(request, next) {
111
110
  let skipStatusCodes = [];
112
111
  let response$;
113
112
  if (request.headers && request.headers.has(InterceptorSkip)) {
114
- skipStatusCodes = request.headers.get(InterceptorSkip).split(',');
113
+ skipStatusCodes = request.headers.get(InterceptorSkip)?.split(',') ?? [];
115
114
  const headers = request.headers.delete(InterceptorSkip);
116
115
  response$ = next.handle(request.clone({ headers }));
117
116
  }
@@ -120,7 +119,7 @@ class HttpErrorInterceptor {
120
119
  }
121
120
  return response$.pipe(catchError((error) => {
122
121
  if (skipStatusCodes.find(skipStatusCode => skipStatusCode === 'all' || skipStatusCode === error.status.toString())) {
123
- return response$;
122
+ return throwError(() => error);
124
123
  }
125
124
  let errorMessage = '';
126
125
  if (error?.error instanceof ErrorEvent) {
@@ -149,10 +148,10 @@ class HttpErrorInterceptor {
149
148
  enableHtml: true,
150
149
  tapToDismiss: false,
151
150
  });
152
- return throwError(errorMessage);
151
+ return throwError(() => error);
153
152
  }));
154
153
  }
155
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1$2.ToastrService }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable }); }
154
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1$2.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable }); }
156
155
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, providedIn: 'root' }); }
157
156
  }
158
157
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HttpErrorInterceptor, decorators: [{
@@ -160,7 +159,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
160
159
  args: [{
161
160
  providedIn: 'root',
162
161
  }]
163
- }], ctorParameters: () => [{ type: i1$2.ToastrService }, { type: i2.NGXLogger }] });
162
+ }], ctorParameters: () => [{ type: i1$2.ToastrService }] });
164
163
 
165
164
  /*
166
165
  * Copyright 2015-2024 Ritense BV, the Netherlands.
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-security.mjs","sources":["../../../../projects/valtimo/security/src/lib/guard/auth-guard.service.ts","../../../../projects/valtimo/security/src/lib/error/error.component.ts","../../../../projects/valtimo/security/src/lib/error/error.component.html","../../../../projects/valtimo/security/src/lib/error/error.ts","../../../../projects/valtimo/security/src/lib/error/http-error.interceptor.ts","../../../../projects/valtimo/security/src/lib/error/error-routing.module.ts","../../../../projects/valtimo/security/src/lib/interceptors/zone-offset.interceptor.ts","../../../../projects/valtimo/security/src/lib/interceptors/index.ts","../../../../projects/valtimo/security/src/lib/security.module.ts","../../../../projects/valtimo/security/src/lib/user-provider.service.ts","../../../../projects/valtimo/security/src/lib/constants/csp.constant.ts","../../../../projects/valtimo/security/src/lib/constants/index.ts","../../../../projects/valtimo/security/src/lib/initializers/initialize-csp.ts","../../../../projects/valtimo/security/src/lib/initializers/index.ts","../../../../projects/valtimo/security/src/public_api.ts","../../../../projects/valtimo/security/src/valtimo-security.ts"],"sourcesContent":["/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, Injector} from '@angular/core';\nimport {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {Observable} from 'rxjs';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthGuardService implements CanActivate {\n private readonly authGuardServiceProvider: CanActivate;\n\n constructor(\n configService: ConfigService,\n private injector: Injector,\n protected logger: NGXLogger\n ) {\n this.authGuardServiceProvider = injector.get<any>(\n configService.config.authentication.authProviders.guardServiceProvider\n );\n this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);\n }\n\n canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n this.logger.debug('Delegating AuthGuard canActivate');\n return this.authGuardServiceProvider.canActivate(route, state);\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\nimport {Error} from './error';\n\n@Component({\n selector: 'valtimo-error',\n templateUrl: './error.component.html',\n styleUrls: ['./error.component.css'],\n})\nexport class ErrorComponent implements OnInit {\n public err: Error;\n\n constructor(private activatedRoute: ActivatedRoute) {}\n\n ngOnInit() {\n if (this.activatedRoute.snapshot.data) {\n this.err = {\n title: this.activatedRoute.snapshot.data.title,\n error: this.activatedRoute.snapshot.data.error,\n };\n }\n }\n}\n","<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h1>{{ err.error }}</h1>\n <p>{{ err.title }}</p>\n </div>\n </div>\n </div>\n</div>\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {HttpHeaders} from '@angular/common/http';\n\nexport const InterceptorSkip = 'X-Skip-Interceptor';\nexport const InterceptorSkipHeader = new HttpHeaders().set(InterceptorSkip, 'all');\n\nexport interface Error {\n title: string;\n error: number;\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n} from '@angular/common/http';\nimport {Observable, throwError} from 'rxjs';\nimport {catchError} from 'rxjs/operators';\nimport {Injectable} from '@angular/core';\nimport {ToastrService} from 'ngx-toastr';\nimport {InterceptorSkip} from './error';\nimport {NGXLogger} from 'ngx-logger';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HttpErrorInterceptor implements HttpInterceptor {\n constructor(\n private toastr: ToastrService,\n private logger: NGXLogger\n ) {}\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n let skipStatusCodes: string[] = [];\n let response$: Observable<HttpEvent<any>>;\n if (request.headers && request.headers.has(InterceptorSkip)) {\n skipStatusCodes = request.headers.get(InterceptorSkip).split(',');\n const headers = request.headers.delete(InterceptorSkip);\n response$ = next.handle(request.clone({headers}));\n } else {\n response$ = next.handle(request);\n }\n\n return response$.pipe(\n catchError((error: HttpErrorResponse) => {\n if (\n skipStatusCodes.find(\n skipStatusCode => skipStatusCode === 'all' || skipStatusCode === error.status.toString()\n )\n ) {\n return response$;\n }\n let errorMessage = '';\n if (error?.error instanceof ErrorEvent) {\n // client-side error\n errorMessage = `Error: ${error.error.message}`;\n } else {\n // server-side error\n if (error?.error?.errors) {\n errorMessage = error?.error?.errors;\n } else if (error?.error?.title && error?.error?.detail) {\n errorMessage = `${error?.error?.title}. Details: </br>${error?.error?.detail}`;\n } else if (error?.error?.title && error?.error?.referenceId) {\n errorMessage = `${error?.error?.title}. Reference ID: ${error?.error?.referenceId}`;\n } else if (error?.error?.message) {\n errorMessage = error?.error?.message;\n } else {\n errorMessage = `Error Code: ${error?.status} </br>Message: ${error?.message}`;\n }\n }\n this.toastr.warning(`${errorMessage}`, `An unexpected error occurred`, {\n enableHtml: true,\n tapToDismiss: false,\n });\n return throwError(errorMessage);\n })\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {ErrorComponent} from './error.component';\nimport {HttpErrorInterceptor} from './http-error.interceptor';\nimport {HTTP_INTERCEPTORS} from '@angular/common/http';\n\nconst routes: Routes = [\n {path: '403', component: ErrorComponent, data: {title: 'Access Forbidden', error: 403}},\n {path: '404', component: ErrorComponent, data: {title: 'Not Found', error: 404}},\n {path: '500', component: ErrorComponent, data: {title: 'Internal Server Error', error: 500}},\n {path: '503', component: ErrorComponent, data: {title: 'Service Unavailable', error: 503}},\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n providers: [{provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true}],\n})\nexport class ErrorRoutingModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport moment from 'moment';\n\n@Injectable()\nexport class ZoneOffsetInterceptor implements HttpInterceptor {\n public intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n const modifiedReq = req.clone({\n headers: req.headers.set('X-Timezone-Offset', this.getFormattedZoneOffset()),\n });\n return next.handle(modifiedReq);\n }\n\n private getFormattedZoneOffset(): string {\n let offset = new Date().getTimezoneOffset();\n let isNegative = false;\n\n if (offset < 0) {\n isNegative = true;\n offset = offset * -1;\n }\n\n const duration = moment.duration(offset, 'minutes');\n const momentOffset = moment.utc(duration.asMilliseconds()).format('HH:mm');\n\n return `${isNegative ? '+' : '-'}${momentOffset}`;\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './zone-offset.interceptor';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {ErrorComponent} from './error/error.component';\nimport {ErrorRoutingModule} from './error/error-routing.module';\nimport {AuthGuardService} from './guard/auth-guard.service';\nimport {HTTP_INTERCEPTORS} from '@angular/common/http';\nimport {ZoneOffsetInterceptor} from './interceptors';\n\n@NgModule({\n declarations: [ErrorComponent],\n imports: [ErrorRoutingModule],\n exports: [ErrorComponent],\n providers: [\n AuthGuardService,\n {provide: HTTP_INTERCEPTORS, useClass: ZoneOffsetInterceptor, multi: true},\n ],\n})\nexport class SecurityModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, Injector} from '@angular/core';\nimport {Observable, ReplaySubject} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {\n ConfigService,\n EmailNotificationService,\n EmailNotificationSettings,\n UserIdentity,\n UserService,\n} from '@valtimo/config';\nimport {HttpClient} from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserProviderService implements UserService, EmailNotificationService {\n private readonly userService: UserService;\n private valtimoApiConfig: {\n endpointUri: string;\n };\n\n constructor(\n private configService: ConfigService,\n private injector: Injector,\n private http: HttpClient,\n private logger: NGXLogger\n ) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n this.userService = injector.get<any>(\n configService.config.authentication.authProviders.userServiceProvider\n );\n this.logger.debug('Loading UserProviderService service', this.userService);\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('Delegating UserProviderService::getUserIdentity');\n return this.userService.getUserSubject();\n }\n\n logout(): void {\n this.logger.debug('Delegating UserProviderService::logout');\n return this.userService.logout();\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('Delegating UserProviderService::getToken');\n return this.userService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('Delegating UserProviderService::updateToken');\n if (this.userService.updateToken) {\n return this.userService.updateToken(minValidity);\n }\n\n return new Promise(resolve => resolve(true));\n }\n\n public getEmailNotificationSettings(): Observable<EmailNotificationSettings> {\n this.logger.debug('getEmailNotificationSettings');\n return this.http.get<EmailNotificationSettings>(\n `${this.valtimoApiConfig.endpointUri}v1/email-notification-settings`\n );\n }\n\n public updateEmailNotificationSettings(\n settings: EmailNotificationSettings\n ): Observable<EmailNotificationSettings> {\n this.logger.debug('updateEmailNotificationSettings', settings);\n return this.http.put<EmailNotificationSettings>(\n `${this.valtimoApiConfig.endpointUri}v1/email-notification-settings`,\n settings\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CSP_HTTP_EQUIV = 'Content-Security-Policy';\n\nconst CSP_META_ID = 'CSP_META';\n\nexport {CSP_HTTP_EQUIV, CSP_META_ID};\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './csp.constant';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NGXLogger} from 'ngx-logger';\nimport {ConfigService} from '@valtimo/config';\nimport {CSP_HTTP_EQUIV, CSP_META_ID} from '../constants';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {CSPHeaderParams, getCSP} from 'csp-header';\nimport {SecurityContext} from '@angular/core';\n\nconst getSanitizedCspString = (\n cspHeaderParams: CSPHeaderParams,\n domSanitizer: DomSanitizer\n): string => {\n const csp = getCSP(cspHeaderParams);\n return domSanitizer.sanitize(SecurityContext.HTML, csp);\n};\n\nconst getCspHeaderElement = (\n cspHeaderParams: CSPHeaderParams,\n domSanitizer: DomSanitizer,\n document: Document\n): HTMLMetaElement => {\n const csp = getSanitizedCspString(cspHeaderParams, domSanitizer);\n const cspMeta = document.createElement('meta');\n\n cspMeta.httpEquiv = CSP_HTTP_EQUIV;\n cspMeta.content = csp;\n cspMeta.id = CSP_META_ID;\n\n return cspMeta;\n};\n\nconst appendElementToHead = (element: HTMLMetaElement, document: Document): void => {\n document.head.appendChild(element);\n};\n\nconst isElementLoaded = async (elementId: string, document: Document): Promise<boolean> => {\n while (document.getElementById(elementId) === null) {\n await new Promise(resolve => requestAnimationFrame(resolve));\n }\n return !!document.getElementById(elementId);\n};\n\nexport const initializeCsp =\n (\n logger: NGXLogger,\n configService: ConfigService,\n document: Document,\n domSanitizer: DomSanitizer\n ): (() => Promise<boolean>) =>\n async (): Promise<boolean> => {\n const cspHeaderParams = configService?.config?.csp;\n\n if (cspHeaderParams) {\n logger.log('Create CSP header element from:', cspHeaderParams);\n\n const cspHeaderElement = getCspHeaderElement(cspHeaderParams, domSanitizer, document);\n\n appendElementToHead(cspHeaderElement, document);\n\n return await isElementLoaded(CSP_META_ID, document);\n }\n\n logger.log('No CSP config present.');\n\n return true;\n };\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './initialize-csp';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of security\n */\nexport * from './lib/guard/auth-guard.service';\nexport * from './lib/security.module';\nexport * from './lib/error/error';\nexport * from './lib/error/error.component';\nexport * from './lib/user-provider.service';\nexport * from './lib/constants';\nexport * from './lib/initializers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;MAWU,gBAAgB,CAAA;AAG3B,IAAA,WAAA,CACE,aAA4B,EACpB,QAAkB,EAChB,MAAiB,EAAA;QADnB,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACN,IAAM,CAAA,MAAA,GAAN,MAAM;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version":3,"file":"valtimo-security.mjs","sources":["../../../../projects/valtimo/security/src/lib/guard/auth-guard.service.ts","../../../../projects/valtimo/security/src/lib/error/error.component.ts","../../../../projects/valtimo/security/src/lib/error/error.component.html","../../../../projects/valtimo/security/src/lib/error/error.ts","../../../../projects/valtimo/security/src/lib/error/http-error.interceptor.ts","../../../../projects/valtimo/security/src/lib/error/error-routing.module.ts","../../../../projects/valtimo/security/src/lib/interceptors/zone-offset.interceptor.ts","../../../../projects/valtimo/security/src/lib/interceptors/index.ts","../../../../projects/valtimo/security/src/lib/security.module.ts","../../../../projects/valtimo/security/src/lib/user-provider.service.ts","../../../../projects/valtimo/security/src/lib/constants/csp.constant.ts","../../../../projects/valtimo/security/src/lib/constants/index.ts","../../../../projects/valtimo/security/src/lib/initializers/initialize-csp.ts","../../../../projects/valtimo/security/src/lib/initializers/index.ts","../../../../projects/valtimo/security/src/public_api.ts","../../../../projects/valtimo/security/src/valtimo-security.ts"],"sourcesContent":["/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, Injector} from '@angular/core';\nimport {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {Observable} from 'rxjs';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthGuardService implements CanActivate {\n private readonly authGuardServiceProvider: CanActivate;\n\n constructor(\n configService: ConfigService,\n private injector: Injector,\n protected logger: NGXLogger\n ) {\n this.authGuardServiceProvider = injector.get<any>(\n configService.config.authentication.authProviders.guardServiceProvider\n );\n this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);\n }\n\n canActivate(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n this.logger.debug('Delegating AuthGuard canActivate');\n return this.authGuardServiceProvider.canActivate(route, state);\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\nimport {Error} from './error';\n\n@Component({\n selector: 'valtimo-error',\n templateUrl: './error.component.html',\n styleUrls: ['./error.component.css'],\n})\nexport class ErrorComponent implements OnInit {\n public err: Error;\n\n constructor(private activatedRoute: ActivatedRoute) {}\n\n ngOnInit() {\n if (this.activatedRoute.snapshot.data) {\n this.err = {\n title: this.activatedRoute.snapshot.data.title,\n error: this.activatedRoute.snapshot.data.error,\n };\n }\n }\n}\n","<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h1>{{ err.error }}</h1>\n <p>{{ err.title }}</p>\n </div>\n </div>\n </div>\n</div>\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {HttpHeaders} from '@angular/common/http';\n\nexport const InterceptorSkip = 'X-Skip-Interceptor';\nexport const InterceptorSkipHeader = new HttpHeaders().set(InterceptorSkip, 'all');\n\nexport interface Error {\n title: string;\n error: number;\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {ToastrService} from 'ngx-toastr';\nimport {Observable, throwError} from 'rxjs';\nimport {catchError} from 'rxjs/operators';\nimport {InterceptorSkip} from './error';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class HttpErrorInterceptor implements HttpInterceptor {\n constructor(private readonly toastr: ToastrService) {}\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n let skipStatusCodes: string[] = [];\n let response$: Observable<HttpEvent<any>>;\n if (request.headers && request.headers.has(InterceptorSkip)) {\n skipStatusCodes = request.headers.get(InterceptorSkip)?.split(',') ?? [];\n const headers = request.headers.delete(InterceptorSkip);\n response$ = next.handle(request.clone({headers}));\n } else {\n response$ = next.handle(request);\n }\n\n return response$.pipe(\n catchError((error: HttpErrorResponse) => {\n if (\n skipStatusCodes.find(\n skipStatusCode => skipStatusCode === 'all' || skipStatusCode === error.status.toString()\n )\n ) {\n return throwError(() => error);\n }\n let errorMessage = '';\n if (error?.error instanceof ErrorEvent) {\n // client-side error\n errorMessage = `Error: ${error.error.message}`;\n } else {\n // server-side error\n if (error?.error?.errors) {\n errorMessage = error?.error?.errors;\n } else if (error?.error?.title && error?.error?.detail) {\n errorMessage = `${error?.error?.title}. Details: </br>${error?.error?.detail}`;\n } else if (error?.error?.title && error?.error?.referenceId) {\n errorMessage = `${error?.error?.title}. Reference ID: ${error?.error?.referenceId}`;\n } else if (error?.error?.message) {\n errorMessage = error?.error?.message;\n } else {\n errorMessage = `Error Code: ${error?.status} </br>Message: ${error?.message}`;\n }\n }\n this.toastr.warning(`${errorMessage}`, `An unexpected error occurred`, {\n enableHtml: true,\n tapToDismiss: false,\n });\n return throwError(() => error);\n })\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {ErrorComponent} from './error.component';\nimport {HttpErrorInterceptor} from './http-error.interceptor';\nimport {HTTP_INTERCEPTORS} from '@angular/common/http';\n\nconst routes: Routes = [\n {path: '403', component: ErrorComponent, data: {title: 'Access Forbidden', error: 403}},\n {path: '404', component: ErrorComponent, data: {title: 'Not Found', error: 404}},\n {path: '500', component: ErrorComponent, data: {title: 'Internal Server Error', error: 500}},\n {path: '503', component: ErrorComponent, data: {title: 'Service Unavailable', error: 503}},\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n providers: [{provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true}],\n})\nexport class ErrorRoutingModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport moment from 'moment';\n\n@Injectable()\nexport class ZoneOffsetInterceptor implements HttpInterceptor {\n public intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n const modifiedReq = req.clone({\n headers: req.headers.set('X-Timezone-Offset', this.getFormattedZoneOffset()),\n });\n return next.handle(modifiedReq);\n }\n\n private getFormattedZoneOffset(): string {\n let offset = new Date().getTimezoneOffset();\n let isNegative = false;\n\n if (offset < 0) {\n isNegative = true;\n offset = offset * -1;\n }\n\n const duration = moment.duration(offset, 'minutes');\n const momentOffset = moment.utc(duration.asMilliseconds()).format('HH:mm');\n\n return `${isNegative ? '+' : '-'}${momentOffset}`;\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './zone-offset.interceptor';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {ErrorComponent} from './error/error.component';\nimport {ErrorRoutingModule} from './error/error-routing.module';\nimport {AuthGuardService} from './guard/auth-guard.service';\nimport {HTTP_INTERCEPTORS} from '@angular/common/http';\nimport {ZoneOffsetInterceptor} from './interceptors';\n\n@NgModule({\n declarations: [ErrorComponent],\n imports: [ErrorRoutingModule],\n exports: [ErrorComponent],\n providers: [\n AuthGuardService,\n {provide: HTTP_INTERCEPTORS, useClass: ZoneOffsetInterceptor, multi: true},\n ],\n})\nexport class SecurityModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, Injector} from '@angular/core';\nimport {Observable, ReplaySubject} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {\n ConfigService,\n EmailNotificationService,\n EmailNotificationSettings,\n UserIdentity,\n UserService,\n} from '@valtimo/config';\nimport {HttpClient} from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserProviderService implements UserService, EmailNotificationService {\n private readonly userService: UserService;\n private valtimoApiConfig: {\n endpointUri: string;\n };\n\n constructor(\n private configService: ConfigService,\n private injector: Injector,\n private http: HttpClient,\n private logger: NGXLogger\n ) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n this.userService = injector.get<any>(\n configService.config.authentication.authProviders.userServiceProvider\n );\n this.logger.debug('Loading UserProviderService service', this.userService);\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('Delegating UserProviderService::getUserIdentity');\n return this.userService.getUserSubject();\n }\n\n logout(): void {\n this.logger.debug('Delegating UserProviderService::logout');\n return this.userService.logout();\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('Delegating UserProviderService::getToken');\n return this.userService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('Delegating UserProviderService::updateToken');\n if (this.userService.updateToken) {\n return this.userService.updateToken(minValidity);\n }\n\n return new Promise(resolve => resolve(true));\n }\n\n public getEmailNotificationSettings(): Observable<EmailNotificationSettings> {\n this.logger.debug('getEmailNotificationSettings');\n return this.http.get<EmailNotificationSettings>(\n `${this.valtimoApiConfig.endpointUri}v1/email-notification-settings`\n );\n }\n\n public updateEmailNotificationSettings(\n settings: EmailNotificationSettings\n ): Observable<EmailNotificationSettings> {\n this.logger.debug('updateEmailNotificationSettings', settings);\n return this.http.put<EmailNotificationSettings>(\n `${this.valtimoApiConfig.endpointUri}v1/email-notification-settings`,\n settings\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CSP_HTTP_EQUIV = 'Content-Security-Policy';\n\nconst CSP_META_ID = 'CSP_META';\n\nexport {CSP_HTTP_EQUIV, CSP_META_ID};\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './csp.constant';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NGXLogger} from 'ngx-logger';\nimport {ConfigService} from '@valtimo/config';\nimport {CSP_HTTP_EQUIV, CSP_META_ID} from '../constants';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {CSPHeaderParams, getCSP} from 'csp-header';\nimport {SecurityContext} from '@angular/core';\n\nconst getSanitizedCspString = (\n cspHeaderParams: CSPHeaderParams,\n domSanitizer: DomSanitizer\n): string => {\n const csp = getCSP(cspHeaderParams);\n return domSanitizer.sanitize(SecurityContext.HTML, csp);\n};\n\nconst getCspHeaderElement = (\n cspHeaderParams: CSPHeaderParams,\n domSanitizer: DomSanitizer,\n document: Document\n): HTMLMetaElement => {\n const csp = getSanitizedCspString(cspHeaderParams, domSanitizer);\n const cspMeta = document.createElement('meta');\n\n cspMeta.httpEquiv = CSP_HTTP_EQUIV;\n cspMeta.content = csp;\n cspMeta.id = CSP_META_ID;\n\n return cspMeta;\n};\n\nconst appendElementToHead = (element: HTMLMetaElement, document: Document): void => {\n document.head.appendChild(element);\n};\n\nconst isElementLoaded = async (elementId: string, document: Document): Promise<boolean> => {\n while (document.getElementById(elementId) === null) {\n await new Promise(resolve => requestAnimationFrame(resolve));\n }\n return !!document.getElementById(elementId);\n};\n\nexport const initializeCsp =\n (\n logger: NGXLogger,\n configService: ConfigService,\n document: Document,\n domSanitizer: DomSanitizer\n ): (() => Promise<boolean>) =>\n async (): Promise<boolean> => {\n const cspHeaderParams = configService?.config?.csp;\n\n if (cspHeaderParams) {\n logger.log('Create CSP header element from:', cspHeaderParams);\n\n const cspHeaderElement = getCspHeaderElement(cspHeaderParams, domSanitizer, document);\n\n appendElementToHead(cspHeaderElement, document);\n\n return await isElementLoaded(CSP_META_ID, document);\n }\n\n logger.log('No CSP config present.');\n\n return true;\n };\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './initialize-csp';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of security\n */\nexport * from './lib/guard/auth-guard.service';\nexport * from './lib/security.module';\nexport * from './lib/error/error';\nexport * from './lib/error/error.component';\nexport * from './lib/user-provider.service';\nexport * from './lib/constants';\nexport * from './lib/initializers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;MAWU,gBAAgB,CAAA;AAG3B,IAAA,WAAA,CACE,aAA4B,EACpB,QAAkB,EAChB,MAAiB,EAAA;QADnB,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACN,IAAM,CAAA,MAAA,GAAN,MAAM;AAEhB,QAAA,IAAI,CAAC,wBAAwB,GAAG,QAAQ,CAAC,GAAG,CAC1C,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,oBAAoB,CACvE;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,wBAAwB,CAAC;;IAG9F,WAAW,CACT,KAA6B,EAC7B,KAA0B,EAAA;AAE1B,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC;QACrD,OAAO,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC;;+GAnBrD,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,EAAA,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AAc,CAAC,SAAS,CAAC;AAC7C,CAAC;AAEY,MAAA,aAAa,GACxB,CACE,MAAiB,EACjB,aAA4B,EAC5B,QAAkB,EAClB,YAA0B,KAE5B,YAA6B;AAC3B,IAAA,MAAM,eAAe,GAAG,aAAa,EAAE,MAAM,EAAE,GAAG;IAElD,IAAI,eAAe,EAAE;AACnB,QAAA,MAAM,CAAC,GAAG,CAAC,iCAAiC,EAAE,eAAe,CAAC;QAE9D,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,CAAC;AAErF,QAAA,mBAAmB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAE/C,QAAA,OAAO,MAAM,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;;AAGrD,IAAA,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC;AAEpC,IAAA,OAAO,IAAI;AACb;;AChFF;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
@@ -1,12 +1,10 @@
1
1
  import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
2
  import { ToastrService } from 'ngx-toastr';
4
- import { NGXLogger } from 'ngx-logger';
3
+ import { Observable } from 'rxjs';
5
4
  import * as i0 from "@angular/core";
6
5
  export declare class HttpErrorInterceptor implements HttpInterceptor {
7
- private toastr;
8
- private logger;
9
- constructor(toastr: ToastrService, logger: NGXLogger);
6
+ private readonly toastr;
7
+ constructor(toastr: ToastrService);
10
8
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
11
9
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpErrorInterceptor, never>;
12
10
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpErrorInterceptor>;
@@ -1 +1 @@
1
- {"version":3,"file":"http-error.interceptor.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/security/src/lib/error/http-error.interceptor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAa,MAAM,MAAM,CAAC;AAG5C,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;;AAErC,qBAGa,oBAAqB,YAAW,eAAe;IAExD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;gBADN,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,SAAS;IAG3B,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;yCANxE,oBAAoB;6CAApB,oBAAoB;CAoDhC"}
1
+ {"version":3,"file":"http-error.interceptor.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/security/src/lib/error/http-error.interceptor.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AACzC,OAAO,EAAC,UAAU,EAAa,MAAM,MAAM,CAAC;;AAI5C,qBAGa,oBAAqB,YAAW,eAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;yCAHxE,oBAAoB;6CAApB,oBAAoB;CAiDhC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/security",
3
3
  "license": "EUPL-1.2",
4
- "version": "12.6.1",
4
+ "version": "12.8.0",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^17.2.2",
7
7
  "@angular/core": "^17.2.2"