@sd-angular/core 19.0.35 → 19.0.36
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/components/query-builder/src/query-builder.model.d.ts +1 -1
- package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +1 -1
- package/fesm2022/sd-angular-core-components-form-generic.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-query-bar.mjs +8 -8
- package/fesm2022/sd-angular-core-components-query-bar.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-query-builder.mjs +2 -2
- package/fesm2022/sd-angular-core-components-query-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +10 -10
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-inline-text.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-inline-text.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-color.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input-color.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-auth.mjs +35 -3
- package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-authom.mjs +847 -241
- package/fesm2022/sd-angular-core-modules-authom.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs +2 -2
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-cache.mjs +1 -1
- package/fesm2022/sd-angular-core-services-cache.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-storage.mjs.map +1 -1
- package/modules/authom/authom.auth-configuration.d.ts +18 -0
- package/modules/authom/authom.configuration.d.ts +158 -2
- package/modules/authom/authom.event.d.ts +44 -0
- package/modules/authom/authom.guard.d.ts +13 -0
- package/modules/authom/authom.interceptor.d.ts +7 -1
- package/modules/authom/authom.module.d.ts +35 -5
- package/modules/authom/authom.return-url.d.ts +37 -0
- package/modules/authom/authom.service.d.ts +109 -15
- package/modules/authom/authom.session-channel.d.ts +26 -0
- package/modules/authom/index.d.ts +19 -9
- package/package.json +9 -3
- package/utilities/extensions/src/string.extension.d.ts +6 -2
- package/utilities/models/src/maybe-async.model.d.ts +1 -1
|
@@ -1,16 +1,46 @@
|
|
|
1
|
-
import { ModuleWithProviders, Type
|
|
1
|
+
import { EnvironmentProviders, ModuleWithProviders, Type } from '@angular/core';
|
|
2
2
|
import { ISdAuthOmConfiguration } from './authom.configuration';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
interface
|
|
4
|
+
export interface SdAuthOmProvideOptions {
|
|
5
5
|
useClass?: Type<ISdAuthOmConfiguration>;
|
|
6
6
|
useFactory?: (...args: any[]) => ISdAuthOmConfiguration;
|
|
7
7
|
deps?: any[];
|
|
8
|
+
/**
|
|
9
|
+
* Cấp luôn `SD_AUTH_CONFIGURATION` bằng `SdAuthOmAuthConfiguration`. Mặc định `true`.
|
|
10
|
+
*
|
|
11
|
+
* Nhờ vậy `SdAuthGuard`, `SdPortalGuard` và `SdAuthService.signout()` chạy được trên AuthOM mà
|
|
12
|
+
* app không phải khai báo gì thêm. Đặt `false` khi app tự bind token này (ví dụ portal chạy
|
|
13
|
+
* song song nhiều provider và tự chọn theo môi trường).
|
|
14
|
+
*/
|
|
15
|
+
withAuthConfiguration?: boolean;
|
|
8
16
|
}
|
|
9
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Đăng ký AuthOM cho app standalone (gọi trong `app.config.ts`).
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* export const appConfig: ApplicationConfig = {
|
|
22
|
+
* providers: [
|
|
23
|
+
* provideHttpClient(withInterceptors([SdAuthOmInterceptor])),
|
|
24
|
+
* provideSdAuthOm({
|
|
25
|
+
* useFactory: () => ({
|
|
26
|
+
* loadTenantConfig: () => Promise.resolve({
|
|
27
|
+
* issuer: 'https://api-qc.onemount.dev/auth-om/iam/v1/mag-qc/',
|
|
28
|
+
* clientId: 'YOUR_CLIENT_ID',
|
|
29
|
+
* redirectUri: `${location.origin}/callback`,
|
|
30
|
+
* audience: 'http://api-qc.int.onemount.dev/auth-om/api/v1/mag-qc',
|
|
31
|
+
* secureRoutes: ['https://api-qc.onemount.dev'],
|
|
32
|
+
* }),
|
|
33
|
+
* }),
|
|
34
|
+
* }),
|
|
35
|
+
* ],
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function provideSdAuthOm(options: SdAuthOmProvideOptions): EnvironmentProviders;
|
|
40
|
+
/** Đăng ký AuthOM cho kiến trúc `NgModule` cũ. */
|
|
10
41
|
export declare class SdAuthOmModule {
|
|
11
|
-
static forRoot(options:
|
|
42
|
+
static forRoot(options: SdAuthOmProvideOptions): ModuleWithProviders<SdAuthOmModule>;
|
|
12
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAuthOmModule, never>;
|
|
13
44
|
static ɵmod: i0.ɵɵNgModuleDeclaration<SdAuthOmModule, never, never, never>;
|
|
14
45
|
static ɵinj: i0.ɵɵInjectorDeclaration<SdAuthOmModule>;
|
|
15
46
|
}
|
|
16
|
-
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Giữ deep link sống sót qua vòng redirect đăng nhập.
|
|
3
|
+
*
|
|
4
|
+
* AuthOM chỉ chấp nhận một `redirect_uri` đã đăng ký (các portal hiện dùng `/callback`), nên một
|
|
5
|
+
* user mở thẳng link sâu mà chưa có token sẽ mất đích đến: guard gọi code flow, cookie SSO của
|
|
6
|
+
* AuthOM trả lời ngay không cần hỏi, và trình duyệt quay về `/callback` rồi bị route mặc định đẩy
|
|
7
|
+
* sang trang chủ.
|
|
8
|
+
*
|
|
9
|
+
* Đích đến đi kèm tham số OIDC `state` (IdP round-trip nguyên vẹn) chứ không nằm trong storage:
|
|
10
|
+
* như vậy nó gắn với đúng một lần đăng nhập, không thể cũ đi và không rò sang điều hướng khác.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Mã hoá trang mà user thực sự muốn vào, để gửi kèm `initCodeFlow`.
|
|
14
|
+
*
|
|
15
|
+
* Trả về `undefined` khi không có gì đáng khôi phục — lúc đó caller khởi động đăng nhập bình thường.
|
|
16
|
+
*
|
|
17
|
+
* Giá trị trả về là chuỗi THÔ, cố ý không percent-encode: client OIDC đã tự
|
|
18
|
+
* `encodeURIComponent(additionalState)` trước khi ghép vào `state`, và chuỗi giải mã của nó chỉ bóc
|
|
19
|
+
* đúng một lớp. Encode thêm ở đây làm giá trị quay về dạng double-encoded (`%252F...`) và
|
|
20
|
+
* `resolveReturnUrl` sẽ loại bỏ nó.
|
|
21
|
+
*/
|
|
22
|
+
export declare function captureReturnUrl(requestedUrl: string | undefined | null, callbackPath?: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Đọc lại giá trị mà `captureReturnUrl` đã gửi đi; trả `null` khi `state` rỗng hoặc không khôi phục được.
|
|
25
|
+
*
|
|
26
|
+
* Một lần `decodeURIComponent` để bóc lớp mã hoá mà client OIDC áp lên phần state của app; lớp ngoài
|
|
27
|
+
* bọc cả tham số đã được chính nó gỡ trước khi giá trị tới đây. Chuỗi không mã hoá sẽ giải mã ra
|
|
28
|
+
* chính nó, nên hàm vẫn đúng trong cả hai trường hợp.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveReturnUrl(state: string | undefined | null, callbackPath?: string): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* `state` đi vòng qua IdP nên kẻ tấn công có thể tác động; chỉ chấp nhận path nằm trong chính app này.
|
|
33
|
+
*
|
|
34
|
+
* URL tuyệt đối hoặc protocol-relative (`//evil.example`, hoặc `/\evil.example` — trình duyệt tự
|
|
35
|
+
* chuẩn hoá dấu gạch ngược) sẽ biến vòng đăng nhập thành open redirect.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isRestorableAppUrl(url: string, callbackPath?: string): boolean;
|
|
@@ -1,32 +1,126 @@
|
|
|
1
|
+
import { AuthConfig } from 'angular-oauth2-oidc';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import type { SdAuthInfo } from '@sd-angular/core/modules/auth';
|
|
4
|
+
import type { SdLayoutUserInfo } from '@sd-angular/core/modules/layout';
|
|
1
5
|
import { SdAuthOmTenantConfig } from './authom.configuration';
|
|
6
|
+
import { SdAuthOmEvent } from './authom.event';
|
|
2
7
|
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Client xác thực AuthOM: Authorization Code + PKCE trên discovery document của IdP.
|
|
10
|
+
*
|
|
11
|
+
* Service sở hữu toàn bộ vòng đời phiên — bootstrap, khôi phục deep link, gia hạn token chủ động,
|
|
12
|
+
* phát hiện hết phiên, đăng xuất xuyên tab — nên app chỉ cần khai báo cấu hình tenant.
|
|
13
|
+
*/
|
|
3
14
|
export declare class SdAuthOmService {
|
|
4
|
-
private
|
|
5
|
-
|
|
15
|
+
#private;
|
|
16
|
+
/** Cấu hình tenant đang dùng. `undefined` cho tới khi `init()` chạy xong. */
|
|
17
|
+
config?: SdAuthOmTenantConfig;
|
|
6
18
|
readonly accessToken: import("@angular/core").WritableSignal<string | null>;
|
|
7
19
|
readonly idTokenClaims: import("@angular/core").WritableSignal<Record<string, unknown> | null>;
|
|
8
20
|
readonly isAuthenticated: import("@angular/core").Signal<boolean>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
/** `true` khi gia hạn đã thất bại VÀ access token cuối cùng cũng đã hết hạn. */
|
|
22
|
+
readonly sessionExpired: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
+
/** Sự kiện `auth_error` gần nhất, hoặc `null` khi lần đăng nhập gần nhất sạch. */
|
|
24
|
+
readonly lastAuthError: import("@angular/core").WritableSignal<SdAuthOmEvent | null>;
|
|
25
|
+
/** Luồng sự kiện xác thực. Xem `SdAuthOmEventType`. */
|
|
26
|
+
readonly events$: Observable<SdAuthOmEvent>;
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Cấu hình client, tải discovery document, xử lý callback nếu có, rồi bật gia hạn chủ động.
|
|
30
|
+
*
|
|
31
|
+
* Chạy trong APP_INITIALIZER (xem `provideSdAuthOm`), tức trước điều hướng đầu tiên của Router —
|
|
32
|
+
* nhờ vậy guard của route đầu tiên đã thấy trạng thái phiên đúng.
|
|
33
|
+
*
|
|
34
|
+
* @returns `true` khi kết thúc với một access token hợp lệ.
|
|
35
|
+
*/
|
|
36
|
+
init(config: SdAuthOmTenantConfig): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Quy đổi cấu hình tenant sang `AuthConfig` của client OIDC.
|
|
39
|
+
*
|
|
40
|
+
* Public để app kiểm tra được cấu hình thực tế trong test mà không phải chạy cả `init()`.
|
|
41
|
+
*/
|
|
42
|
+
buildAuthConfig(config: SdAuthOmTenantConfig): AuthConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Khởi động Authorization Code flow.
|
|
45
|
+
*
|
|
46
|
+
* `returnTo` mặc định là URL hiện tại, đi kèm tham số OIDC `state` để deep link sống sót qua
|
|
47
|
+
* vòng redirect (xem `authom.return-url.ts`).
|
|
48
|
+
*/
|
|
19
49
|
login(options?: {
|
|
20
50
|
returnTo?: string;
|
|
51
|
+
prompt?: 'login' | 'none' | 'consent';
|
|
21
52
|
}): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Kết thúc phiên cục bộ rồi (mặc định) bắt đăng nhập lại với `prompt=login`.
|
|
55
|
+
*
|
|
56
|
+
* AuthOM không công bố `end_session_endpoint` và không hỗ trợ thu hồi token, nên đăng xuất
|
|
57
|
+
* KHÔNG gọi endpoint nào của IdP trừ khi `endSessionOnLogout` được bật rõ ràng.
|
|
58
|
+
*/
|
|
22
59
|
logout(options?: {
|
|
23
60
|
returnTo?: string;
|
|
61
|
+
prompt?: 'login' | 'none' | false;
|
|
24
62
|
}): void;
|
|
25
|
-
|
|
26
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Gia hạn access token ngay lập tức.
|
|
65
|
+
*
|
|
66
|
+
* Dùng refresh_token grant khi IdP đã phát hành refresh token, ngược lại rơi về silent refresh
|
|
67
|
+
* bằng iframe ẩn. Các lời gọi chồng nhau dùng chung một request đang bay.
|
|
68
|
+
*
|
|
69
|
+
* @returns `true` khi kết thúc với access token hợp lệ.
|
|
70
|
+
*/
|
|
71
|
+
refresh(): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Tên cũ của `refresh()`, giữ để tương thích ngược.
|
|
74
|
+
*
|
|
75
|
+
* @deprecated Dùng `refresh()`.
|
|
76
|
+
*/
|
|
27
77
|
silentRefresh(): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Ghi nhận một `401` từ route đã được bảo vệ.
|
|
80
|
+
*
|
|
81
|
+
* Đây là tín hiệu hết phiên đáng tin nhất: một lần refresh hỏng vẫn có thể xảy ra khi token cũ
|
|
82
|
+
* còn hạn, nhưng `401` nghĩa là resource server đã từ chối đúng token đang dùng.
|
|
83
|
+
*
|
|
84
|
+
* - Token đã hết hạn ⇒ phiên chết, phát `session_expired` (và đăng nhập lại nếu cấu hình cho phép).
|
|
85
|
+
* - Token vẫn còn hạn ⇒ server từ chối vì lý do khác (sai `audience`, client bị thu hồi...);
|
|
86
|
+
* phát `auth_error` với `reason = 'unauthorized'` để app tự hiển thị thông báo.
|
|
87
|
+
*
|
|
88
|
+
* `SdAuthOmInterceptor` gọi sẵn; chỉ cần gọi tay khi app dùng HTTP client riêng.
|
|
89
|
+
*/
|
|
90
|
+
handleUnauthorized(): void;
|
|
91
|
+
/** `true` khi có thể thử gia hạn mà không cần user tương tác. */
|
|
92
|
+
canRefresh(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Xử lý callback `?code=` thủ công.
|
|
95
|
+
*
|
|
96
|
+
* `init()` đã tự làm việc này; chỉ cần gọi tay khi app tách riêng một route `/callback` chạy
|
|
97
|
+
* ngoài APP_INITIALIZER.
|
|
98
|
+
*/
|
|
28
99
|
handleCallback(): Promise<boolean>;
|
|
29
|
-
|
|
100
|
+
getAccessToken(): string | null;
|
|
101
|
+
/** `true` khi không còn access token dùng được (chưa đăng nhập, hoặc đã quá hạn). */
|
|
102
|
+
isAccessTokenExpired(): boolean;
|
|
103
|
+
/** URL có nằm trong `secureRoutes` không — tức có được đính Bearer token không. */
|
|
104
|
+
isSecureUrl(url: string): boolean;
|
|
105
|
+
/** Origin của IdP, để interceptor không bao giờ tự đính token vào chính request lấy token. */
|
|
106
|
+
getIssuerOrigin(): string | null;
|
|
107
|
+
/** Claims của user hiện tại ở dạng `SdAuthInfo` của module auth, hoặc `null` khi chưa đăng nhập. */
|
|
108
|
+
authInfo(): SdAuthInfo | null;
|
|
109
|
+
/** Claims của user hiện tại ở dạng `SdLayoutUserInfo` của module layout. */
|
|
110
|
+
userInfo(): SdLayoutUserInfo;
|
|
111
|
+
/** Điều hướng full-page. */
|
|
112
|
+
protected navigate(url: string): void;
|
|
113
|
+
/** Viết lại URL trên thanh địa chỉ mà không tạo entry mới trong history. */
|
|
114
|
+
protected replaceHistoryState(url: string): void;
|
|
30
115
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAuthOmService, never>;
|
|
31
116
|
static ɵprov: i0.ɵɵInjectableDeclaration<SdAuthOmService>;
|
|
32
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Khớp một URL với một phần tử `secureRoutes`.
|
|
120
|
+
*
|
|
121
|
+
* Có `*` → glob trên toàn bộ URL. Không có `*` → khớp tiền tố, không phân biệt hoa thường
|
|
122
|
+
* (đây là dạng "danh sách host" mà các portal đang dùng).
|
|
123
|
+
*/
|
|
124
|
+
export declare function matchSecureRoute(pattern: string, url: string): boolean;
|
|
125
|
+
/** Khớp glob đơn giản, `*` thay cho một đoạn bất kỳ. Giữ nguyên hành vi từ bản trước của module. */
|
|
126
|
+
export declare const matchGlob: (pattern: string, url: string) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Đồng bộ đăng xuất giữa các tab cùng origin.
|
|
3
|
+
*
|
|
4
|
+
* Phiên AuthOM sống trong bộ nhớ của client OIDC, có `sessionStorage` làm nền — mà `sessionStorage`
|
|
5
|
+
* bị trình duyệt cô lập theo tab. Không có server-side session để thu hồi (AuthOM không công bố
|
|
6
|
+
* `end_session_endpoint`) và cũng không có cơ chế kiểm tra liveness xuyên tab. Hệ quả: đăng xuất ở
|
|
7
|
+
* một tab để các tab còn lại dùng được bình thường cho tới khi access token của chính chúng hết hạn.
|
|
8
|
+
*
|
|
9
|
+
* `BroadcastChannel` không bao giờ gửi message ngược về đối tượng đã post, nên tab kích hoạt đăng
|
|
10
|
+
* xuất không tự xử lý lại sự kiện của chính nó.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Bọc `BroadcastChannel` cho tín hiệu đăng xuất, và tự vô hiệu hoá khi môi trường không hỗ trợ
|
|
14
|
+
* (SSR, trình duyệt cũ, `BroadcastChannel` bị chặn).
|
|
15
|
+
*/
|
|
16
|
+
export declare class SdAuthOmSessionChannel {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(name: string);
|
|
19
|
+
/** `true` khi môi trường thực sự hỗ trợ kênh; `false` thì mọi thao tác là no-op. */
|
|
20
|
+
get enabled(): boolean;
|
|
21
|
+
/** Báo cho mọi tab khác rằng phiên vừa kết thúc. */
|
|
22
|
+
notifyLogout(): void;
|
|
23
|
+
/** Đăng ký callback chạy khi một tab khác báo đã đăng xuất. */
|
|
24
|
+
onLogout(handler: () => void): void;
|
|
25
|
+
close(): void;
|
|
26
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Module `authom` — OAuth 2.0 + PKCE
|
|
2
|
+
* Module `authom` — client xác thực OAuth 2.0 Authorization Code + PKCE cho AuthOM.
|
|
3
|
+
*
|
|
4
|
+
* Module sở hữu trọn vòng đời phiên: bootstrap qua discovery document, đổi authorization code,
|
|
5
|
+
* khôi phục deep link, gia hạn token chủ động, phát hiện hết phiên, xử lý lỗi xác thực và đăng
|
|
6
|
+
* xuất đồng bộ giữa các tab.
|
|
3
7
|
*
|
|
4
8
|
* Cách dùng (standalone):
|
|
5
9
|
* ```ts
|
|
@@ -12,12 +16,11 @@
|
|
|
12
16
|
* provideSdAuthOm({
|
|
13
17
|
* useFactory: () => ({
|
|
14
18
|
* loadTenantConfig: () => Promise.resolve({
|
|
15
|
-
*
|
|
19
|
+
* issuer: 'https://api-qc.onemount.dev/auth-om/iam/v1/mag-qc/',
|
|
16
20
|
* clientId: 'YOUR_CLIENT_ID',
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* secureRoutes: ['https://api.example.com/*'],
|
|
21
|
+
* redirectUri: `${location.origin}/callback`,
|
|
22
|
+
* audience: 'http://api-qc.int.onemount.dev/auth-om/api/v1/mag-qc',
|
|
23
|
+
* secureRoutes: ['https://api-qc.onemount.dev'],
|
|
21
24
|
* }),
|
|
22
25
|
* }),
|
|
23
26
|
* }),
|
|
@@ -25,11 +28,18 @@
|
|
|
25
28
|
* };
|
|
26
29
|
* ```
|
|
27
30
|
*
|
|
28
|
-
* Yêu cầu
|
|
29
|
-
* 1.
|
|
30
|
-
* 2. App
|
|
31
|
+
* Yêu cầu phía app:
|
|
32
|
+
* 1. Cài `angular-oauth2-oidc` (peer dependency, chọn major khớp Angular của app).
|
|
33
|
+
* 2. App chạy trên HTTPS hoặc localhost — Web Crypto API cần secure context để tạo PKCE.
|
|
34
|
+
* 3. `redirectUri` phải trùng giá trị đã đăng ký trên client AuthOM.
|
|
35
|
+
* 4. Chỉ khi bật `useSilentRefresh`: copy `silent-authom.html` cạnh source module này vào `public/`.
|
|
31
36
|
*/
|
|
32
37
|
export * from './authom.configuration';
|
|
38
|
+
export * from './authom.event';
|
|
39
|
+
export * from './authom.return-url';
|
|
40
|
+
export * from './authom.session-channel';
|
|
33
41
|
export * from './authom.service';
|
|
34
42
|
export * from './authom.interceptor';
|
|
43
|
+
export * from './authom.guard';
|
|
44
|
+
export * from './authom.auth-configuration';
|
|
35
45
|
export * from './authom.module';
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-angular/core",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.36",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
6
6
|
"@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
7
7
|
"@angular/material": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
8
|
-
"@angular/material-date-fns-adapter": "^19.0.0 || ^20.0.0 || ^21.0.0"
|
|
8
|
+
"@angular/material-date-fns-adapter": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
9
|
+
"angular-oauth2-oidc": ">=19.0.0"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
|
-
"@sdcorejs/utils": "1.
|
|
12
|
+
"@sdcorejs/utils": "1.2.2",
|
|
12
13
|
"@ckeditor/ckeditor5-angular": "11.1.2",
|
|
13
14
|
"@omer-go/docx-parser-converter-ts": "^1.0.0",
|
|
14
15
|
"@bjorn3/browser_wasi_shim": "^0.4.2",
|
|
@@ -22,6 +23,11 @@
|
|
|
22
23
|
"tslib": "^2.8.0"
|
|
23
24
|
},
|
|
24
25
|
"sideEffects": false,
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"angular-oauth2-oidc": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
25
31
|
"module": "fesm2022/sd-angular-core.mjs",
|
|
26
32
|
"typings": "index.d.ts",
|
|
27
33
|
"exports": {
|
|
@@ -38,10 +38,14 @@ export declare const StringUtilities: {
|
|
|
38
38
|
changeAliasLowerCase: (alias: any) => string;
|
|
39
39
|
aliasIncludes: (alias: any, searchText: any) => boolean;
|
|
40
40
|
format: (template: string, ...arr: any[]) => string;
|
|
41
|
-
templateToDisplay: (template: string, entity: Record<string, any
|
|
42
|
-
parseExpression: (template: string, entity: Record<string, any
|
|
41
|
+
templateToDisplay: (template: string, entity: Record<string, any>, options?: import("@sdcorejs/utils/fns").TemplatePathOptions) => string;
|
|
42
|
+
parseExpression: (template: string, entity: Record<string, any>, options?: import("@sdcorejs/utils/fns").TemplatePathOptions) => unknown;
|
|
43
|
+
obfuscate: (obj: any) => string;
|
|
44
|
+
deobfuscate: (encripted: string) => any;
|
|
43
45
|
encrypt: (obj: any) => string;
|
|
44
46
|
decrypt: (encripted: string) => any;
|
|
47
|
+
encryptAesGcm: <T>(value: T, key: CryptoKey | Uint8Array, options?: import("@sdcorejs/utils/fns").AesGcmEncryptOptions) => Promise<string>;
|
|
48
|
+
decryptAesGcm: <T>(token: string, key: CryptoKey | Uint8Array, options?: import("@sdcorejs/utils/fns").AesGcmDecryptOptions) => Promise<T>;
|
|
45
49
|
isNullOrEmpty: (value: any) => boolean;
|
|
46
50
|
isNullOrWhiteSpace: (value: any) => boolean;
|
|
47
51
|
convertToSnakeCaseCode: (name: string) => string;
|
|
@@ -7,4 +7,4 @@ export type SdMaybeAsync<T> = MaybeAsync<T>;
|
|
|
7
7
|
/** @deprecated Use {@link resolveMaybeAsync} from `@sdcorejs/utils/models` instead */
|
|
8
8
|
export declare const SdResolveMaybeAsync: <T>(value: MaybeAsync<T>) => Promise<T>;
|
|
9
9
|
/** @deprecated Use {@link normalizeAsync} from `@sdcorejs/utils/models` instead */
|
|
10
|
-
export declare const SdNormalizeAsync:
|
|
10
|
+
export declare const SdNormalizeAsync: typeof import("@sdcorejs/utils/models").normalizeSubscribable;
|