@odx/auth 1.0.0-rc.3 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -11
- package/esm2020/lib/auth.component.mjs +3 -3
- package/esm2020/lib/auth.config.mjs +3 -3
- package/esm2020/lib/auth.directive.mjs +3 -3
- package/esm2020/lib/auth.module.mjs +5 -12
- package/esm2020/lib/auth.providers.mjs +8 -8
- package/esm2020/lib/auth.service.mjs +11 -10
- package/esm2020/lib/directives/sign-in.directive.mjs +3 -3
- package/esm2020/lib/directives/sign-out.directive.mjs +3 -3
- package/fesm2015/odx-auth.mjs +44 -49
- package/fesm2015/odx-auth.mjs.map +1 -1
- package/fesm2020/odx-auth.mjs +44 -49
- package/fesm2020/odx-auth.mjs.map +1 -1
- package/lib/auth.config.d.ts +2 -2
- package/lib/auth.module.d.ts +0 -4
- package/lib/auth.providers.d.ts +3 -3
- package/package.json +1 -1
package/fesm2015/odx-auth.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable, EventEmitter, Directive, Output, HostListener, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EnvironmentInjector, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, APP_INITIALIZER
|
|
2
|
+
import { inject, Injectable, EventEmitter, Directive, Output, HostListener, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule, EnvironmentInjector, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, APP_INITIALIZER } from '@angular/core';
|
|
3
3
|
import { WindowRef, CoreModule } from '@odx/angular';
|
|
4
4
|
import * as i3 from '@odx/angular/components/area-header';
|
|
5
5
|
import { AreaHeaderModule } from '@odx/angular/components/area-header';
|
|
@@ -8,7 +8,7 @@ import { DropdownModule } from '@odx/angular/components/dropdown';
|
|
|
8
8
|
import * as i9 from '@odx/angular/components/header';
|
|
9
9
|
import { HeaderModule } from '@odx/angular/components/header';
|
|
10
10
|
import { LogoDirective } from '@odx/angular/components/logo';
|
|
11
|
-
import {
|
|
11
|
+
import { createConfigTokens, Position, untilDestroyed, isString, buildUrl } from '@odx/angular/utils';
|
|
12
12
|
import { __awaiter } from 'tslib';
|
|
13
13
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
14
14
|
import { Router } from '@angular/router';
|
|
@@ -30,7 +30,7 @@ const DEFAULT_ISSUERS = {
|
|
|
30
30
|
stage: 'https://test.login.draeger.com/oauth2/default',
|
|
31
31
|
prod: 'https://login.draeger.com/oauth2/default',
|
|
32
32
|
};
|
|
33
|
-
const {
|
|
33
|
+
const { AuthDefaultConfig, AuthConfig, injectAuthConfig, provideAuthConfig } = createConfigTokens('Auth', '@odx/auth', {
|
|
34
34
|
environment: 'prod',
|
|
35
35
|
redirectPath: 'login/callback',
|
|
36
36
|
allowedUrls: [],
|
|
@@ -62,7 +62,7 @@ function parseIdentityClaims(identityClaims) {
|
|
|
62
62
|
|
|
63
63
|
class AuthService {
|
|
64
64
|
constructor() {
|
|
65
|
-
this.authConfig =
|
|
65
|
+
this.authConfig = injectAuthConfig();
|
|
66
66
|
this.oauthService = inject(OAuthService);
|
|
67
67
|
this.router = inject(Router);
|
|
68
68
|
this.windowRef = inject(WindowRef);
|
|
@@ -102,16 +102,17 @@ class AuthService {
|
|
|
102
102
|
}
|
|
103
103
|
catch (error) {
|
|
104
104
|
if (error instanceof HttpErrorResponse) {
|
|
105
|
-
|
|
105
|
+
this.isInitialized$$.next(true);
|
|
106
106
|
}
|
|
107
|
-
if (error instanceof OAuthErrorEvent) {
|
|
107
|
+
else if (error instanceof OAuthErrorEvent) {
|
|
108
108
|
if (error.type === 'token_refresh_error') {
|
|
109
109
|
this.signIn(this.windowRef.location.pathname);
|
|
110
110
|
}
|
|
111
111
|
this.isInitialized$$.next(true);
|
|
112
|
-
return;
|
|
113
112
|
}
|
|
114
|
-
|
|
113
|
+
else {
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
115
116
|
}
|
|
116
117
|
if (this.oauthService.hasValidAccessToken()) {
|
|
117
118
|
yield this.routeToRequestedUrl();
|
|
@@ -167,9 +168,9 @@ class AuthService {
|
|
|
167
168
|
return Date.now() - issuedAt * 1000 <= this.authConfig.maxOfflineTime * 1000;
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
171
|
-
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
171
|
+
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
172
|
+
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthService, decorators: [{
|
|
173
174
|
type: Injectable,
|
|
174
175
|
args: [{ providedIn: 'root' }]
|
|
175
176
|
}], ctorParameters: function () { return []; } });
|
|
@@ -192,9 +193,9 @@ class SignInDirective {
|
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
|
-
SignInDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
196
|
-
SignInDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
196
|
+
SignInDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: SignInDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
197
|
+
SignInDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: SignInDirective, isStandalone: true, selector: "[odxButton][odxAuthSignIn]", outputs: { afterSignIn: "odxAuthSignIn" }, host: { listeners: { "click": "signIn()" } }, hostDirectives: [{ directive: i1.LoadingSpinnerDirective }], ngImport: i0 });
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: SignInDirective, decorators: [{
|
|
198
199
|
type: Directive,
|
|
199
200
|
args: [{
|
|
200
201
|
standalone: true,
|
|
@@ -227,9 +228,9 @@ class SignOutDirective {
|
|
|
227
228
|
});
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
|
-
SignOutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
231
|
-
SignOutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
231
|
+
SignOutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: SignOutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
232
|
+
SignOutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: SignOutDirective, isStandalone: true, selector: "[odxButton][odxAuthSignOut]", outputs: { afterSignOut: "odxAuthSignOut" }, host: { listeners: { "click": "signIn()" } }, hostDirectives: [{ directive: i1.LoadingSpinnerDirective }], ngImport: i0 });
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: SignOutDirective, decorators: [{
|
|
233
234
|
type: Directive,
|
|
234
235
|
args: [{
|
|
235
236
|
standalone: true,
|
|
@@ -256,9 +257,9 @@ class AuthComponent {
|
|
|
256
257
|
this.signOutButtonText = 'Sign out';
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
|
-
AuthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
260
|
-
AuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
260
|
+
AuthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
261
|
+
AuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.4", type: AuthComponent, isStandalone: true, selector: "odx-auth", inputs: { signInButtonText: "signInButtonText", signOutButtonText: "signOutButtonText" }, ngImport: i0, template: "<odx-action-group *ngrxLet=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ } as vm\">\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.name }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"secondary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n</odx-action-group>\n", styles: [".odx-auth-user-profile .odx-dropdown__inner>.odx-area-header{max-width:max(360px,25vw);min-width:296px}\n"], dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "ngmodule", type: AreaHeaderModule }, { kind: "component", type: i3.AreaHeaderComponent, selector: "odx-area-header", inputs: ["size"] }, { kind: "directive", type: i3.AreaHeaderSubtitleDirective, selector: "odx-area-header-subtitle" }, { kind: "component", type: i4.AvatarComponent, selector: "odx-avatar", inputs: ["size", "variant"] }, { kind: "component", type: i5.ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: i6.ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: i7.IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: i8.DropdownDirective, selector: "[odxDropdown]", inputs: ["odxDropdown", "odxDropdownDisabled", "odxDropdownShowLoader", "odxDropdownOptions", "odxDropdownReferenceElement", "odxDropdownTriggerElement", "odxDropdownHost", "odxDropdownOpenTrigger", "odxDropdownCloseTrigger"], outputs: ["odxDropdownBeforeOpen", "odxDropdownAfterOpen", "odxDropdownBeforeClose", "odxDropdownAfterClose"], exportAs: ["odxDropdown"] }, { kind: "ngmodule", type: HeaderModule }, { kind: "directive", type: i9.HeaderAvatarDirective, selector: "button[odxButton][odxHeaderAvatar]" }, { kind: "directive", type: LogoDirective, selector: "odx-logo", inputs: ["size", "variant"] }, { kind: "directive", type: SignInDirective, selector: "[odxButton][odxAuthSignIn]", outputs: ["odxAuthSignIn"] }, { kind: "directive", type: SignOutDirective, selector: "[odxButton][odxAuthSignOut]", outputs: ["odxAuthSignOut"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthComponent, decorators: [{
|
|
262
263
|
type: Component,
|
|
263
264
|
args: [{ standalone: true, selector: 'odx-auth', imports: [CoreModule, AreaHeaderModule, DropdownModule, HeaderModule, LogoDirective, SignInDirective, SignOutDirective], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<odx-action-group *ngrxLet=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ } as vm\">\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.name }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"secondary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n</odx-action-group>\n", styles: [".odx-auth-user-profile .odx-dropdown__inner>.odx-area-header{max-width:max(360px,25vw);min-width:296px}\n"] }]
|
|
264
265
|
}], propDecorators: { signInButtonText: [{
|
|
@@ -285,9 +286,9 @@ class AuthDirective {
|
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
|
-
AuthDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
289
|
-
AuthDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
289
|
+
AuthDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
290
|
+
AuthDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: AuthDirective, isStandalone: true, selector: "ng-template[odxAuth]", inputs: { authorizationHandler: ["odxAuth", "authorizationHandler"], elseTemplate: ["odxAuthElse", "elseTemplate"] }, hostDirectives: [{ directive: i1$1.NgIf }], ngImport: i0 });
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthDirective, decorators: [{
|
|
291
292
|
type: Directive,
|
|
292
293
|
args: [{
|
|
293
294
|
standalone: true,
|
|
@@ -317,8 +318,22 @@ function authGuard(authorizedHandler) {
|
|
|
317
318
|
};
|
|
318
319
|
}
|
|
319
320
|
|
|
321
|
+
const modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];
|
|
322
|
+
class AuthModule {
|
|
323
|
+
}
|
|
324
|
+
AuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
325
|
+
AuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: AuthModule, imports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective], exports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective] });
|
|
326
|
+
AuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthModule, imports: [AuthComponent] });
|
|
327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: AuthModule, decorators: [{
|
|
328
|
+
type: NgModule,
|
|
329
|
+
args: [{
|
|
330
|
+
imports: [...modules],
|
|
331
|
+
exports: [...modules],
|
|
332
|
+
}]
|
|
333
|
+
}] });
|
|
334
|
+
|
|
320
335
|
function configureInterceptor() {
|
|
321
|
-
const { allowedUrls } =
|
|
336
|
+
const { allowedUrls } = injectAuthConfig();
|
|
322
337
|
return {
|
|
323
338
|
resourceServer: {
|
|
324
339
|
customUrlValidation: (url) => allowedUrls.some((allowedUrl) => (isString(allowedUrl) ? url.startsWith(allowedUrl) : !!url.match(allowedUrl))),
|
|
@@ -329,11 +344,11 @@ function configureInterceptor() {
|
|
|
329
344
|
function initializeAuthErrorHandler() {
|
|
330
345
|
const authService = inject(AuthService);
|
|
331
346
|
const injector = inject(EnvironmentInjector);
|
|
332
|
-
const { errorHandler } =
|
|
347
|
+
const { errorHandler } = injectAuthConfig();
|
|
333
348
|
authService.errors$.pipe(tap((error) => injector.runInContext(() => errorHandler(error)))).subscribe();
|
|
334
349
|
}
|
|
335
350
|
function initalizeAuthConfig() {
|
|
336
|
-
const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } =
|
|
351
|
+
const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } = injectAuthConfig();
|
|
337
352
|
const authService = inject(AuthService);
|
|
338
353
|
const origin = inject(WindowRef).getOrigin();
|
|
339
354
|
const scope = Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes !== null && scopes !== void 0 ? scopes : []))).join(' ');
|
|
@@ -352,7 +367,7 @@ function initalizeAuthConfig() {
|
|
|
352
367
|
}
|
|
353
368
|
function provideAuth(config) {
|
|
354
369
|
return makeEnvironmentProviders([
|
|
355
|
-
|
|
370
|
+
provideAuthConfig(config),
|
|
356
371
|
provideOAuthClient(),
|
|
357
372
|
{
|
|
358
373
|
provide: OAuthModuleConfig,
|
|
@@ -370,34 +385,14 @@ function provideAuth(config) {
|
|
|
370
385
|
},
|
|
371
386
|
{
|
|
372
387
|
provide: OAuthStorage,
|
|
373
|
-
useFactory: () => { var _a; return (_a = inject(
|
|
388
|
+
useFactory: () => { var _a; return (_a = inject(AuthConfig).storage) !== null && _a !== void 0 ? _a : inject(WindowRef).nativeWindow.localStorage; },
|
|
374
389
|
},
|
|
375
390
|
]);
|
|
376
391
|
}
|
|
377
392
|
|
|
378
|
-
const modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];
|
|
379
|
-
class AuthModule {
|
|
380
|
-
static forRoot(config) {
|
|
381
|
-
return {
|
|
382
|
-
ngModule: AuthModule,
|
|
383
|
-
providers: [provideAuth(config)],
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
AuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: AuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
388
|
-
AuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.1", ngImport: i0, type: AuthModule, imports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective], exports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective] });
|
|
389
|
-
AuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: AuthModule, imports: [AuthComponent] });
|
|
390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: AuthModule, decorators: [{
|
|
391
|
-
type: NgModule,
|
|
392
|
-
args: [{
|
|
393
|
-
imports: [...modules],
|
|
394
|
-
exports: [...modules],
|
|
395
|
-
}]
|
|
396
|
-
}] });
|
|
397
|
-
|
|
398
393
|
/**
|
|
399
394
|
* Generated bundle index. Do not edit.
|
|
400
395
|
*/
|
|
401
396
|
|
|
402
|
-
export { AuthComponent,
|
|
397
|
+
export { AuthComponent, AuthConfig, AuthDefaultConfig, AuthDirective, AuthModule, AuthService, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, SignInDirective, SignOutDirective, authGuard, configureInterceptor, createInititals, initalizeAuthConfig, initializeAuthErrorHandler, injectAuthConfig, parseIdentityClaims, provideAuth, provideAuthConfig };
|
|
403
398
|
//# sourceMappingURL=odx-auth.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-auth.mjs","sources":["../../../../libs/auth/src/lib/auth.config.ts","../../../../libs/auth/src/lib/helpers/create-inititals.ts","../../../../libs/auth/src/lib/helpers/parse-identity-claims.ts","../../../../libs/auth/src/lib/auth.service.ts","../../../../libs/auth/src/lib/directives/sign-in.directive.ts","../../../../libs/auth/src/lib/directives/sign-out.directive.ts","../../../../libs/auth/src/lib/auth.component.ts","../../../../libs/auth/src/lib/auth.component.html","../../../../libs/auth/src/lib/auth.directive.ts","../../../../libs/auth/src/lib/auth.guard.ts","../../../../libs/auth/src/lib/auth.providers.ts","../../../../libs/auth/src/lib/auth.module.ts","../../../../libs/auth/src/odx-auth.ts"],"sourcesContent":["import { createModuleConfigTokens } from '@odx/angular/utils';\nimport { OAuthErrorEvent, OAuthStorage } from 'angular-oauth2-oidc';\n\nimport { AuthEnvironment } from './models';\n\nexport const DEFAULT_AUTH_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\nexport const DEFAULT_ISSUERS: Record<AuthEnvironment, string> = {\n dev: 'https://dev.login.draeger.com/oauth2/default',\n stage: 'https://test.login.draeger.com/oauth2/default',\n prod: 'https://login.draeger.com/oauth2/default',\n};\n\nexport type AuthErrorHandlerFn = (error: OAuthErrorEvent) => void;\n\nexport interface AuthModuleConfig {\n environment: AuthEnvironment;\n clientId?: string;\n issuer?: string;\n redirectPath: string;\n allowedUrls: Array<string | RegExp>;\n timeoutFactor: number;\n maxOfflineTime: number;\n loadUserProfile: boolean;\n postLogoutRedirectUrl?: string;\n scopes?: string[];\n discoveryUrl?: string;\n errorHandler: AuthErrorHandlerFn;\n storage?: OAuthStorage;\n}\n\nexport const { AuthDefaultModuleConfig, AuthModuleConfig, injectAuthModuleConfig } = createModuleConfigTokens('Auth', '@odx/auth', {\n environment: 'prod',\n redirectPath: 'login/callback',\n allowedUrls: [],\n timeoutFactor: 0.75,\n maxOfflineTime: 24 * 60 * 60, // 1 day\n loadUserProfile: false,\n errorHandler: (error) => {\n throw error;\n },\n} as AuthModuleConfig);\n","export function createInititals(value?: string | null): string {\n if (!value) return '';\n const parts = value.trim().split(' ');\n\n return parts.reduce((initials, curr, index) => {\n if (index === 0 || index === parts.length - 1) {\n initials = `${initials}${curr.charAt(0).toUpperCase()}`;\n }\n return initials;\n }, '');\n}\n","import { createInititals } from './create-inititals';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function parseIdentityClaims(identityClaims: any): OdxAuth.IdentiyClaims {\n return {\n ...identityClaims,\n email: identityClaims?.email ?? identityClaims.email_address ?? identityClaims.emails?.[0],\n initials: createInititals(identityClaims.name),\n };\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable, OnDestroy } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { WindowRef } from '@odx/angular';\nimport { AuthConfig, OAuthErrorEvent, OAuthService } from 'angular-oauth2-oidc';\nimport {\n BehaviorSubject,\n combineLatest,\n distinctUntilChanged,\n filter,\n fromEvent,\n map,\n Observable,\n share,\n shareReplay,\n startWith,\n Subscription,\n switchMap,\n tap,\n} from 'rxjs';\nimport { injectAuthModuleConfig } from './auth.config';\nimport { parseIdentityClaims } from './helpers/parse-identity-claims';\nimport { AuthorizedHandler } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthService implements OnDestroy {\n private readonly subscription: Subscription;\n private readonly authConfig = injectAuthModuleConfig();\n private readonly oauthService = inject(OAuthService);\n private readonly router = inject(Router);\n private readonly windowRef = inject(WindowRef);\n\n private readonly isInitialized$$ = new BehaviorSubject<boolean>(false);\n private readonly onAccessTokenUpdate$ = fromEvent<StorageEvent>(this.windowRef.nativeWindow, 'storage').pipe(\n filter(({ key }) => key === 'access_token' || key === null),\n startWith(null),\n share()\n );\n private readonly onAuthStateChange$ = combineLatest([this.oauthService.events.pipe(startWith(null)), this.windowRef.isOnline$, this.onAccessTokenUpdate$]);\n\n public readonly isAuthenticated$ = this.isInitialized$$.pipe(\n filter(Boolean),\n switchMap(() => this.onAuthStateChange$),\n map(() => this.isAuthenticated()),\n distinctUntilChanged(),\n shareReplay({ refCount: true })\n );\n public readonly identityClaims$: Observable<OdxAuth.IdentiyClaims | null> = this.isAuthenticated$.pipe(\n map(() => this.getIdentityClaims()),\n shareReplay({ refCount: true })\n );\n public readonly errors$ = this.oauthService.events.pipe(\n filter((event): event is OAuthErrorEvent => event instanceof OAuthErrorEvent),\n share()\n );\n\n constructor() {\n this.subscription = this.windowRef.isOnline$\n .pipe(\n tap((isOnline) => {\n if (isOnline) {\n this.oauthService.setupAutomaticSilentRefresh();\n } else {\n this.oauthService.stopAutomaticRefresh();\n }\n })\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n public async initialize(config: AuthConfig): Promise<void> {\n this.oauthService.configure(config);\n try {\n await this.oauthService.loadDiscoveryDocument(this.authConfig.discoveryUrl);\n await this.oauthService.tryLoginCodeFlow();\n if (this.getRefreshToken() && !this.isAuthenticated()) {\n await this.oauthService.refreshToken();\n }\n this.isInitialized$$.next(true);\n if (this.authConfig.loadUserProfile && this.oauthService.hasValidAccessToken()) {\n await this.loadUserProfile();\n }\n } catch (error) {\n if (error instanceof HttpErrorResponse) {\n return;\n }\n if (error instanceof OAuthErrorEvent) {\n if (error.type === 'token_refresh_error') {\n this.signIn(this.windowRef.location.pathname);\n }\n this.isInitialized$$.next(true);\n return;\n }\n throw error;\n }\n if (this.oauthService.hasValidAccessToken()) {\n await this.routeToRequestedUrl();\n }\n }\n\n public signIn(url?: string): void {\n this.oauthService.initCodeFlow(url);\n }\n\n public signOut(): void {\n this.oauthService.logOut(!this.getAccessToken());\n }\n\n public async loadUserProfile(): Promise<void> {\n await this.oauthService.loadUserProfile();\n }\n\n public getAccessToken(): string | null {\n return this.oauthService.getAccessToken() ?? null;\n }\n\n public getRefreshToken(): string | null {\n return this.oauthService.getRefreshToken() ?? null;\n }\n\n public getIdToken(): string | null {\n return this.oauthService.getIdToken() ?? null;\n }\n\n public getIdentityClaims(): OdxAuth.IdentiyClaims | null {\n return this.getIdToken() ? parseIdentityClaims(this.oauthService.getIdentityClaims()) : null;\n }\n\n public isAuthenticated(): boolean {\n if (this.windowRef.isOnline()) {\n return this.oauthService.hasValidAccessToken() && this.oauthService.hasValidIdToken();\n }\n return this.hasValidOfflineToken();\n }\n\n public isAuthorized(authorizedHandler?: AuthorizedHandler | null): boolean {\n return this.isAuthenticated() && (authorizedHandler?.(this.getIdentityClaims(), this) ?? true);\n }\n\n private async routeToRequestedUrl(): Promise<void> {\n if (this.oauthService.state) {\n await this.router.navigateByUrl(decodeURIComponent(this.oauthService.state));\n }\n }\n\n private hasValidOfflineToken(): boolean {\n const issuedAt = this.getIdentityClaims()?.iat ?? 0;\n\n return Date.now() - issuedAt * 1000 <= this.authConfig.maxOfflineTime * 1000;\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignIn]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignInDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignIn')\n public afterSignIn = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signIn();\n this.afterSignIn.emit();\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignOut]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignOutDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignOut')\n public afterSignOut = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signOut();\n this.afterSignOut.emit();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AreaHeaderModule } from '@odx/angular/components/area-header';\nimport { DropdownModule, DropdownOptions } from '@odx/angular/components/dropdown';\nimport { HeaderModule } from '@odx/angular/components/header';\nimport { LogoDirective } from '@odx/angular/components/logo';\nimport { Position } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { SignInDirective, SignOutDirective } from './directives';\n\n@Component({\n standalone: true,\n selector: 'odx-auth',\n imports: [CoreModule, AreaHeaderModule, DropdownModule, HeaderModule, LogoDirective, SignInDirective, SignOutDirective],\n templateUrl: './auth.component.html',\n styleUrls: ['./auth.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AuthComponent {\n protected readonly authService = inject(AuthService);\n protected readonly dropdownOptions = {\n position: Position.BOTTOM_END,\n enableFallback: false,\n containerClass: 'odx-auth-user-profile',\n } as Partial<DropdownOptions>;\n\n @Input()\n public signInButtonText = 'Sign in';\n\n @Input()\n public signOutButtonText = 'Sign out';\n}\n","<odx-action-group *ngrxLet=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ } as vm\">\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.name }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"secondary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n</odx-action-group>\n","import { NgIf, NgIfContext } from '@angular/common';\nimport { AfterViewInit, Directive, inject, Input, TemplateRef } from '@angular/core';\nimport { isString, untilDestroyed } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandler } from './models';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[odxAuth]',\n hostDirectives: [NgIf],\n})\nexport class AuthDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly ngIfDirective = inject(NgIf, { host: true });\n private readonly takeUntilDestroyed = untilDestroyed();\n\n @Input('odxAuth')\n public authorizationHandler?: AuthorizedHandler | null | string = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxAuthElse')\n public set elseTemplate(value: TemplateRef<NgIfContext<unknown>>) {\n this.ngIfDirective.ngIfElse = value;\n }\n\n public ngAfterViewInit(): void {\n this.authService.isAuthenticated$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n const handler = isString(this.authorizationHandler) ? null : this.authorizationHandler;\n this.ngIfDirective.ngIf = this.authService.isAuthorized(handler);\n });\n }\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn, Router } from '@angular/router';\nimport { map, take } from 'rxjs';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandlerWithRouter } from './models';\n\nexport function authGuard(authorizedHandler?: AuthorizedHandlerWithRouter): CanActivateFn {\n return (_, state) => {\n const authService = inject(AuthService);\n const router = inject(Router);\n const isAuthorized = () => authorizedHandler?.(authService.getIdentityClaims(), router, authService);\n\n return authService.isAuthenticated$.pipe(\n map((isAuthenticated) => {\n if (!isAuthenticated) {\n authService.signIn(state.url);\n }\n return isAuthorized() ?? isAuthenticated;\n }),\n take(1)\n );\n };\n}\n","import { APP_INITIALIZER, EnvironmentInjector, EnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, makeEnvironmentProviders } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { buildUrl, isString, ModuleConfigDependencies, ModuleConfigProvider, provideModuleConfig } from '@odx/angular/utils';\nimport { OAuthModuleConfig, OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc';\nimport { tap } from 'rxjs';\nimport { AuthModuleConfig, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, injectAuthModuleConfig } from './auth.config';\nimport { AuthService } from './auth.service';\n\nexport function configureInterceptor(): OAuthModuleConfig {\n const { allowedUrls } = injectAuthModuleConfig();\n return {\n resourceServer: {\n customUrlValidation: (url) => allowedUrls.some((allowedUrl) => (isString(allowedUrl) ? url.startsWith(allowedUrl) : !!url.match(allowedUrl))),\n sendAccessToken: true,\n },\n };\n}\n\nexport function initializeAuthErrorHandler(): void {\n const authService = inject(AuthService);\n const injector = inject(EnvironmentInjector);\n const { errorHandler } = injectAuthModuleConfig();\n\n authService.errors$.pipe(tap((error) => injector.runInContext(() => errorHandler(error)))).subscribe();\n}\n\nexport function initalizeAuthConfig(): () => Promise<void> {\n const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } = injectAuthModuleConfig();\n const authService = inject(AuthService);\n const origin = inject(WindowRef).getOrigin();\n const scope = Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes ?? []))).join(' ');\n\n return () =>\n authService.initialize({\n clientId,\n issuer: issuer ?? DEFAULT_ISSUERS[environment],\n scope,\n redirectUri: buildUrl(origin, redirectPath),\n postLogoutRedirectUri: postLogoutRedirectUrl,\n preserveRequestedRoute: true,\n strictDiscoveryDocumentValidation: !discoveryUrl,\n responseType: 'code',\n showDebugInformation: environment === 'dev',\n timeoutFactor,\n });\n}\n\nexport function provideAuth<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideModuleConfig(AuthModuleConfig, config),\n provideOAuthClient(),\n {\n provide: OAuthModuleConfig,\n useFactory: configureInterceptor,\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: initializeAuthErrorHandler,\n multi: true,\n },\n {\n provide: APP_INITIALIZER,\n useFactory: initalizeAuthConfig,\n multi: true,\n },\n {\n provide: OAuthStorage,\n useFactory: () => inject(AuthModuleConfig).storage ?? inject(WindowRef).nativeWindow.localStorage,\n },\n ]);\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ModuleConfigDependencies, ModuleConfigProvider } from '@odx/angular/utils';\nimport { AuthComponent } from './auth.component';\nimport { AuthModuleConfig } from './auth.config';\nimport { AuthDirective } from './auth.directive';\nimport { provideAuth } from './auth.providers';\nimport { SignInDirective, SignOutDirective } from './directives';\n\nconst modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];\n\n@NgModule({\n imports: [...modules],\n exports: [...modules],\n})\nexport class AuthModule {\n public static forRoot<D extends ModuleConfigDependencies>(config: ModuleConfigProvider<Partial<AuthModuleConfig>, D>): ModuleWithProviders<AuthModule> {\n return {\n ngModule: AuthModule,\n providers: [provideAuth(config)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE;AACvE,MAAA,eAAe,GAAoC;AAC9D,IAAA,GAAG,EAAE,8CAA8C;AACnD,IAAA,KAAK,EAAE,+CAA+C;AACtD,IAAA,IAAI,EAAE,0CAA0C;EAChD;AAoBK,MAAM,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE;AACjI,IAAA,WAAW,EAAE,MAAM;AACnB,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;AAC5B,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,YAAY,EAAE,CAAC,KAAK,KAAI;AACtB,QAAA,MAAM,KAAK,CAAC;KACb;AACkB,CAAA;;ACxCf,SAAU,eAAe,CAAC,KAAqB,EAAA;AACnD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE,CAAC;IACtB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,KAAI;QAC5C,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC7C,YAAA,QAAQ,GAAG,CAAA,EAAG,QAAQ,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAA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UAAU,CAAA;IACd,OAAO,OAAO,CAAqC,MAA0D,EAAA;QAClH,OAAO;AACL,YAAA,QAAQ,EAAE,UAAU;AACpB,YAAA,SAAS,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACjC,CAAC;KACH;;uGANU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAV,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EANN,OAAA,EAAA,CAAA,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAA/D,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAMnE,UAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YANN,aAAa,CAAA,EAAA,CAAA,CAAA;2FAMjB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;iBACtB,CAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-auth.mjs","sources":["../../../../libs/auth/src/lib/auth.config.ts","../../../../libs/auth/src/lib/helpers/create-inititals.ts","../../../../libs/auth/src/lib/helpers/parse-identity-claims.ts","../../../../libs/auth/src/lib/auth.service.ts","../../../../libs/auth/src/lib/directives/sign-in.directive.ts","../../../../libs/auth/src/lib/directives/sign-out.directive.ts","../../../../libs/auth/src/lib/auth.component.ts","../../../../libs/auth/src/lib/auth.component.html","../../../../libs/auth/src/lib/auth.directive.ts","../../../../libs/auth/src/lib/auth.guard.ts","../../../../libs/auth/src/lib/auth.module.ts","../../../../libs/auth/src/lib/auth.providers.ts","../../../../libs/auth/src/odx-auth.ts"],"sourcesContent":["import { createConfigTokens } from '@odx/angular/utils';\nimport { OAuthErrorEvent, OAuthStorage } from 'angular-oauth2-oidc';\n\nimport { AuthEnvironment } from './models';\n\nexport const DEFAULT_AUTH_SCOPES = ['openid', 'profile', 'email', 'offline_access'];\nexport const DEFAULT_ISSUERS: Record<AuthEnvironment, string> = {\n dev: 'https://dev.login.draeger.com/oauth2/default',\n stage: 'https://test.login.draeger.com/oauth2/default',\n prod: 'https://login.draeger.com/oauth2/default',\n};\n\nexport type AuthErrorHandlerFn = (error: OAuthErrorEvent) => void;\n\nexport interface AuthConfig {\n environment: AuthEnvironment;\n clientId?: string;\n issuer?: string;\n redirectPath: string;\n allowedUrls: Array<string | RegExp>;\n timeoutFactor: number;\n maxOfflineTime: number;\n loadUserProfile: boolean;\n postLogoutRedirectUrl?: string;\n scopes?: string[];\n discoveryUrl?: string;\n errorHandler: AuthErrorHandlerFn;\n storage?: OAuthStorage;\n}\n\nexport const { AuthDefaultConfig, AuthConfig, injectAuthConfig, provideAuthConfig } = createConfigTokens('Auth', '@odx/auth', {\n environment: 'prod',\n redirectPath: 'login/callback',\n allowedUrls: [],\n timeoutFactor: 0.75,\n maxOfflineTime: 24 * 60 * 60, // 1 day\n loadUserProfile: false,\n errorHandler: (error) => {\n throw error;\n },\n} as AuthConfig);\n","export function createInititals(value?: string | null): string {\n if (!value) return '';\n const parts = value.trim().split(' ');\n\n return parts.reduce((initials, curr, index) => {\n if (index === 0 || index === parts.length - 1) {\n initials = `${initials}${curr.charAt(0).toUpperCase()}`;\n }\n return initials;\n }, '');\n}\n","import { createInititals } from './create-inititals';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function parseIdentityClaims(identityClaims: any): OdxAuth.IdentiyClaims {\n return {\n ...identityClaims,\n email: identityClaims?.email ?? identityClaims.email_address ?? identityClaims.emails?.[0],\n initials: createInititals(identityClaims.name),\n };\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable, OnDestroy } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { WindowRef } from '@odx/angular';\nimport { AuthConfig, OAuthErrorEvent, OAuthService } from 'angular-oauth2-oidc';\nimport {\n BehaviorSubject,\n combineLatest,\n distinctUntilChanged,\n filter,\n fromEvent,\n map,\n Observable,\n share,\n shareReplay,\n startWith,\n Subscription,\n switchMap,\n tap,\n} from 'rxjs';\nimport { injectAuthConfig } from './auth.config';\nimport { parseIdentityClaims } from './helpers/parse-identity-claims';\nimport { AuthorizedHandler } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthService implements OnDestroy {\n private readonly subscription: Subscription;\n private readonly authConfig = injectAuthConfig();\n private readonly oauthService = inject(OAuthService);\n private readonly router = inject(Router);\n private readonly windowRef = inject(WindowRef);\n\n private readonly isInitialized$$ = new BehaviorSubject<boolean>(false);\n private readonly onAccessTokenUpdate$ = fromEvent<StorageEvent>(this.windowRef.nativeWindow, 'storage').pipe(\n filter(({ key }) => key === 'access_token' || key === null),\n startWith(null),\n share()\n );\n private readonly onAuthStateChange$ = combineLatest([this.oauthService.events.pipe(startWith(null)), this.windowRef.isOnline$, this.onAccessTokenUpdate$]);\n\n public readonly isAuthenticated$ = this.isInitialized$$.pipe(\n filter(Boolean),\n switchMap(() => this.onAuthStateChange$),\n map(() => this.isAuthenticated()),\n distinctUntilChanged(),\n shareReplay({ refCount: true })\n );\n public readonly identityClaims$: Observable<OdxAuth.IdentiyClaims | null> = this.isAuthenticated$.pipe(\n map(() => this.getIdentityClaims()),\n shareReplay({ refCount: true })\n );\n public readonly errors$ = this.oauthService.events.pipe(\n filter((event): event is OAuthErrorEvent => event instanceof OAuthErrorEvent),\n share()\n );\n\n constructor() {\n this.subscription = this.windowRef.isOnline$\n .pipe(\n tap((isOnline) => {\n if (isOnline) {\n this.oauthService.setupAutomaticSilentRefresh();\n } else {\n this.oauthService.stopAutomaticRefresh();\n }\n })\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n\n public async initialize(config: AuthConfig): Promise<void> {\n this.oauthService.configure(config);\n try {\n await this.oauthService.loadDiscoveryDocument(this.authConfig.discoveryUrl);\n await this.oauthService.tryLoginCodeFlow();\n if (this.getRefreshToken() && !this.isAuthenticated()) {\n await this.oauthService.refreshToken();\n }\n this.isInitialized$$.next(true);\n if (this.authConfig.loadUserProfile && this.oauthService.hasValidAccessToken()) {\n await this.loadUserProfile();\n }\n } catch (error) {\n if (error instanceof HttpErrorResponse) {\n this.isInitialized$$.next(true);\n } else if (error instanceof OAuthErrorEvent) {\n if (error.type === 'token_refresh_error') {\n this.signIn(this.windowRef.location.pathname);\n }\n this.isInitialized$$.next(true);\n } else {\n throw error;\n }\n }\n if (this.oauthService.hasValidAccessToken()) {\n await this.routeToRequestedUrl();\n }\n }\n\n public signIn(url?: string): void {\n this.oauthService.initCodeFlow(url);\n }\n\n public signOut(): void {\n this.oauthService.logOut(!this.getAccessToken());\n }\n\n public async loadUserProfile(): Promise<void> {\n await this.oauthService.loadUserProfile();\n }\n\n public getAccessToken(): string | null {\n return this.oauthService.getAccessToken() ?? null;\n }\n\n public getRefreshToken(): string | null {\n return this.oauthService.getRefreshToken() ?? null;\n }\n\n public getIdToken(): string | null {\n return this.oauthService.getIdToken() ?? null;\n }\n\n public getIdentityClaims(): OdxAuth.IdentiyClaims | null {\n return this.getIdToken() ? parseIdentityClaims(this.oauthService.getIdentityClaims()) : null;\n }\n\n public isAuthenticated(): boolean {\n if (this.windowRef.isOnline()) {\n return this.oauthService.hasValidAccessToken() && this.oauthService.hasValidIdToken();\n }\n return this.hasValidOfflineToken();\n }\n\n public isAuthorized(authorizedHandler?: AuthorizedHandler | null): boolean {\n return this.isAuthenticated() && (authorizedHandler?.(this.getIdentityClaims(), this) ?? true);\n }\n\n private async routeToRequestedUrl(): Promise<void> {\n if (this.oauthService.state) {\n await this.router.navigateByUrl(decodeURIComponent(this.oauthService.state));\n }\n }\n\n private hasValidOfflineToken(): boolean {\n const issuedAt = this.getIdentityClaims()?.iat ?? 0;\n\n return Date.now() - issuedAt * 1000 <= this.authConfig.maxOfflineTime * 1000;\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignIn]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignInDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignIn')\n public afterSignIn = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signIn();\n this.afterSignIn.emit();\n }\n}\n","import { AfterViewInit, Directive, EventEmitter, HostListener, inject, Output } from '@angular/core';\nimport { LoadingSpinnerDirective } from '@odx/angular/components/loading-spinner';\nimport { AuthService } from '../auth.service';\n\n@Directive({\n standalone: true,\n selector: '[odxButton][odxAuthSignOut]',\n hostDirectives: [LoadingSpinnerDirective],\n})\nexport class SignOutDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly loadingSpinnerDirective = inject(LoadingSpinnerDirective, { self: true });\n\n // eslint-disable-next-line @angular-eslint/no-output-rename\n @Output('odxAuthSignOut')\n public afterSignOut = new EventEmitter<void>();\n\n public ngAfterViewInit(): void {\n this.loadingSpinnerDirective.autoColor = true;\n }\n\n @HostListener('click')\n protected async signIn(): Promise<void> {\n this.loadingSpinnerDirective.isLoading = true;\n this.authService.signOut();\n this.afterSignOut.emit();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { AreaHeaderModule } from '@odx/angular/components/area-header';\nimport { DropdownModule, DropdownOptions } from '@odx/angular/components/dropdown';\nimport { HeaderModule } from '@odx/angular/components/header';\nimport { LogoDirective } from '@odx/angular/components/logo';\nimport { Position } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { SignInDirective, SignOutDirective } from './directives';\n\n@Component({\n standalone: true,\n selector: 'odx-auth',\n imports: [CoreModule, AreaHeaderModule, DropdownModule, HeaderModule, LogoDirective, SignInDirective, SignOutDirective],\n templateUrl: './auth.component.html',\n styleUrls: ['./auth.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AuthComponent {\n protected readonly authService = inject(AuthService);\n protected readonly dropdownOptions = {\n position: Position.BOTTOM_END,\n enableFallback: false,\n containerClass: 'odx-auth-user-profile',\n } as Partial<DropdownOptions>;\n\n @Input()\n public signInButtonText = 'Sign in';\n\n @Input()\n public signOutButtonText = 'Sign out';\n}\n","<odx-action-group *ngrxLet=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ } as vm\">\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton odxHeaderAvatar [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.name }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ signOutButtonText }}\n <odx-icon name=\"arrow-right\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"secondary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ signInButtonText }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n</odx-action-group>\n","import { NgIf, NgIfContext } from '@angular/common';\nimport { AfterViewInit, Directive, inject, Input, TemplateRef } from '@angular/core';\nimport { isString, untilDestroyed } from '@odx/angular/utils';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandler } from './models';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[odxAuth]',\n hostDirectives: [NgIf],\n})\nexport class AuthDirective implements AfterViewInit {\n private readonly authService = inject(AuthService);\n private readonly ngIfDirective = inject(NgIf, { host: true });\n private readonly takeUntilDestroyed = untilDestroyed();\n\n @Input('odxAuth')\n public authorizationHandler?: AuthorizedHandler | null | string = null;\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxAuthElse')\n public set elseTemplate(value: TemplateRef<NgIfContext<unknown>>) {\n this.ngIfDirective.ngIfElse = value;\n }\n\n public ngAfterViewInit(): void {\n this.authService.isAuthenticated$.pipe(this.takeUntilDestroyed()).subscribe(() => {\n const handler = isString(this.authorizationHandler) ? null : this.authorizationHandler;\n this.ngIfDirective.ngIf = this.authService.isAuthorized(handler);\n });\n }\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn, Router } from '@angular/router';\nimport { map, take } from 'rxjs';\nimport { AuthService } from './auth.service';\nimport { AuthorizedHandlerWithRouter } from './models';\n\nexport function authGuard(authorizedHandler?: AuthorizedHandlerWithRouter): CanActivateFn {\n return (_, state) => {\n const authService = inject(AuthService);\n const router = inject(Router);\n const isAuthorized = () => authorizedHandler?.(authService.getIdentityClaims(), router, authService);\n\n return authService.isAuthenticated$.pipe(\n map((isAuthenticated) => {\n if (!isAuthenticated) {\n authService.signIn(state.url);\n }\n return isAuthorized() ?? isAuthenticated;\n }),\n take(1)\n );\n };\n}\n","import { NgModule } from '@angular/core';\nimport { AuthComponent } from './auth.component';\nimport { AuthDirective } from './auth.directive';\nimport { SignInDirective, SignOutDirective } from './directives';\n\nconst modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];\n\n@NgModule({\n imports: [...modules],\n exports: [...modules],\n})\nexport class AuthModule {}\n","import { APP_INITIALIZER, EnvironmentInjector, EnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, makeEnvironmentProviders } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { buildUrl, ConfigDependencies, ConfigProvider, isString } from '@odx/angular/utils';\nimport { OAuthModuleConfig, OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc';\nimport { tap } from 'rxjs';\nimport { AuthConfig, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, injectAuthConfig, provideAuthConfig } from './auth.config';\nimport { AuthService } from './auth.service';\n\nexport function configureInterceptor(): OAuthModuleConfig {\n const { allowedUrls } = injectAuthConfig();\n return {\n resourceServer: {\n customUrlValidation: (url) => allowedUrls.some((allowedUrl) => (isString(allowedUrl) ? url.startsWith(allowedUrl) : !!url.match(allowedUrl))),\n sendAccessToken: true,\n },\n };\n}\n\nexport function initializeAuthErrorHandler(): void {\n const authService = inject(AuthService);\n const injector = inject(EnvironmentInjector);\n const { errorHandler } = injectAuthConfig();\n\n authService.errors$.pipe(tap((error) => injector.runInContext(() => errorHandler(error)))).subscribe();\n}\n\nexport function initalizeAuthConfig(): () => Promise<void> {\n const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } = injectAuthConfig();\n const authService = inject(AuthService);\n const origin = inject(WindowRef).getOrigin();\n const scope = Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes ?? []))).join(' ');\n\n return () =>\n authService.initialize({\n clientId,\n issuer: issuer ?? DEFAULT_ISSUERS[environment],\n scope,\n redirectUri: buildUrl(origin, redirectPath),\n postLogoutRedirectUri: postLogoutRedirectUrl,\n preserveRequestedRoute: true,\n strictDiscoveryDocumentValidation: !discoveryUrl,\n responseType: 'code',\n showDebugInformation: environment === 'dev',\n timeoutFactor,\n });\n}\n\nexport function provideAuth<D extends ConfigDependencies>(config: ConfigProvider<Partial<AuthConfig>, D>): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideAuthConfig(config),\n provideOAuthClient(),\n {\n provide: OAuthModuleConfig,\n useFactory: configureInterceptor,\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: initializeAuthErrorHandler,\n multi: true,\n },\n {\n provide: APP_INITIALIZER,\n useFactory: initalizeAuthConfig,\n multi: true,\n },\n {\n provide: OAuthStorage,\n useFactory: () => inject(AuthConfig).storage ?? inject(WindowRef).nativeWindow.localStorage,\n },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE;AACvE,MAAA,eAAe,GAAoC;AAC9D,IAAA,GAAG,EAAE,8CAA8C;AACnD,IAAA,KAAK,EAAE,+CAA+C;AACtD,IAAA,IAAI,EAAE,0CAA0C;EAChD;AAoBW,MAAA,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,iB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