@valtimo/security 4.23.0 → 5.2.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.
Files changed (48) hide show
  1. package/esm2020/lib/error/error-routing.module.mjs +44 -0
  2. package/esm2020/lib/error/error.component.mjs +38 -0
  3. package/esm2020/lib/error/error.mjs +19 -0
  4. package/esm2020/lib/error/http-error.interceptor.mjs +51 -0
  5. package/esm2020/lib/guard/auth-guard.service.mjs +40 -0
  6. package/esm2020/lib/security.module.mjs +35 -0
  7. package/esm2020/lib/user-provider.service.mjs +69 -0
  8. package/esm2020/public_api.mjs +24 -0
  9. package/esm2020/valtimo-security.mjs +5 -0
  10. package/fesm2015/valtimo-security.mjs +289 -0
  11. package/fesm2015/valtimo-security.mjs.map +1 -0
  12. package/fesm2020/valtimo-security.mjs +298 -0
  13. package/fesm2020/valtimo-security.mjs.map +1 -0
  14. package/lib/error/error-routing.module.d.ts +7 -0
  15. package/lib/error/error-routing.module.d.ts.map +1 -0
  16. package/lib/error/error.component.d.ts +4 -0
  17. package/lib/error/error.component.d.ts.map +1 -0
  18. package/lib/error/error.d.ts +1 -0
  19. package/lib/error/error.d.ts.map +1 -0
  20. package/lib/error/http-error.interceptor.d.ts +4 -0
  21. package/lib/error/http-error.interceptor.d.ts.map +1 -0
  22. package/lib/guard/auth-guard.service.d.ts +4 -0
  23. package/lib/guard/auth-guard.service.d.ts.map +1 -0
  24. package/lib/security.module.d.ts +7 -0
  25. package/lib/security.module.d.ts.map +1 -0
  26. package/lib/user-provider.service.d.ts +4 -0
  27. package/lib/user-provider.service.d.ts.map +1 -0
  28. package/package.json +22 -10
  29. package/public_api.d.ts +1 -0
  30. package/public_api.d.ts.map +1 -0
  31. package/valtimo-security.d.ts +2 -2
  32. package/valtimo-security.d.ts.map +1 -0
  33. package/bundles/valtimo-security.umd.js +0 -631
  34. package/bundles/valtimo-security.umd.js.map +0 -1
  35. package/bundles/valtimo-security.umd.min.js +0 -2
  36. package/bundles/valtimo-security.umd.min.js.map +0 -1
  37. package/esm2015/lib/error/error-routing.module.js +0 -40
  38. package/esm2015/lib/error/error.component.js +0 -41
  39. package/esm2015/lib/error/error.js +0 -19
  40. package/esm2015/lib/error/http-error.interceptor.js +0 -55
  41. package/esm2015/lib/guard/auth-guard.service.js +0 -45
  42. package/esm2015/lib/security.module.js +0 -30
  43. package/esm2015/lib/user-provider.service.js +0 -81
  44. package/esm2015/public_api.js +0 -24
  45. package/esm2015/valtimo-security.js +0 -7
  46. package/fesm2015/valtimo-security.js +0 -291
  47. package/fesm2015/valtimo-security.js.map +0 -1
  48. package/valtimo-security.metadata.json +0 -1
@@ -0,0 +1,289 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@valtimo/config';
4
+ import * as i2 from 'ngx-logger';
5
+ import * as i1$1 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import { CommonModule } from '@angular/common';
8
+ import { throwError } from 'rxjs';
9
+ import { retry, catchError } from 'rxjs/operators';
10
+ import * as i2$1 from '@angular/common/http';
11
+ import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
12
+ import * as i1$2 from 'ngx-toastr';
13
+ import { __awaiter } from 'tslib';
14
+
15
+ /*
16
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
17
+ *
18
+ * Licensed under EUPL, Version 1.2 (the "License");
19
+ * you may not use this file except in compliance with the License.
20
+ * You may obtain a copy of the License at
21
+ *
22
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software
25
+ * distributed under the License is distributed on an "AS IS" basis,
26
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
+ * See the License for the specific language governing permissions and
28
+ * limitations under the License.
29
+ */
30
+ class AuthGuardService {
31
+ constructor(configService, injector, logger) {
32
+ this.injector = injector;
33
+ this.logger = logger;
34
+ this.authGuardServiceProvider = injector.get(configService.config.authentication.authProviders.guardServiceProvider);
35
+ this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);
36
+ }
37
+ canActivate(route, state) {
38
+ this.logger.debug('Delegating AuthGuard canActivate');
39
+ return this.authGuardServiceProvider.canActivate(route, state);
40
+ }
41
+ }
42
+ AuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, deps: [{ token: i1.ConfigService }, { token: i0.Injector }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
43
+ AuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, providedIn: 'root' });
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, decorators: [{
45
+ type: Injectable,
46
+ args: [{
47
+ providedIn: 'root',
48
+ }]
49
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i0.Injector }, { type: i2.NGXLogger }]; } });
50
+
51
+ /*
52
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
53
+ *
54
+ * Licensed under EUPL, Version 1.2 (the "License");
55
+ * you may not use this file except in compliance with the License.
56
+ * You may obtain a copy of the License at
57
+ *
58
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
59
+ *
60
+ * Unless required by applicable law or agreed to in writing, software
61
+ * distributed under the License is distributed on an "AS IS" basis,
62
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63
+ * See the License for the specific language governing permissions and
64
+ * limitations under the License.
65
+ */
66
+ class ErrorComponent {
67
+ constructor(activatedRoute) {
68
+ this.activatedRoute = activatedRoute;
69
+ }
70
+ ngOnInit() {
71
+ if (this.activatedRoute.snapshot.data) {
72
+ this.err = {
73
+ title: this.activatedRoute.snapshot.data.title,
74
+ error: this.activatedRoute.snapshot.data.error,
75
+ };
76
+ }
77
+ }
78
+ }
79
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorComponent, deps: [{ token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
80
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ErrorComponent, selector: "valtimo-error", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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", styles: [""] });
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorComponent, decorators: [{
82
+ type: Component,
83
+ args: [{ selector: 'valtimo-error', template: "<!--\n ~ Copyright 2015-2020 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", styles: [""] }]
84
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }]; } });
85
+
86
+ /*
87
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
88
+ *
89
+ * Licensed under EUPL, Version 1.2 (the "License");
90
+ * you may not use this file except in compliance with the License.
91
+ * You may obtain a copy of the License at
92
+ *
93
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
94
+ *
95
+ * Unless required by applicable law or agreed to in writing, software
96
+ * distributed under the License is distributed on an "AS IS" basis,
97
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
98
+ * See the License for the specific language governing permissions and
99
+ * limitations under the License.
100
+ */
101
+ const InterceptorSkip = 'X-Skip-Interceptor';
102
+ const InterceptorSkipHeader = new HttpHeaders().set(InterceptorSkip, '');
103
+
104
+ class HttpErrorInterceptor {
105
+ constructor(toastr, logger) {
106
+ this.toastr = toastr;
107
+ this.logger = logger;
108
+ }
109
+ intercept(request, next) {
110
+ if (request.headers && request.headers.has(InterceptorSkip)) {
111
+ const headers = request.headers.delete(InterceptorSkip);
112
+ return next.handle(request.clone({ headers }));
113
+ }
114
+ else {
115
+ return next.handle(request).pipe(retry(1), catchError((error) => {
116
+ var _a, _b, _c, _d;
117
+ let errorMessage = '';
118
+ if ((error === null || error === void 0 ? void 0 : error.error) instanceof ErrorEvent) {
119
+ // client-side error
120
+ errorMessage = `Error: ${error.error.message}`;
121
+ }
122
+ else {
123
+ // server-side error
124
+ if ((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.errors) {
125
+ errorMessage = (_b = error === null || error === void 0 ? void 0 : error.error) === null || _b === void 0 ? void 0 : _b.errors;
126
+ }
127
+ else if ((_c = error === null || error === void 0 ? void 0 : error.error) === null || _c === void 0 ? void 0 : _c.message) {
128
+ errorMessage = (_d = error === null || error === void 0 ? void 0 : error.error) === null || _d === void 0 ? void 0 : _d.message;
129
+ }
130
+ else {
131
+ errorMessage = `Error Code: ${error === null || error === void 0 ? void 0 : error.status}\nMessage: ${error === null || error === void 0 ? void 0 : error.message}`;
132
+ }
133
+ }
134
+ this.toastr.warning(`An unexpected error occurred...${errorMessage}`);
135
+ return throwError(errorMessage);
136
+ }));
137
+ }
138
+ }
139
+ }
140
+ HttpErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1$2.ToastrService }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
141
+ HttpErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, providedIn: 'root' });
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, decorators: [{
143
+ type: Injectable,
144
+ args: [{
145
+ providedIn: 'root',
146
+ }]
147
+ }], ctorParameters: function () { return [{ type: i1$2.ToastrService }, { type: i2.NGXLogger }]; } });
148
+
149
+ /*
150
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
151
+ *
152
+ * Licensed under EUPL, Version 1.2 (the "License");
153
+ * you may not use this file except in compliance with the License.
154
+ * You may obtain a copy of the License at
155
+ *
156
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
157
+ *
158
+ * Unless required by applicable law or agreed to in writing, software
159
+ * distributed under the License is distributed on an "AS IS" basis,
160
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
161
+ * See the License for the specific language governing permissions and
162
+ * limitations under the License.
163
+ */
164
+ const routes = [
165
+ { path: '403', component: ErrorComponent, data: { title: 'Access Forbidden', error: 403 } },
166
+ { path: '404', component: ErrorComponent, data: { title: 'Not Found', error: 404 } },
167
+ { path: '500', component: ErrorComponent, data: { title: 'Internal Server Error', error: 500 } },
168
+ { path: '503', component: ErrorComponent, data: { title: 'Service Unavailable', error: 503 } },
169
+ ];
170
+ class ErrorRoutingModule {
171
+ }
172
+ ErrorRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
173
+ ErrorRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] });
174
+ ErrorRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }], imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, decorators: [{
176
+ type: NgModule,
177
+ args: [{
178
+ declarations: [],
179
+ imports: [CommonModule, RouterModule.forChild(routes)],
180
+ exports: [RouterModule],
181
+ providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }],
182
+ }]
183
+ }] });
184
+
185
+ /*
186
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
187
+ *
188
+ * Licensed under EUPL, Version 1.2 (the "License");
189
+ * you may not use this file except in compliance with the License.
190
+ * You may obtain a copy of the License at
191
+ *
192
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
193
+ *
194
+ * Unless required by applicable law or agreed to in writing, software
195
+ * distributed under the License is distributed on an "AS IS" basis,
196
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197
+ * See the License for the specific language governing permissions and
198
+ * limitations under the License.
199
+ */
200
+ class SecurityModule {
201
+ }
202
+ SecurityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
203
+ SecurityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, declarations: [ErrorComponent], imports: [ErrorRoutingModule], exports: [ErrorComponent] });
204
+ SecurityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, providers: [AuthGuardService], imports: [[ErrorRoutingModule]] });
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, decorators: [{
206
+ type: NgModule,
207
+ args: [{
208
+ declarations: [ErrorComponent],
209
+ imports: [ErrorRoutingModule],
210
+ exports: [ErrorComponent],
211
+ providers: [AuthGuardService],
212
+ }]
213
+ }] });
214
+
215
+ class UserProviderService {
216
+ constructor(configService, injector, http, logger) {
217
+ this.configService = configService;
218
+ this.injector = injector;
219
+ this.http = http;
220
+ this.logger = logger;
221
+ this.valtimoApiConfig = configService.config.valtimoApi;
222
+ this.userService = injector.get(configService.config.authentication.authProviders.userServiceProvider);
223
+ this.logger.debug('Loading UserProviderService service', this.userService);
224
+ }
225
+ getUserSubject() {
226
+ this.logger.debug('Delegating UserProviderService::getUserIdentity');
227
+ return this.userService.getUserSubject();
228
+ }
229
+ logout() {
230
+ this.logger.debug('Delegating UserProviderService::logout');
231
+ return this.userService.logout();
232
+ }
233
+ getToken() {
234
+ return __awaiter(this, void 0, void 0, function* () {
235
+ this.logger.debug('Delegating UserProviderService::getToken');
236
+ return this.userService.getToken();
237
+ });
238
+ }
239
+ updateToken(minValidity) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ this.logger.debug('Delegating UserProviderService::updateToken');
242
+ if (this.userService.updateToken) {
243
+ return this.userService.updateToken(minValidity);
244
+ }
245
+ else {
246
+ return new Promise(resolve => resolve(true));
247
+ }
248
+ });
249
+ }
250
+ getEmailNotificationSettings() {
251
+ this.logger.debug('getEmailNotificationSettings');
252
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}email-notification-settings`);
253
+ }
254
+ updateEmailNotificationSettings(settings) {
255
+ this.logger.debug('updateEmailNotificationSettings', settings);
256
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}email-notification-settings`, settings);
257
+ }
258
+ }
259
+ UserProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, deps: [{ token: i1.ConfigService }, { token: i0.Injector }, { token: i2$1.HttpClient }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
260
+ UserProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, providedIn: 'root' });
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, decorators: [{
262
+ type: Injectable,
263
+ args: [{
264
+ providedIn: 'root',
265
+ }]
266
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i0.Injector }, { type: i2$1.HttpClient }, { type: i2.NGXLogger }]; } });
267
+
268
+ /*
269
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
270
+ *
271
+ * Licensed under EUPL, Version 1.2 (the "License");
272
+ * you may not use this file except in compliance with the License.
273
+ * You may obtain a copy of the License at
274
+ *
275
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
276
+ *
277
+ * Unless required by applicable law or agreed to in writing, software
278
+ * distributed under the License is distributed on an "AS IS" basis,
279
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
+ * See the License for the specific language governing permissions and
281
+ * limitations under the License.
282
+ */
283
+
284
+ /**
285
+ * Generated bundle index. Do not edit.
286
+ */
287
+
288
+ export { AuthGuardService, ErrorComponent, InterceptorSkip, InterceptorSkipHeader, SecurityModule, UserProviderService };
289
+ //# sourceMappingURL=valtimo-security.mjs.map
@@ -0,0 +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/security.module.ts","../../../../projects/valtimo/security/src/lib/user-provider.service.ts","../../../../projects/valtimo/security/src/public_api.ts","../../../../projects/valtimo/security/src/valtimo-security.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 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-2020 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-2020 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-2020 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, '');\n\nexport interface Error {\n title: string;\n error: number;\n}\n","/*\n * Copyright 2015-2020 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, retry} 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(private toastr: ToastrService, private logger: NGXLogger) {}\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n if (request.headers && request.headers.has(InterceptorSkip)) {\n const headers = request.headers.delete(InterceptorSkip);\n return next.handle(request.clone({headers}));\n } else {\n return next.handle(request).pipe(\n retry(1),\n catchError((error: HttpErrorResponse) => {\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?.message) {\n errorMessage = error?.error?.message;\n } else {\n errorMessage = `Error Code: ${error?.status}\\nMessage: ${error?.message}`;\n }\n }\n this.toastr.warning(`An unexpected error occurred...${errorMessage}`);\n return throwError(errorMessage);\n })\n );\n }\n }\n}\n","/*\n * Copyright 2015-2020 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-2020 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';\n\n@NgModule({\n declarations: [ErrorComponent],\n imports: [ErrorRoutingModule],\n exports: [ErrorComponent],\n providers: [AuthGuardService],\n})\nexport class SecurityModule {}\n","/*\n * Copyright 2015-2020 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 EmailNotificationService,\n EmailNotificationSettings,\n UserIdentity,\n UserService,\n} from '@valtimo/config';\nimport {HttpClient} from '@angular/common/http';\nimport {ConfigService} from '@valtimo/config';\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 } else {\n return new Promise(resolve => resolve(true));\n }\n }\n\n public getEmailNotificationSettings(): Observable<EmailNotificationSettings> {\n this.logger.debug('getEmailNotificationSettings');\n return this.http.get<EmailNotificationSettings>(\n `${this.valtimoApiConfig.endpointUri}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}email-notification-settings`,\n settings\n );\n }\n}\n","/*\n * Copyright 2015-2020 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';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2","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A,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;AC9BD;;;;;;;;;;;;;;AAcG;;ACdH;;AAEG;;;;"}
@@ -0,0 +1,298 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@valtimo/config';
4
+ import * as i2 from 'ngx-logger';
5
+ import * as i1$1 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import { CommonModule } from '@angular/common';
8
+ import { throwError } from 'rxjs';
9
+ import { retry, catchError } from 'rxjs/operators';
10
+ import * as i2$1 from '@angular/common/http';
11
+ import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
12
+ import * as i1$2 from 'ngx-toastr';
13
+
14
+ /*
15
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
16
+ *
17
+ * Licensed under EUPL, Version 1.2 (the "License");
18
+ * you may not use this file except in compliance with the License.
19
+ * You may obtain a copy of the License at
20
+ *
21
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software
24
+ * distributed under the License is distributed on an "AS IS" basis,
25
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ * See the License for the specific language governing permissions and
27
+ * limitations under the License.
28
+ */
29
+ class AuthGuardService {
30
+ constructor(configService, injector, logger) {
31
+ this.injector = injector;
32
+ this.logger = logger;
33
+ this.authGuardServiceProvider = injector.get(configService.config.authentication.authProviders.guardServiceProvider);
34
+ this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);
35
+ }
36
+ canActivate(route, state) {
37
+ this.logger.debug('Delegating AuthGuard canActivate');
38
+ return this.authGuardServiceProvider.canActivate(route, state);
39
+ }
40
+ }
41
+ AuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, deps: [{ token: i1.ConfigService }, { token: i0.Injector }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
42
+ AuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, providedIn: 'root' });
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AuthGuardService, decorators: [{
44
+ type: Injectable,
45
+ args: [{
46
+ providedIn: 'root',
47
+ }]
48
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i0.Injector }, { type: i2.NGXLogger }]; } });
49
+
50
+ /*
51
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
52
+ *
53
+ * Licensed under EUPL, Version 1.2 (the "License");
54
+ * you may not use this file except in compliance with the License.
55
+ * You may obtain a copy of the License at
56
+ *
57
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
58
+ *
59
+ * Unless required by applicable law or agreed to in writing, software
60
+ * distributed under the License is distributed on an "AS IS" basis,
61
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62
+ * See the License for the specific language governing permissions and
63
+ * limitations under the License.
64
+ */
65
+ class ErrorComponent {
66
+ constructor(activatedRoute) {
67
+ this.activatedRoute = activatedRoute;
68
+ }
69
+ ngOnInit() {
70
+ if (this.activatedRoute.snapshot.data) {
71
+ this.err = {
72
+ title: this.activatedRoute.snapshot.data.title,
73
+ error: this.activatedRoute.snapshot.data.error,
74
+ };
75
+ }
76
+ }
77
+ }
78
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorComponent, deps: [{ token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
79
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ErrorComponent, selector: "valtimo-error", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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", styles: [""] });
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorComponent, decorators: [{
81
+ type: Component,
82
+ args: [{ selector: 'valtimo-error', template: "<!--\n ~ Copyright 2015-2020 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", styles: [""] }]
83
+ }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }]; } });
84
+
85
+ /*
86
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
87
+ *
88
+ * Licensed under EUPL, Version 1.2 (the "License");
89
+ * you may not use this file except in compliance with the License.
90
+ * You may obtain a copy of the License at
91
+ *
92
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
93
+ *
94
+ * Unless required by applicable law or agreed to in writing, software
95
+ * distributed under the License is distributed on an "AS IS" basis,
96
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
+ * See the License for the specific language governing permissions and
98
+ * limitations under the License.
99
+ */
100
+ const InterceptorSkip = 'X-Skip-Interceptor';
101
+ const InterceptorSkipHeader = new HttpHeaders().set(InterceptorSkip, '');
102
+
103
+ class HttpErrorInterceptor {
104
+ constructor(toastr, logger) {
105
+ this.toastr = toastr;
106
+ this.logger = logger;
107
+ }
108
+ intercept(request, next) {
109
+ if (request.headers && request.headers.has(InterceptorSkip)) {
110
+ const headers = request.headers.delete(InterceptorSkip);
111
+ return next.handle(request.clone({ headers }));
112
+ }
113
+ else {
114
+ return next.handle(request).pipe(retry(1), catchError((error) => {
115
+ let errorMessage = '';
116
+ if (error?.error instanceof ErrorEvent) {
117
+ // client-side error
118
+ errorMessage = `Error: ${error.error.message}`;
119
+ }
120
+ else {
121
+ // server-side error
122
+ if (error?.error?.errors) {
123
+ errorMessage = error?.error?.errors;
124
+ }
125
+ else if (error?.error?.message) {
126
+ errorMessage = error?.error?.message;
127
+ }
128
+ else {
129
+ errorMessage = `Error Code: ${error?.status}\nMessage: ${error?.message}`;
130
+ }
131
+ }
132
+ this.toastr.warning(`An unexpected error occurred...${errorMessage}`);
133
+ return throwError(errorMessage);
134
+ }));
135
+ }
136
+ }
137
+ }
138
+ HttpErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, deps: [{ token: i1$2.ToastrService }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
139
+ HttpErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, providedIn: 'root' });
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: HttpErrorInterceptor, decorators: [{
141
+ type: Injectable,
142
+ args: [{
143
+ providedIn: 'root',
144
+ }]
145
+ }], ctorParameters: function () { return [{ type: i1$2.ToastrService }, { type: i2.NGXLogger }]; } });
146
+
147
+ /*
148
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
149
+ *
150
+ * Licensed under EUPL, Version 1.2 (the "License");
151
+ * you may not use this file except in compliance with the License.
152
+ * You may obtain a copy of the License at
153
+ *
154
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
155
+ *
156
+ * Unless required by applicable law or agreed to in writing, software
157
+ * distributed under the License is distributed on an "AS IS" basis,
158
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
159
+ * See the License for the specific language governing permissions and
160
+ * limitations under the License.
161
+ */
162
+ const routes = [
163
+ { path: '403', component: ErrorComponent, data: { title: 'Access Forbidden', error: 403 } },
164
+ { path: '404', component: ErrorComponent, data: { title: 'Not Found', error: 404 } },
165
+ { path: '500', component: ErrorComponent, data: { title: 'Internal Server Error', error: 500 } },
166
+ { path: '503', component: ErrorComponent, data: { title: 'Service Unavailable', error: 503 } },
167
+ ];
168
+ class ErrorRoutingModule {
169
+ }
170
+ ErrorRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
171
+ ErrorRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] });
172
+ ErrorRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }], imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ErrorRoutingModule, decorators: [{
174
+ type: NgModule,
175
+ args: [{
176
+ declarations: [],
177
+ imports: [CommonModule, RouterModule.forChild(routes)],
178
+ exports: [RouterModule],
179
+ providers: [{ provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }],
180
+ }]
181
+ }] });
182
+
183
+ /*
184
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
185
+ *
186
+ * Licensed under EUPL, Version 1.2 (the "License");
187
+ * you may not use this file except in compliance with the License.
188
+ * You may obtain a copy of the License at
189
+ *
190
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
191
+ *
192
+ * Unless required by applicable law or agreed to in writing, software
193
+ * distributed under the License is distributed on an "AS IS" basis,
194
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195
+ * See the License for the specific language governing permissions and
196
+ * limitations under the License.
197
+ */
198
+ class SecurityModule {
199
+ }
200
+ SecurityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
201
+ SecurityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, declarations: [ErrorComponent], imports: [ErrorRoutingModule], exports: [ErrorComponent] });
202
+ SecurityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, providers: [AuthGuardService], imports: [[ErrorRoutingModule]] });
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: SecurityModule, decorators: [{
204
+ type: NgModule,
205
+ args: [{
206
+ declarations: [ErrorComponent],
207
+ imports: [ErrorRoutingModule],
208
+ exports: [ErrorComponent],
209
+ providers: [AuthGuardService],
210
+ }]
211
+ }] });
212
+
213
+ /*
214
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
215
+ *
216
+ * Licensed under EUPL, Version 1.2 (the "License");
217
+ * you may not use this file except in compliance with the License.
218
+ * You may obtain a copy of the License at
219
+ *
220
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
221
+ *
222
+ * Unless required by applicable law or agreed to in writing, software
223
+ * distributed under the License is distributed on an "AS IS" basis,
224
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225
+ * See the License for the specific language governing permissions and
226
+ * limitations under the License.
227
+ */
228
+ class UserProviderService {
229
+ constructor(configService, injector, http, logger) {
230
+ this.configService = configService;
231
+ this.injector = injector;
232
+ this.http = http;
233
+ this.logger = logger;
234
+ this.valtimoApiConfig = configService.config.valtimoApi;
235
+ this.userService = injector.get(configService.config.authentication.authProviders.userServiceProvider);
236
+ this.logger.debug('Loading UserProviderService service', this.userService);
237
+ }
238
+ getUserSubject() {
239
+ this.logger.debug('Delegating UserProviderService::getUserIdentity');
240
+ return this.userService.getUserSubject();
241
+ }
242
+ logout() {
243
+ this.logger.debug('Delegating UserProviderService::logout');
244
+ return this.userService.logout();
245
+ }
246
+ async getToken() {
247
+ this.logger.debug('Delegating UserProviderService::getToken');
248
+ return this.userService.getToken();
249
+ }
250
+ async updateToken(minValidity) {
251
+ this.logger.debug('Delegating UserProviderService::updateToken');
252
+ if (this.userService.updateToken) {
253
+ return this.userService.updateToken(minValidity);
254
+ }
255
+ else {
256
+ return new Promise(resolve => resolve(true));
257
+ }
258
+ }
259
+ getEmailNotificationSettings() {
260
+ this.logger.debug('getEmailNotificationSettings');
261
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}email-notification-settings`);
262
+ }
263
+ updateEmailNotificationSettings(settings) {
264
+ this.logger.debug('updateEmailNotificationSettings', settings);
265
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}email-notification-settings`, settings);
266
+ }
267
+ }
268
+ UserProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, deps: [{ token: i1.ConfigService }, { token: i0.Injector }, { token: i2$1.HttpClient }, { token: i2.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
269
+ UserProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, providedIn: 'root' });
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: UserProviderService, decorators: [{
271
+ type: Injectable,
272
+ args: [{
273
+ providedIn: 'root',
274
+ }]
275
+ }], ctorParameters: function () { return [{ type: i1.ConfigService }, { type: i0.Injector }, { type: i2$1.HttpClient }, { type: i2.NGXLogger }]; } });
276
+
277
+ /*
278
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
279
+ *
280
+ * Licensed under EUPL, Version 1.2 (the "License");
281
+ * you may not use this file except in compliance with the License.
282
+ * You may obtain a copy of the License at
283
+ *
284
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
285
+ *
286
+ * Unless required by applicable law or agreed to in writing, software
287
+ * distributed under the License is distributed on an "AS IS" basis,
288
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
289
+ * See the License for the specific language governing permissions and
290
+ * limitations under the License.
291
+ */
292
+
293
+ /**
294
+ * Generated bundle index. Do not edit.
295
+ */
296
+
297
+ export { AuthGuardService, ErrorComponent, InterceptorSkip, InterceptorSkipHeader, SecurityModule, UserProviderService };
298
+ //# sourceMappingURL=valtimo-security.mjs.map