@ionite/ecv 0.0.24-beta.20260915.2 → 0.0.24-beta.20260917.4
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/index.d.ts +69 -195
- package/dist/index.js +1 -1
- package/dist/shared/ecv-wrq029hk.js +9 -0
- package/dist/vitest.js +1 -1
- package/package.json +7 -6
- package/dist/shared/ecv-54knrg2j.js +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,92 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
interface WaitForReadyOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Readiness path appended to the base URL. When omitted it is derived from {@link basePath}.
|
|
7
|
-
* @default "`${basePath}/readyz`" (i.e. `/api/ionite/readyz`)
|
|
8
|
-
*/
|
|
9
|
-
readyPath?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Base path the ionite app mounts the SDK handler under, used to derive {@link readyPath} when it is
|
|
12
|
-
* not given (ionite apps expose `${basePath}/readyz`). Ignored when `readyPath` is set explicitly.
|
|
13
|
-
* @default "/api/ionite"
|
|
14
|
-
*/
|
|
15
|
-
basePath?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional liveness path checked before readiness (e.g. "/api/livez").
|
|
18
|
-
* When set, an attempt only succeeds if liveness is OK and readiness is OK.
|
|
19
|
-
*/
|
|
20
|
-
livenessPath?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Maximum number of polling attempts.
|
|
23
|
-
* @default 30
|
|
24
|
-
*/
|
|
25
|
-
maxRetries?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Delay between attempts in milliseconds.
|
|
28
|
-
* @default 1000
|
|
29
|
-
*/
|
|
30
|
-
retryDelayMs?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Per-request abort timeout in milliseconds.
|
|
33
|
-
* @default 3000
|
|
34
|
-
*/
|
|
35
|
-
requestTimeoutMs?: number;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Poll an application until its readiness endpoint responds OK.
|
|
39
|
-
*/
|
|
40
|
-
declare function waitForReady(baseUrl: string, options?: WaitForReadyOptions): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Options for {@link startAppUnderTest}.
|
|
43
|
-
*/
|
|
44
|
-
interface StartAppOptions extends WaitForReadyOptions {
|
|
45
|
-
/** Executable to run (e.g. "bun"). */
|
|
46
|
-
command: string;
|
|
47
|
-
/** Arguments passed to the command (e.g. ["run", "api"]). */
|
|
48
|
-
args?: string[];
|
|
49
|
-
/** Working directory for the spawned process. */
|
|
50
|
-
cwd?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Environment variables merged on top of `process.env`.
|
|
53
|
-
* Pass `ecv.env` here so the app connects to the ECV mock server.
|
|
54
|
-
*/
|
|
55
|
-
env?: Record<string, string | undefined>;
|
|
56
|
-
/** Public base URL the app will be reachable at (used for readiness polling and returned to callers). */
|
|
57
|
-
baseUrl: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Handle for a spawned application under test.
|
|
61
|
-
*/
|
|
62
|
-
interface AppUnderTest {
|
|
63
|
-
/** Base URL the app is reachable at. */
|
|
64
|
-
baseUrl: string;
|
|
65
|
-
/** Process identifier for diagnostics, when the runtime provides one. */
|
|
66
|
-
pid?: number;
|
|
67
|
-
/** Stop the app (SIGTERM, then SIGKILL fallback if it is still running). */
|
|
68
|
-
stop(): Promise<void>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Spawn an application under test, wait for it to become ready, and return a handle with a `stop()`.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```ts
|
|
75
|
-
* const environment = await startEcvTestEnvironment();
|
|
76
|
-
* const ecv = ecvHandleFrom(environment.ecv);
|
|
77
|
-
* const app = await startAppUnderTest({
|
|
78
|
-
* command: 'bun',
|
|
79
|
-
* args: ['run', 'api'],
|
|
80
|
-
* env: { ...ecv.env, APP_BASE_URL: 'http://localhost:3544' },
|
|
81
|
-
* baseUrl: 'http://localhost:3544',
|
|
82
|
-
* // readyPath defaults to `${basePath}/readyz` (i.e. /api/ionite/readyz); override basePath if needed.
|
|
83
|
-
* });
|
|
84
|
-
* // ...run tests against app.baseUrl...
|
|
85
|
-
* await app.stop();
|
|
86
|
-
* await environment.stop();
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
declare function startAppUnderTest(options: StartAppOptions): Promise<AppUnderTest>;
|
|
1
|
+
import { AppUnderTest, StartAppOptions, WaitForReadyOptions } from "@ionite/devtools";
|
|
2
|
+
import { startAppUnderTest, waitForReady } from "@ionite/devtools";
|
|
90
3
|
import { ConfigLocator, EnterpriseExtension, Ionite } from "@ionite/server";
|
|
91
4
|
/** Serializable connection details provided by the ECV server control API. */
|
|
92
5
|
interface SerializedEcvServerHandle {
|
|
@@ -781,39 +694,21 @@ declare function validateProtocolSurface(): Promise<{
|
|
|
781
694
|
passed: boolean;
|
|
782
695
|
error?: string;
|
|
783
696
|
}[]>;
|
|
697
|
+
import { ProvisionedTenant, WaitForReadyOptions as WaitForReadyOptions2 } from "@ionite/devtools";
|
|
784
698
|
import { CreateTenantRequest } from "@ionite/server";
|
|
785
699
|
interface ProvisionTenantOptions {
|
|
786
|
-
/** Running ECV mock used for workload credentials and the tenant config locator. */
|
|
787
700
|
ecv: EcvServerHandle;
|
|
788
|
-
/** Base URL of the root tenant-management application. */
|
|
789
701
|
baseUrl: string;
|
|
790
|
-
/** Tenant-management endpoint. @default "/api/tenants" */
|
|
791
702
|
tenantPath?: string;
|
|
792
|
-
/** Full manager contract or deployer-style creation-only contract. @default "tenantManager" */
|
|
793
703
|
profile?: TenantValidationProfile;
|
|
794
|
-
/** Tenant data. configLocator and webhookUrl default to ECV mock values. */
|
|
795
704
|
tenant: Omit<CreateTenantRequest, "configLocator"> & {
|
|
796
705
|
configLocator?: CreateTenantRequest["configLocator"];
|
|
797
706
|
};
|
|
798
|
-
/** Tenant ionite mount for creation-only deployers. @default "/api/ionite" */
|
|
799
707
|
basePath?: string;
|
|
800
|
-
|
|
801
|
-
readiness?: WaitForReadyOptions;
|
|
802
|
-
}
|
|
803
|
-
interface ProvisionedTenant {
|
|
804
|
-
id: string;
|
|
805
|
-
/** URL used as ValidationConfig.baseUrl for the tenant suite. */
|
|
806
|
-
baseUrl: string;
|
|
807
|
-
/** Tenant ionite mount used to locate capabilitiez and protocol routes. */
|
|
808
|
-
basePath: string;
|
|
809
|
-
/** Tenant URL reported by the tenant-management service. */
|
|
810
|
-
tenantUrl: string;
|
|
708
|
+
readiness?: WaitForReadyOptions2;
|
|
811
709
|
}
|
|
812
710
|
/**
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
* This helper performs the application's real tenant-management flow. It does not
|
|
816
|
-
* register tenant-management assertions; use `ecv.tenants()` for that contract.
|
|
711
|
+
* Adapt ECV's mock handle to the dependency-light devtools Tenant Management driver.
|
|
817
712
|
*/
|
|
818
713
|
declare function provisionTenant(options: ProvisionTenantOptions): Promise<ProvisionedTenant>;
|
|
819
714
|
declare function createRedisStoreTests(): {
|
|
@@ -824,90 +719,7 @@ declare function createSecretsHardeningTests(): {
|
|
|
824
719
|
tests: TestDef[];
|
|
825
720
|
};
|
|
826
721
|
declare function validateSecretsHardening(): Promise<ValidationSuiteResult>;
|
|
827
|
-
|
|
828
|
-
readonly "~standard": {
|
|
829
|
-
readonly validate: (value: unknown) => {
|
|
830
|
-
value: unknown;
|
|
831
|
-
} | {
|
|
832
|
-
issues: ReadonlyArray<{
|
|
833
|
-
message: string;
|
|
834
|
-
path?: ReadonlyArray<unknown>;
|
|
835
|
-
}>;
|
|
836
|
-
} | Promise<{
|
|
837
|
-
value: unknown;
|
|
838
|
-
} | {
|
|
839
|
-
issues: ReadonlyArray<{
|
|
840
|
-
message: string;
|
|
841
|
-
path?: ReadonlyArray<unknown>;
|
|
842
|
-
}>;
|
|
843
|
-
}>;
|
|
844
|
-
};
|
|
845
|
-
};
|
|
846
|
-
/**
|
|
847
|
-
* Creates a fetch function with default configuration
|
|
848
|
-
*/
|
|
849
|
-
declare function resolveBaseUrl(config: Pick<ValidationConfig, "baseUrl">): string;
|
|
850
|
-
declare function createFetcher(config: ValidationConfig): (path: string, options?: RequestInit) => Promise<Response>;
|
|
851
|
-
/**
|
|
852
|
-
* Wraps a test function to capture timing and errors
|
|
853
|
-
*/
|
|
854
|
-
declare function runTest(name: string, testFn: () => Promise<undefined | {
|
|
855
|
-
details?: Record<string, unknown>;
|
|
856
|
-
}>): Promise<ValidationResult>;
|
|
857
|
-
/**
|
|
858
|
-
* Creates a skipped test result
|
|
859
|
-
*/
|
|
860
|
-
declare function skipTest(name: string, reason: string): ValidationResult;
|
|
861
|
-
/**
|
|
862
|
-
* Assertion helper for tests
|
|
863
|
-
*/
|
|
864
|
-
declare function assert(condition: boolean, message: string): asserts condition;
|
|
865
|
-
/**
|
|
866
|
-
* Assertion helper for equality
|
|
867
|
-
*/
|
|
868
|
-
declare function assertEqual<T>(actual: T, expected: T, message?: string): void;
|
|
869
|
-
/**
|
|
870
|
-
* Assertion helper for validating data against a StandardSchemaV1 validator
|
|
871
|
-
*
|
|
872
|
-
* This is the preferred way to validate data when you have a validator available.
|
|
873
|
-
* The validator can be from valibot, zod, or any other library that implements StandardSchemaV1.
|
|
874
|
-
*
|
|
875
|
-
* @param data - The data to validate
|
|
876
|
-
* @param validator - A StandardSchemaV1 validator (e.g., from valibotValidators or zodValidators)
|
|
877
|
-
* @param message - Optional custom error message
|
|
878
|
-
*
|
|
879
|
-
* @example
|
|
880
|
-
* ```typescript
|
|
881
|
-
* import { valibotValidators } from '@ionite/valibot';
|
|
882
|
-
* const tenantValidator = valibotValidators.tenantResponse();
|
|
883
|
-
* assertValid(data, tenantValidator);
|
|
884
|
-
* ```
|
|
885
|
-
*
|
|
886
|
-
* @throws Error if validation fails
|
|
887
|
-
*/
|
|
888
|
-
declare function assertValid(data: unknown, validator: StandardSchemaV1, message?: string): void;
|
|
889
|
-
/**
|
|
890
|
-
* Drive a login from initiation through the callback (optionally tampering the auth code or carrying
|
|
891
|
-
* a `?redirect` param) and return the callback Response plus the minted state. Mock OIDC must be
|
|
892
|
-
* reachable (same wiring the JIT flow relies on).
|
|
893
|
-
*/
|
|
894
|
-
declare function runLoginToCallback(config: SSOValidationConfig, fetch: ReturnType<typeof createFetcher>, opts?: {
|
|
895
|
-
redirectParam?: string;
|
|
896
|
-
bogusCode?: boolean;
|
|
897
|
-
}): Promise<{
|
|
898
|
-
callback: Response;
|
|
899
|
-
state: string | null;
|
|
900
|
-
}>;
|
|
901
|
-
/**
|
|
902
|
-
* Helper: Complete a full SSO login flow through the mock server
|
|
903
|
-
*
|
|
904
|
-
* Returns the cookies set after successful authentication
|
|
905
|
-
*/
|
|
906
|
-
declare function completeLoginFlow(config: SSOValidationConfig, fetch: ReturnType<typeof createFetcher>): Promise<{
|
|
907
|
-
cookies: Map<string, string>;
|
|
908
|
-
success: boolean;
|
|
909
|
-
error?: string;
|
|
910
|
-
}>;
|
|
722
|
+
import { completeLoginFlow, runLoginToCallback } from "@ionite/devtools";
|
|
911
723
|
/**
|
|
912
724
|
* Runs all SSO validation tests
|
|
913
725
|
*/
|
|
@@ -971,6 +783,68 @@ declare function createTenantLifecycleTests(): {
|
|
|
971
783
|
tests: TestDef[];
|
|
972
784
|
};
|
|
973
785
|
declare function validateTenantLifecycle(): Promise<ValidationSuiteResult>;
|
|
786
|
+
type StandardSchemaV1 = {
|
|
787
|
+
readonly "~standard": {
|
|
788
|
+
readonly validate: (value: unknown) => {
|
|
789
|
+
value: unknown;
|
|
790
|
+
} | {
|
|
791
|
+
issues: ReadonlyArray<{
|
|
792
|
+
message: string;
|
|
793
|
+
path?: ReadonlyArray<unknown>;
|
|
794
|
+
}>;
|
|
795
|
+
} | Promise<{
|
|
796
|
+
value: unknown;
|
|
797
|
+
} | {
|
|
798
|
+
issues: ReadonlyArray<{
|
|
799
|
+
message: string;
|
|
800
|
+
path?: ReadonlyArray<unknown>;
|
|
801
|
+
}>;
|
|
802
|
+
}>;
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
/**
|
|
806
|
+
* Creates a fetch function with default configuration
|
|
807
|
+
*/
|
|
808
|
+
declare function resolveBaseUrl(config: Pick<ValidationConfig, "baseUrl">): string;
|
|
809
|
+
declare function createFetcher(config: ValidationConfig): (path: string, options?: RequestInit) => Promise<Response>;
|
|
810
|
+
/**
|
|
811
|
+
* Wraps a test function to capture timing and errors
|
|
812
|
+
*/
|
|
813
|
+
declare function runTest(name: string, testFn: () => Promise<undefined | {
|
|
814
|
+
details?: Record<string, unknown>;
|
|
815
|
+
}>): Promise<ValidationResult>;
|
|
816
|
+
/**
|
|
817
|
+
* Creates a skipped test result
|
|
818
|
+
*/
|
|
819
|
+
declare function skipTest(name: string, reason: string): ValidationResult;
|
|
820
|
+
/**
|
|
821
|
+
* Assertion helper for tests
|
|
822
|
+
*/
|
|
823
|
+
declare function assert(condition: boolean, message: string): asserts condition;
|
|
824
|
+
/**
|
|
825
|
+
* Assertion helper for equality
|
|
826
|
+
*/
|
|
827
|
+
declare function assertEqual<T>(actual: T, expected: T, message?: string): void;
|
|
828
|
+
/**
|
|
829
|
+
* Assertion helper for validating data against a StandardSchemaV1 validator
|
|
830
|
+
*
|
|
831
|
+
* This is the preferred way to validate data when you have a validator available.
|
|
832
|
+
* The validator can be from valibot, zod, or any other library that implements StandardSchemaV1.
|
|
833
|
+
*
|
|
834
|
+
* @param data - The data to validate
|
|
835
|
+
* @param validator - A StandardSchemaV1 validator (e.g., from valibotValidators or zodValidators)
|
|
836
|
+
* @param message - Optional custom error message
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* ```typescript
|
|
840
|
+
* import { valibotValidators } from '@ionite/valibot';
|
|
841
|
+
* const tenantValidator = valibotValidators.tenantResponse();
|
|
842
|
+
* assertValid(data, tenantValidator);
|
|
843
|
+
* ```
|
|
844
|
+
*
|
|
845
|
+
* @throws Error if validation fails
|
|
846
|
+
*/
|
|
847
|
+
declare function assertValid(data: unknown, validator: StandardSchemaV1, message?: string): void;
|
|
974
848
|
declare function createValidatorParityTests(): {
|
|
975
849
|
tests: TestDef[];
|
|
976
850
|
};
|
|
@@ -988,7 +862,7 @@ declare function validateVaultWebSocketTransport(): Promise<ValidationSuiteResul
|
|
|
988
862
|
*
|
|
989
863
|
* Keep this synchronized with packages/ecv/package.json via publish.ts.
|
|
990
864
|
*/
|
|
991
|
-
declare const ECV_VERSION = "0.0.24-beta.
|
|
865
|
+
declare const ECV_VERSION = "0.0.24-beta.20260917.4";
|
|
992
866
|
/**
|
|
993
867
|
* Runs all Workload validation tests
|
|
994
868
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{re,oe,r,a,s,c,e,t,n,u,p,H,ne,ie,m,h,ce,_,j,U,O,q,d,o,M,de,g,f,le,y,ue,w,pe,i,L,X,Z,v,me,b,he,k,ge,fe,S,V,ye,T,we,C,ve,R,be,E,ke,l,Se,Y,N,x,Te,A,Ce,Re,I,z,D,B,G,W,Q,K,J,P,Ee,ee,xe,te,Ae,se,Ie,ae,Pe,F,_e}from"./shared/ecv-wrq029hk.js";export{i as ECV_VERSION,P as EcvContainer,q as ION_CAPABILITIEZ_SCOPE,O as ION_IAM_SCOPES,d as ION_TENANT_SCOPE,X as QUARANTINED_SDK_VERSIONS,L as SUPPORTED_SDK_RANGE,J as StartedEcvContainer,e as assert,t as assertEqual,n as assertValid,D as buildEcvMetaCatalog,B as buildEcvSdkCatalog,G as buildEcvTenantCatalog,W as buildEcvUnitCatalog,V as completeLoginFlow,K as connectEcvServer,u as createAuthzClosureTests,m as createCIAMTests,j as createConfigBoundaryTests,_ as createConfigLifecycleTests,U as createConfigRetryTests,a as createFetcher,M as createHarnessSelfTests,g as createIAMTests,f as createIamDeltaPatchTests,y as createIamPrincipalPullTests,w as createKmsTests,h as createLfvCallbackTests,p as createOaaProjectionTests,v as createOtelTests,ee as createPerformanceTuningTests,b as createProtocolSurfaceTests,te as createRedisStoreTests,S as createSSOTests,k as createSecretsHardeningTests,T as createSsoControlContractTests,C as createSsoIdTokenVerificationTests,R as createSsoSessionWindowTests,E as createSsoTokenClientAuthTests,se as createTenantLifecycleTests,N as createTenantManagementTests,Y as createTenantTests,ae as createValidatorParityTests,x as createVaultCoordinationTests,A as createVaultWebSocketTransportTests,H as createWorkloadScopeTests,I as createWorkloadTests,Q as ecvHandleFrom,F as ecvSuite,z as fetchCapabilitiezManifest,o as getTenantAuthToken,_e as printReport,l as provisionTenant,r as resolveBaseUrl,ye as runLoginToCallback,s as runTest,Z as satisfiesSdkRange,c as skipTest,re as startAppUnderTest,Ee as startEcvTestEnvironment,ne as validateAuthz,ie as validateCIAM,de as validateIAM,le as validateIamDelta,ue as validateIamPrincipals,pe as validateKms,ce as validateLfvDelivery,me as validateOtel,xe as validatePerformanceTuning,he as validateProtocolSurface,Ae as validateRedisStores,fe as validateSSO,ge as validateSecretsHardening,we as validateSsoControlContract,ve as validateSsoIdTokenVerification,be as validateSsoSessionWindow,ke as validateSsoTokenClientAuth,Se as validateTenant,Ie as validateTenantLifecycle,Pe as validateValidatorParity,Te as validateVaultCoordination,Ce as validateVaultWebSocketTransport,Re as validateWorkload,oe as waitForReady};
|