@indigina/ui-kit 1.1.606 → 1.1.607
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.
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { AuthService, authHttpInterceptorFn, provideAuth0 } from '@auth0/auth0-angular';
|
|
4
|
+
import { EMPTY } from 'rxjs';
|
|
5
|
+
import { filter, take, switchMap } from 'rxjs/operators';
|
|
6
|
+
import { withInterceptors } from '@angular/common/http';
|
|
7
|
+
|
|
8
|
+
class KitAuthService {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.auth0 = inject(AuthService);
|
|
11
|
+
this.loggingIn = false;
|
|
12
|
+
this.loggingOut = false;
|
|
13
|
+
}
|
|
14
|
+
isAuthenticated$() {
|
|
15
|
+
return this.auth0.isLoading$.pipe(filter((loading) => !loading), take(1), switchMap(() => this.auth0.isAuthenticated$));
|
|
16
|
+
}
|
|
17
|
+
getAccessToken$() {
|
|
18
|
+
if (this.loggingOut) {
|
|
19
|
+
return EMPTY;
|
|
20
|
+
}
|
|
21
|
+
return this.auth0.getAccessTokenSilently();
|
|
22
|
+
}
|
|
23
|
+
isLoggingOut() {
|
|
24
|
+
return this.loggingOut;
|
|
25
|
+
}
|
|
26
|
+
login(targetPath) {
|
|
27
|
+
if (this.loggingIn || this.loggingOut) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const target = targetPath ?? `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
31
|
+
this.loggingIn = true;
|
|
32
|
+
this.auth0.loginWithRedirect({ appState: { target } }).subscribe({
|
|
33
|
+
error: () => {
|
|
34
|
+
this.loggingIn = false;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
logout() {
|
|
39
|
+
this.loggingOut = true;
|
|
40
|
+
this.auth0
|
|
41
|
+
.logout({
|
|
42
|
+
logoutParams: {
|
|
43
|
+
returnTo: window.location.origin,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
.subscribe({
|
|
47
|
+
error: () => {
|
|
48
|
+
this.loggingOut = false;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
53
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitAuthService }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: KitAuthService, decorators: [{
|
|
56
|
+
type: Injectable
|
|
57
|
+
}] });
|
|
58
|
+
|
|
59
|
+
const kitAuthHttpInterceptor = (request, next) => {
|
|
60
|
+
if (request.headers.has('Authorization')) {
|
|
61
|
+
return next(request);
|
|
62
|
+
}
|
|
63
|
+
const session = inject(KitAuthService, {
|
|
64
|
+
optional: true,
|
|
65
|
+
});
|
|
66
|
+
if (session?.isLoggingOut()) {
|
|
67
|
+
return EMPTY;
|
|
68
|
+
}
|
|
69
|
+
return authHttpInterceptorFn(request, next);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const DEFAULT_CACHE_LOCATION = 'localstorage';
|
|
73
|
+
const stripTrailingSlashes = (value) => {
|
|
74
|
+
let end = value.length;
|
|
75
|
+
while (end > 0 && value[end - 1] === '/') {
|
|
76
|
+
end -= 1;
|
|
77
|
+
}
|
|
78
|
+
return value.slice(0, end);
|
|
79
|
+
};
|
|
80
|
+
const isValidApiBaseUrl = (value, parsed) => /^https?:\/\/[^/]/i.test(value) &&
|
|
81
|
+
!!parsed.hostname &&
|
|
82
|
+
!value.includes('*') &&
|
|
83
|
+
!value.includes('\\') &&
|
|
84
|
+
!/\s/.test(value) &&
|
|
85
|
+
!parsed.username &&
|
|
86
|
+
!parsed.password &&
|
|
87
|
+
!value.includes('?') &&
|
|
88
|
+
!value.includes('#');
|
|
89
|
+
const buildAllowedList = (apiUrls) => {
|
|
90
|
+
if (apiUrls.length === 0) {
|
|
91
|
+
throw new Error('Auth0 API allowlist must contain at least one URL');
|
|
92
|
+
}
|
|
93
|
+
return apiUrls.flatMap((apiUrl) => {
|
|
94
|
+
const normalized = apiUrl.trim();
|
|
95
|
+
if (!normalized) {
|
|
96
|
+
throw new Error('Auth0 API allowlist contains an empty URL');
|
|
97
|
+
}
|
|
98
|
+
let parsed;
|
|
99
|
+
try {
|
|
100
|
+
parsed = new URL(normalized);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
throw new Error('Auth0 API allowlist must contain absolute HTTP(S) URLs without wildcards, credentials, queries, or fragments');
|
|
104
|
+
}
|
|
105
|
+
if (!isValidApiBaseUrl(normalized, parsed)) {
|
|
106
|
+
throw new Error('Auth0 API allowlist must contain absolute HTTP(S) URLs without wildcards, credentials, queries, or fragments');
|
|
107
|
+
}
|
|
108
|
+
const baseUrl = stripTrailingSlashes(parsed.href);
|
|
109
|
+
return [
|
|
110
|
+
baseUrl,
|
|
111
|
+
`${baseUrl}/*`,
|
|
112
|
+
];
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
const buildAuthorizationParams = (settings) => {
|
|
116
|
+
const authorizationParams = {
|
|
117
|
+
redirect_uri: window.location.origin,
|
|
118
|
+
audience: settings.audience,
|
|
119
|
+
scope: 'openid profile email offline_access',
|
|
120
|
+
};
|
|
121
|
+
if (settings.connection) {
|
|
122
|
+
authorizationParams.connection = settings.connection;
|
|
123
|
+
}
|
|
124
|
+
return authorizationParams;
|
|
125
|
+
};
|
|
126
|
+
const withKitAuthHttpInterceptor = () => withInterceptors([kitAuthHttpInterceptor]);
|
|
127
|
+
const provideKitAuth0 = (settings, options) => {
|
|
128
|
+
const normalizedSettings = {
|
|
129
|
+
domain: settings.domain?.trim(),
|
|
130
|
+
clientId: settings.clientId?.trim(),
|
|
131
|
+
audience: settings.audience?.trim(),
|
|
132
|
+
connection: settings.connection?.trim() || undefined,
|
|
133
|
+
};
|
|
134
|
+
if (!normalizedSettings.domain || !normalizedSettings.clientId || !normalizedSettings.audience) {
|
|
135
|
+
throw new Error('Auth0 settings are incomplete: domain, clientId, and audience are required');
|
|
136
|
+
}
|
|
137
|
+
return makeEnvironmentProviders([
|
|
138
|
+
provideAuth0({
|
|
139
|
+
domain: normalizedSettings.domain,
|
|
140
|
+
clientId: normalizedSettings.clientId,
|
|
141
|
+
cacheLocation: options.cacheLocation ?? DEFAULT_CACHE_LOCATION,
|
|
142
|
+
useRefreshTokens: true,
|
|
143
|
+
useRefreshTokensFallback: false,
|
|
144
|
+
authorizationParams: buildAuthorizationParams(normalizedSettings),
|
|
145
|
+
httpInterceptor: {
|
|
146
|
+
allowedList: buildAllowedList(options.allowedApiUrls),
|
|
147
|
+
},
|
|
148
|
+
}),
|
|
149
|
+
KitAuthService,
|
|
150
|
+
]);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Generated bundle index. Do not edit.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
export { KitAuthService, kitAuthHttpInterceptor, provideKitAuth0, withKitAuthHttpInterceptor };
|
|
158
|
+
//# sourceMappingURL=indigina-ui-kit-auth0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indigina-ui-kit-auth0.mjs","sources":["../../../projects/ui-kit/auth0/src/lib/services/kit-auth.service.ts","../../../projects/ui-kit/auth0/src/lib/services/kit-auth-http.interceptor.ts","../../../projects/ui-kit/auth0/src/lib/services/provide-kit-auth.ts","../../../projects/ui-kit/auth0/indigina-ui-kit-auth0.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AuthService } from '@auth0/auth0-angular';\nimport { EMPTY, Observable } from 'rxjs';\nimport { filter, switchMap, take } from 'rxjs/operators';\n\n@Injectable()\nexport class KitAuthService {\n private readonly auth0: AuthService = inject(AuthService);\n private loggingIn: boolean = false;\n private loggingOut: boolean = false;\n\n isAuthenticated$(): Observable<boolean> {\n return this.auth0.isLoading$.pipe(\n filter((loading: boolean) => !loading),\n take(1),\n switchMap(() => this.auth0.isAuthenticated$),\n );\n }\n\n getAccessToken$(): Observable<string> {\n if (this.loggingOut) {\n return EMPTY;\n }\n\n return this.auth0.getAccessTokenSilently();\n }\n\n isLoggingOut(): boolean {\n return this.loggingOut;\n }\n\n login(targetPath?: string): void {\n if (this.loggingIn || this.loggingOut) {\n return;\n }\n\n const target: string = targetPath ?? `${window.location.pathname}${window.location.search}${window.location.hash}`;\n this.loggingIn = true;\n this.auth0.loginWithRedirect({ appState: { target } }).subscribe({\n error: () => {\n this.loggingIn = false;\n },\n });\n }\n\n logout(): void {\n this.loggingOut = true;\n this.auth0\n .logout({\n logoutParams: {\n returnTo: window.location.origin,\n },\n })\n .subscribe({\n error: () => {\n this.loggingOut = false;\n },\n });\n }\n}\n","import { HttpInterceptorFn } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { authHttpInterceptorFn } from '@auth0/auth0-angular';\nimport { EMPTY } from 'rxjs';\nimport { KitAuthService } from './kit-auth.service';\n\nexport const kitAuthHttpInterceptor: HttpInterceptorFn = (request, next) => {\n if (request.headers.has('Authorization')) {\n return next(request);\n }\n\n const session: KitAuthService | null = inject(KitAuthService, {\n optional: true,\n });\n if (session?.isLoggingOut()) {\n return EMPTY;\n }\n\n return authHttpInterceptorFn(request, next);\n};\n","import { HttpFeature, HttpFeatureKind, withInterceptors } from '@angular/common/http';\nimport {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { AuthorizationParams, provideAuth0 } from '@auth0/auth0-angular';\nimport {\n KitAuth0CacheLocation,\n KitAuth0Options,\n KitAuth0Settings,\n} from '../models/kit-auth0-settings.model';\nimport { kitAuthHttpInterceptor } from './kit-auth-http.interceptor';\nimport { KitAuthService } from './kit-auth.service';\n\nconst DEFAULT_CACHE_LOCATION: KitAuth0CacheLocation = 'localstorage';\n\nconst stripTrailingSlashes = (value: string): string => {\n let end: number = value.length;\n while (end > 0 && value[end - 1] === '/') {\n end -= 1;\n }\n\n return value.slice(0, end);\n};\n\nconst isValidApiBaseUrl = (value: string, parsed: URL): boolean =>\n /^https?:\\/\\/[^/]/i.test(value) &&\n !!parsed.hostname &&\n !value.includes('*') &&\n !value.includes('\\\\') &&\n !/\\s/.test(value) &&\n !parsed.username &&\n !parsed.password &&\n !value.includes('?') &&\n !value.includes('#');\n\nconst buildAllowedList = (apiUrls: readonly string[]): string[] => {\n if (apiUrls.length === 0) {\n throw new Error('Auth0 API allowlist must contain at least one URL');\n }\n\n return apiUrls.flatMap((apiUrl) => {\n const normalized: string = apiUrl.trim();\n if (!normalized) {\n throw new Error('Auth0 API allowlist contains an empty URL');\n }\n\n let parsed: URL;\n try {\n parsed = new URL(normalized);\n } catch {\n throw new Error('Auth0 API allowlist must contain absolute HTTP(S) URLs without wildcards, credentials, queries, or fragments');\n }\n\n if (!isValidApiBaseUrl(normalized, parsed)) {\n throw new Error('Auth0 API allowlist must contain absolute HTTP(S) URLs without wildcards, credentials, queries, or fragments');\n }\n\n const baseUrl: string = stripTrailingSlashes(parsed.href);\n\n return [\n baseUrl,\n `${baseUrl}/*`,\n ];\n });\n};\n\nconst buildAuthorizationParams = (\n settings: KitAuth0Settings,\n): AuthorizationParams => {\n const authorizationParams: AuthorizationParams = {\n redirect_uri: window.location.origin,\n audience: settings.audience,\n scope: 'openid profile email offline_access',\n };\n if (settings.connection) {\n authorizationParams.connection = settings.connection;\n }\n\n return authorizationParams;\n};\n\nexport const withKitAuthHttpInterceptor = (): HttpFeature<HttpFeatureKind.Interceptors> =>\n withInterceptors([kitAuthHttpInterceptor]);\n\nexport const provideKitAuth0 = (\n settings: KitAuth0Settings,\n options: KitAuth0Options,\n): EnvironmentProviders => {\n const normalizedSettings: KitAuth0Settings = {\n domain: settings.domain?.trim(),\n clientId: settings.clientId?.trim(),\n audience: settings.audience?.trim(),\n connection: settings.connection?.trim() || undefined,\n };\n if (!normalizedSettings.domain || !normalizedSettings.clientId || !normalizedSettings.audience) {\n throw new Error(\n 'Auth0 settings are incomplete: domain, clientId, and audience are required',\n );\n }\n\n return makeEnvironmentProviders([\n provideAuth0({\n domain: normalizedSettings.domain,\n clientId: normalizedSettings.clientId,\n cacheLocation: options.cacheLocation ?? DEFAULT_CACHE_LOCATION,\n useRefreshTokens: true,\n useRefreshTokensFallback: false,\n authorizationParams: buildAuthorizationParams(normalizedSettings),\n httpInterceptor: {\n allowedList: buildAllowedList(options.allowedApiUrls),\n },\n }),\n KitAuthService,\n ]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAMa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,KAAK,GAAgB,MAAM,CAAC,WAAW,CAAC;QACjD,IAAA,CAAA,SAAS,GAAY,KAAK;QAC1B,IAAA,CAAA,UAAU,GAAY,KAAK;AAkDpC,IAAA;IAhDC,gBAAgB,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAC/B,MAAM,CAAC,CAAC,OAAgB,KAAK,CAAC,OAAO,CAAC,EACtC,IAAI,CAAC,CAAC,CAAC,EACP,SAAS,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC7C;IACH;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACnB,YAAA,OAAO,KAAK;QACd;AAEA,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE;IAC5C;IAEA,YAAY,GAAA;QACV,OAAO,IAAI,CAAC,UAAU;IACxB;AAEA,IAAA,KAAK,CAAC,UAAmB,EAAA;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AACnC,QAAA,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE;QACnC,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,SAAS;KACrD;AACD,IAAA,IAAI,CAAC,kBAAkB,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;AAC9F,QAAA,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E;IACH;AAEA,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,YAAY,CAAC;YACX,MAAM,EAAE,kBAAkB,CAAC,MAAM;YACjC,QAAQ,EAAE,kBAAkB,CAAC,QAAQ;AACrC,YAAA,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,sBAAsB;AAC9D,YAAA,gBAAgB,EAAE,IAAI;AACtB,YAAA,wBAAwB,EAAE,KAAK;AAC/B,YAAA,mBAAmB,EAAE,wBAAwB,CAAC,kBAAkB,CAAC;AACjE,YAAA,eAAe,EAAE;AACf,gBAAA,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC;AACtD,aAAA;SACF,CAAC;QACF,cAAc;AACf,KAAA,CAAC;AACJ;;ACnHA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -7,14 +7,24 @@
|
|
|
7
7
|
"components",
|
|
8
8
|
"shared"
|
|
9
9
|
],
|
|
10
|
-
"version": "1.1.
|
|
10
|
+
"version": "1.1.607",
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@angular/common": ">=22.0.0 <23.0.0",
|
|
13
13
|
"@angular/core": ">=22.0.0 <23.0.0",
|
|
14
|
+
"@angular/router": ">=22.0.0 <23.0.0",
|
|
14
15
|
"ngx-device-detector": "^12.0.0",
|
|
15
16
|
"autoprefixer": "^10.4.27",
|
|
16
17
|
"initials": "^3.1.2",
|
|
17
|
-
"json-2-csv": "^5.5.10"
|
|
18
|
+
"json-2-csv": "^5.5.10",
|
|
19
|
+
"@auth0/auth0-angular": "^2.11.0"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"@angular/router": {
|
|
23
|
+
"optional": true
|
|
24
|
+
},
|
|
25
|
+
"@auth0/auth0-angular": {
|
|
26
|
+
"optional": true
|
|
27
|
+
}
|
|
18
28
|
},
|
|
19
29
|
"dependencies": {
|
|
20
30
|
"@progress/kendo-angular-buttons": "24.2.2",
|
|
@@ -62,6 +72,10 @@
|
|
|
62
72
|
".": {
|
|
63
73
|
"types": "./types/indigina-ui-kit.d.ts",
|
|
64
74
|
"default": "./fesm2022/indigina-ui-kit.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./auth0": {
|
|
77
|
+
"types": "./types/indigina-ui-kit-auth0.d.ts",
|
|
78
|
+
"default": "./fesm2022/indigina-ui-kit-auth0.mjs"
|
|
65
79
|
}
|
|
66
80
|
},
|
|
67
81
|
"sideEffects": false,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
4
|
+
import { HttpFeature, HttpFeatureKind, HttpInterceptorFn } from '@angular/common/http';
|
|
5
|
+
|
|
6
|
+
interface KitAuth0Settings {
|
|
7
|
+
domain: string;
|
|
8
|
+
clientId: string;
|
|
9
|
+
audience: string;
|
|
10
|
+
connection?: string;
|
|
11
|
+
}
|
|
12
|
+
type KitAuth0CacheLocation = 'memory' | 'localstorage';
|
|
13
|
+
interface KitAuth0Options {
|
|
14
|
+
allowedApiUrls: readonly string[];
|
|
15
|
+
cacheLocation?: KitAuth0CacheLocation;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare class KitAuthService {
|
|
19
|
+
private readonly auth0;
|
|
20
|
+
private loggingIn;
|
|
21
|
+
private loggingOut;
|
|
22
|
+
isAuthenticated$(): Observable<boolean>;
|
|
23
|
+
getAccessToken$(): Observable<string>;
|
|
24
|
+
isLoggingOut(): boolean;
|
|
25
|
+
login(targetPath?: string): void;
|
|
26
|
+
logout(): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KitAuthService, never>;
|
|
28
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KitAuthService>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const withKitAuthHttpInterceptor: () => HttpFeature<HttpFeatureKind.Interceptors>;
|
|
32
|
+
declare const provideKitAuth0: (settings: KitAuth0Settings, options: KitAuth0Options) => EnvironmentProviders;
|
|
33
|
+
|
|
34
|
+
declare const kitAuthHttpInterceptor: HttpInterceptorFn;
|
|
35
|
+
|
|
36
|
+
export { KitAuthService, kitAuthHttpInterceptor, provideKitAuth0, withKitAuthHttpInterceptor };
|
|
37
|
+
export type { KitAuth0CacheLocation, KitAuth0Options, KitAuth0Settings };
|