@endge/core 1.2.13 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +312 -308
- package/dist/core.js +31530 -28231
- package/dist/domain/entities/reflect/RAuthProfile.d.ts +3 -3
- package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +2 -0
- package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +1 -1
- package/dist/domain/types/auth/auth-profile.types.d.ts +79 -27
- package/dist/domain/types/auth/auth-runtime.types.d.ts +0 -23
- package/dist/domain/types/component/sfc/ast.types.d.ts +2 -0
- package/dist/domain/types/component/sfc/intrinsic-events.types.d.ts +6 -0
- package/dist/domain/types/component/sfc/ir.types.d.ts +90 -1
- package/dist/domain/types/component/sfc/visual-projection.types.d.ts +34 -0
- package/dist/domain/types/document/domain-export.type.d.ts +1 -0
- package/dist/domain/types/kernel/bootstrap.types.d.ts +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/model/modules/domain/endge-domain.d.ts +2 -0
- package/dist/model/modules/security/auth/AuthInteractionRequiredError.d.ts +6 -0
- package/dist/model/modules/security/auth/AuthProfileRegistry.d.ts +4 -4
- package/dist/model/modules/security/auth/AuthRequestResolver.d.ts +6 -1
- package/dist/model/modules/security/auth/AuthSessionManager.d.ts +2 -6
- package/dist/model/modules/security/auth/adapters/BasicAuthAdapter.d.ts +10 -0
- package/dist/model/modules/security/auth/adapters/BearerAuthAdapter.d.ts +1 -1
- package/dist/model/modules/security/auth/adapters/OAuth2ClientCredentialsAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/auth/adapters/OidcAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/endge-auth.d.ts +12 -2
- package/dist/model/services/auth/OidcBrowserSession_Service.d.ts +26 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +12 -0
- package/dist/test/component-sfc-interactions.bench.d.ts +1 -0
- package/dist/test/component-sfc-interactions.test.d.ts +1 -0
- package/dist/test/security/auth-profile-serializer.test.d.ts +1 -0
- package/dist/test/security/auth-test-helpers.d.ts +0 -1
- package/dist/test/security/oidc-browser-session.test.d.ts +1 -0
- package/dist/test/tools/component-sfc-edit-trigger.test.d.ts +1 -0
- package/dist/tools/component-sfc-edit-trigger.d.ts +11 -0
- package/package.json +6 -4
- package/dist/model/modules/security/auth/adapters/KeycloakAuthAdapter.d.ts +0 -25
- package/dist/model/services/auth/KeycloakAuthClient.d.ts +0 -21
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
import { EndgeBootContext } from '../../../domain/types/kernel/bootstrap.types';
|
|
2
|
+
import { AuthProfileSchema, OidcBrowserSessionOptions } from '../../../domain/types/auth/auth-profile.types';
|
|
2
3
|
import { EndgeModule } from '../../../domain/entities/endge/EndgeModule';
|
|
3
4
|
import { AuthAdapterRegistry } from './auth/AuthAdapterRegistry';
|
|
4
5
|
import { AuthProfileRegistry } from './auth/AuthProfileRegistry';
|
|
5
6
|
import { AuthRequestResolver } from './auth/AuthRequestResolver';
|
|
6
7
|
import { AuthSessionManager } from './auth/AuthSessionManager';
|
|
8
|
+
import { OidcBrowserSession_Service } from '../../services/auth/OidcBrowserSession_Service';
|
|
9
|
+
import { AuthInteractionRequiredError } from './auth/AuthInteractionRequiredError';
|
|
10
|
+
export type AuthInteractionRequiredListener = (error: AuthInteractionRequiredError) => void;
|
|
7
11
|
/** Единый lifecycle owner runtime auth profile sessions и request authentication. */
|
|
8
12
|
export declare class EndgeAuth extends EndgeModule {
|
|
9
13
|
readonly adapters: AuthAdapterRegistry;
|
|
10
14
|
readonly profiles: AuthProfileRegistry;
|
|
11
15
|
readonly session: AuthSessionManager;
|
|
12
16
|
readonly requests: AuthRequestResolver;
|
|
13
|
-
private _credentialResolver;
|
|
14
17
|
private _signal;
|
|
18
|
+
private _storageNamespace;
|
|
15
19
|
private _abortController;
|
|
16
20
|
private _detachHostAbort;
|
|
17
21
|
private _unregisterDiagnosticsContext;
|
|
18
22
|
private readonly _store;
|
|
23
|
+
private readonly _interactionRequiredListeners;
|
|
19
24
|
/** Собирает auth subsystem и регистрирует встроенные adapters один раз. */
|
|
20
25
|
constructor();
|
|
21
|
-
/**
|
|
26
|
+
/** Subscribes a host application to requests that require an interactive OIDC flow. */
|
|
27
|
+
onInteractionRequired(listener: AuthInteractionRequiredListener): () => void;
|
|
28
|
+
/** Подключает storage namespace и безопасные context providers. */
|
|
22
29
|
setup(ctx: EndgeBootContext): void;
|
|
23
30
|
/** Валидирует Domain profiles и восстанавливает session default runtime profile. */
|
|
24
31
|
build(): void;
|
|
25
32
|
/** Сбрасывает runtime state, не удаляя persisted browser session. */
|
|
26
33
|
reset(): void;
|
|
34
|
+
/** Создаёт OIDC browser source из resolved persisted profile. */
|
|
35
|
+
createOidcSessionSource(profileInput: AuthProfileSchema | string, options: Pick<OidcBrowserSessionOptions, 'redirectUri' | 'popupRedirectUri' | 'postLogoutRedirectUri' | 'flow'>): OidcBrowserSession_Service;
|
|
27
36
|
private _resolvePublicValue;
|
|
28
37
|
private _diagnosticsAttributes;
|
|
38
|
+
private _publishInteractionRequired;
|
|
29
39
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AuthSessionSource, AuthSessionSourceResolveOptions, AuthTokenSet, OidcBrowserSessionOptions } from '../../../domain/types/auth/auth-profile.types';
|
|
2
|
+
/** Общий browser OIDC runtime для popup и redirect Authorization Code + PKCE flows. */
|
|
3
|
+
export declare class OidcBrowserSession_Service implements AuthSessionSource {
|
|
4
|
+
readonly options: OidcBrowserSessionOptions;
|
|
5
|
+
private readonly _userStore;
|
|
6
|
+
private readonly _manager;
|
|
7
|
+
constructor(options: OidcBrowserSessionOptions);
|
|
8
|
+
/** Возвращает сохранённого пользователя без запуска интерактивного flow. */
|
|
9
|
+
hasSession(): Promise<boolean>;
|
|
10
|
+
/** Открывает внешний OIDC login в popup и сохраняет полученную session. */
|
|
11
|
+
loginPopup(): Promise<AuthTokenSet>;
|
|
12
|
+
/** Завершает callback в отдельном popup без загрузки Domain. */
|
|
13
|
+
static completeStoredPopupCallback(url?: string): Promise<void>;
|
|
14
|
+
/** Перенаправляет текущую вкладку на внешний OIDC login. */
|
|
15
|
+
loginRedirect(): Promise<never>;
|
|
16
|
+
/** Завершает redirect callback и сохраняет session. */
|
|
17
|
+
completeRedirectCallback(url?: string): Promise<AuthTokenSet>;
|
|
18
|
+
/** Завершает popup callback; результат передаётся opener через oidc-client-ts. */
|
|
19
|
+
completePopupCallback(url?: string): Promise<void>;
|
|
20
|
+
/** Возвращает актуальную session, используя refresh token только при необходимости. */
|
|
21
|
+
resolveToken(options: AuthSessionSourceResolveOptions): Promise<AuthTokenSet | null>;
|
|
22
|
+
/** Возвращает claims и при наличии endpoint дополняет их OIDC userinfo. */
|
|
23
|
+
loadUserInfo(): Promise<Record<string, unknown> | null>;
|
|
24
|
+
/** Завершает provider session выбранным host flow и всегда удаляет local user. */
|
|
25
|
+
logout(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RComponentDependencies, RComponentDiagnostic } from '../../../../domain/types/component/component-core.types';
|
|
2
|
+
import { RComponentSFC_AST_Attribute } from '../../../../domain/types/component/sfc/ast.types';
|
|
3
|
+
import { RComponentSFC_IR_EventModifier, RComponentSFC_IR_InteractionGroup } from '../../../../domain/types/component/sfc/ir.types';
|
|
4
|
+
import { ComponentSFCPortManifest } from '../../../../domain/types/component/sfc/ports.types';
|
|
5
|
+
export interface ComponentSFCInteractionCompileContext {
|
|
6
|
+
props: string[];
|
|
7
|
+
locals: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Detects statically invalid passive/prevent combinations in shared trigger descriptors. */
|
|
10
|
+
export declare function hasComponentSFCPassivePreventConflict(source: string, suffixes?: readonly RComponentSFC_IR_EventModifier[]): boolean;
|
|
11
|
+
/** Compiles one source-owned `:on` annotation into renderer-neutral rules. */
|
|
12
|
+
export declare function compileComponentSFCInteractionAnnotation(attribute: RComponentSFC_AST_Attribute, manifest: ComponentSFCPortManifest | null, context: ComponentSFCInteractionCompileContext, dependencies: RComponentDependencies, diagnostics: RComponentDiagnostic[]): RComponentSFC_IR_InteractionGroup | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,4 +10,3 @@ export declare class MemoryStorage implements Storage {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function authProfile(overrides?: Partial<AuthProfileSchema>): AuthProfileSchema;
|
|
12
12
|
export declare function tokenSet(overrides?: Partial<AuthTokenSet>): AuthTokenSet;
|
|
13
|
-
export declare function jwt(claims: Record<string, unknown>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentSFCInteractionTrigger, ComponentSFCInteractionTriggerEvent, ComponentSFCInteractionTriggerPlatform } from '../domain/types/component/sfc/ir.types';
|
|
2
|
+
/** Normalizes the shared `edit-on` / `on` trigger value. */
|
|
3
|
+
export declare function normalizeComponentSFCInteractionTriggers(value: unknown): ComponentSFCInteractionTrigger[];
|
|
4
|
+
/** Проверяет один нормализованный trigger без зависимости от DOM и конкретного renderer-а. */
|
|
5
|
+
export declare function matchesComponentSFCInteractionTrigger(trigger: ComponentSFCInteractionTrigger, event: ComponentSFCInteractionTriggerEvent, platform: ComponentSFCInteractionTriggerPlatform): boolean;
|
|
6
|
+
/** Приводит browser platform label к стабильным значениям edit-on контракта. */
|
|
7
|
+
export declare function resolveComponentSFCInteractionTriggerPlatform(value: unknown): ComponentSFCInteractionTriggerPlatform;
|
|
8
|
+
/** Backward-compatible editable wrappers. */
|
|
9
|
+
export declare const normalizeComponentSFCEditTriggers: typeof normalizeComponentSFCInteractionTriggers;
|
|
10
|
+
export declare const matchesComponentSFCEditTrigger: typeof matchesComponentSFCInteractionTrigger;
|
|
11
|
+
export declare const resolveComponentSFCEditTriggerPlatform: typeof resolveComponentSFCInteractionTriggerPlatform;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@endge/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
"build": "vite build",
|
|
24
24
|
"preview": "vite preview",
|
|
25
25
|
"test": "vitest",
|
|
26
|
+
"bench:interactions": "vitest bench src/test/component-sfc-interactions.bench.ts",
|
|
26
27
|
"typecheck": "vue-tsc --noEmit"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@babel/parser": "^7.27.2",
|
|
30
31
|
"@babel/types": "^7.27.1",
|
|
31
|
-
"@endge/utils": "^0.24.
|
|
32
|
+
"@endge/utils": "^0.24.9",
|
|
32
33
|
"@vue/compiler-dom": "^3.5.24",
|
|
33
34
|
"@vue/compiler-sfc": "^3.5.24",
|
|
34
35
|
"axios": "^1.13.2",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"graphql": "^16.12.0",
|
|
37
38
|
"lodash": "^4.17.21",
|
|
38
39
|
"mitt": "^3.0.1",
|
|
40
|
+
"oidc-client-ts": "^3.5.0",
|
|
39
41
|
"postcss": "^8.5.6",
|
|
40
42
|
"postcss-scss": "^4.0.9",
|
|
41
43
|
"postcss-selector-parser": "^7.1.0",
|
|
@@ -44,8 +46,8 @@
|
|
|
44
46
|
"yaml": "^2.8.1"
|
|
45
47
|
},
|
|
46
48
|
"peerDependencies": {
|
|
47
|
-
"@endge/raph": "^3.0.
|
|
48
|
-
"@endge/utils": "^0.24.
|
|
49
|
+
"@endge/raph": "^3.0.7",
|
|
50
|
+
"@endge/utils": "^0.24.9",
|
|
49
51
|
"@primevue/themes": "^4.0.0-rc.1",
|
|
50
52
|
"class-transformer": "^0.5.1",
|
|
51
53
|
"class-validator": "^0.14.1",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AuthAdapterContext, AuthProfileAdapter, AuthProfileSchema, AuthTokenSet } from '../../../../../domain/types/auth/auth-profile.types';
|
|
2
|
-
import { KeycloakAuthTransportFactory } from '../../../../../domain/types/auth/auth-runtime.types';
|
|
3
|
-
/** Keycloak password-grant adapter без владения storage или application state. */
|
|
4
|
-
export declare class KeycloakAuthAdapter implements AuthProfileAdapter {
|
|
5
|
-
private readonly _resolvePublicValue;
|
|
6
|
-
private readonly _createTransport;
|
|
7
|
-
private readonly _now;
|
|
8
|
-
readonly id = "keycloak";
|
|
9
|
-
readonly label = "Keycloak";
|
|
10
|
-
constructor(_resolvePublicValue: (raw: unknown) => string, _createTransport?: KeycloakAuthTransportFactory, _now?: () => number);
|
|
11
|
-
/** Проверяет строгий persisted contract Keycloak profile. */
|
|
12
|
-
validate(profile: AuthProfileSchema): void;
|
|
13
|
-
/** Выполняет interactive или service password grant. */
|
|
14
|
-
authenticate(context: AuthAdapterContext): Promise<AuthTokenSet>;
|
|
15
|
-
/** Обновляет Keycloak session. */
|
|
16
|
-
refresh(context: AuthAdapterContext): Promise<AuthTokenSet>;
|
|
17
|
-
/** Завершает Keycloak session при наличии refresh token. */
|
|
18
|
-
logout(context: AuthAdapterContext): Promise<void>;
|
|
19
|
-
/** Загружает OIDC userinfo. */
|
|
20
|
-
loadUserInfo(context: AuthAdapterContext): Promise<Record<string, unknown> | null>;
|
|
21
|
-
/** Собирает resolved public config без чтения credential material. */
|
|
22
|
-
private _config;
|
|
23
|
-
private _transport;
|
|
24
|
-
private _requireToken;
|
|
25
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AuthTokenSet } from '../../../domain/types/auth/auth-profile.types';
|
|
2
|
-
import { KeycloakAuthTransport, KeycloakTokenResponse, KeycloakTransportConfig } from '../../../domain/types/auth/auth-runtime.types';
|
|
3
|
-
import { AxiosInstance } from 'axios';
|
|
4
|
-
/** Преобразует transport response Keycloak в runtime token set. */
|
|
5
|
-
export declare function mapKeycloakTokenResponse(data: KeycloakTokenResponse, now?: number, previous?: AuthTokenSet): AuthTokenSet;
|
|
6
|
-
/** Axios transport для стандартных Keycloak OIDC endpoints. */
|
|
7
|
-
export declare class KeycloakAuthClient implements KeycloakAuthTransport {
|
|
8
|
-
private readonly _http;
|
|
9
|
-
private readonly _tokenPath;
|
|
10
|
-
private readonly _logoutPath;
|
|
11
|
-
private readonly _userinfoPath;
|
|
12
|
-
constructor(config: KeycloakTransportConfig, http?: AxiosInstance);
|
|
13
|
-
/** Выполняет password grant. */
|
|
14
|
-
passwordGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
|
|
15
|
-
/** Обновляет access token через refresh token. */
|
|
16
|
-
refreshGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
|
|
17
|
-
/** Завершает Keycloak session. */
|
|
18
|
-
logout(payload: Record<string, string>, signal?: AbortSignal): Promise<void>;
|
|
19
|
-
/** Загружает OIDC userinfo текущей session. */
|
|
20
|
-
getUserInfo(accessToken: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
|
|
21
|
-
}
|