@ionite/core 0.0.24-beta.20260922.9 → 0.0.24-beta.20260927.13
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 +308 -15
- package/dist/index.js +2 -2
- package/dist/server.d.ts +277 -9
- package/dist/server.js +1 -1
- package/dist/shared/core-anx7e6cp.js +4 -0
- package/package.json +1 -1
- package/dist/shared/core-j5xhxcmq.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,93 @@ type CIAMProviderDescriptor = {
|
|
|
96
96
|
url?: string;
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
|
+
* Light display cookies (`${cookiesPrefix}.profile`).
|
|
100
|
+
*
|
|
101
|
+
* The envelope is SDK-owned. App code supplies only `user`. The cookie is not an
|
|
102
|
+
* authentication input: the server never reads it to resolve a session, and the browser
|
|
103
|
+
* may forge it. `expiresAt` is display metadata so a client can order entries without a
|
|
104
|
+
* round trip; authoritative expiry is the peer `${cookiesPrefix}.session` record.
|
|
105
|
+
*/
|
|
106
|
+
declare const DISPLAY_COOKIE_SUFFIX = ".profile";
|
|
107
|
+
declare const DISPLAY_COOKIE_VERSION = 1;
|
|
108
|
+
declare const DEFAULT_DISPLAY_COOKIE_MAX = 10;
|
|
109
|
+
declare const DEFAULT_DISCOVERED_COOKIE_MAX = 10;
|
|
110
|
+
declare const DEFAULT_DISCOVERED_COOKIE_TTL_SECONDS: number;
|
|
111
|
+
declare const DISCOVERED_COOKIE_PREFIX = "ion.discovered";
|
|
112
|
+
type DisplayCookieConfig = {
|
|
113
|
+
/**
|
|
114
|
+
* When true, the SDK writes a non-HttpOnly display cookie beside the opaque session cookie.
|
|
115
|
+
* ConfigSource-only. Default false.
|
|
116
|
+
*/
|
|
117
|
+
enabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* How many display cookies a single response may leave on the browser, newest session window
|
|
120
|
+
* first. ConfigSource-only. Values below 1 fall back to {@link DEFAULT_DISPLAY_COOKIE_MAX}.
|
|
121
|
+
* @default 10
|
|
122
|
+
*/
|
|
123
|
+
max?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Session-less tenant hints written by an App after an explicit directory lookup.
|
|
126
|
+
* ConfigSource-only and off unless `enabled` is true.
|
|
127
|
+
*/
|
|
128
|
+
discovered?: DiscoveredDisplayCookieConfig;
|
|
129
|
+
};
|
|
130
|
+
type DiscoveredDisplayCookieConfig = {
|
|
131
|
+
enabled?: boolean;
|
|
132
|
+
/** Browser hint lifetime. This is not a session expiry. @default 14400 */
|
|
133
|
+
ttlSeconds?: number;
|
|
134
|
+
/** Independent cap; discovered hints never displace live-session entries. @default 10 */
|
|
135
|
+
max?: number;
|
|
136
|
+
};
|
|
137
|
+
/** What `${basePath}/auth/user` and `${basePath}/auth/customer` return. ConfigSource-only. */
|
|
138
|
+
type UserEndpointPolicy = "full" | "display" | "off";
|
|
139
|
+
type DisplayUser = Record<string, string | number | boolean | null>;
|
|
140
|
+
type DisplayAuthType = "sso" | "ciam";
|
|
141
|
+
type DisplayCookieEnvelope = {
|
|
142
|
+
v: typeof DISPLAY_COOKIE_VERSION;
|
|
143
|
+
/**
|
|
144
|
+
* Session envelopes omit this field (absent means `'session'`) so the wire format stays identical
|
|
145
|
+
* to cookies written before discovered hints existed; only discovered hints set it explicitly.
|
|
146
|
+
* Readers must treat `undefined` as `'session'`.
|
|
147
|
+
*/
|
|
148
|
+
kind?: "session" | "discovered";
|
|
149
|
+
tenantId?: string;
|
|
150
|
+
authType: DisplayAuthType;
|
|
151
|
+
/** ISO timestamp copied from the session window at write time. Display only. */
|
|
152
|
+
expiresAt: string;
|
|
153
|
+
user: DisplayUser;
|
|
154
|
+
tenantName?: string;
|
|
155
|
+
};
|
|
156
|
+
type DisplayIdentity = {
|
|
157
|
+
name?: string;
|
|
158
|
+
email?: string;
|
|
159
|
+
avatar?: string;
|
|
160
|
+
};
|
|
161
|
+
declare function resolveDisplayCookieMax(max: number | undefined): number;
|
|
162
|
+
declare function resolveDiscoveredCookieMax(max: number | undefined): number;
|
|
163
|
+
declare function resolveDiscoveredCookieTtlSeconds(ttlSeconds: number | undefined): number;
|
|
164
|
+
declare function defaultDisplayUser(identity: DisplayIdentity): DisplayUser;
|
|
165
|
+
/** Drop non-primitives and auth-bearing keys. Display cookies carry UI fields only. */
|
|
166
|
+
declare function sanitizeDisplayUser(value: unknown): DisplayUser;
|
|
167
|
+
/**
|
|
168
|
+
* AppDev projection runs on the full user (including custom attributes). When omitted, or when it
|
|
169
|
+
* throws, the cookie carries name, email, and avatar only. Forbidden and non-primitive fields are
|
|
170
|
+
* dropped either way — a projector cannot put a session id or token into the cookie.
|
|
171
|
+
*/
|
|
172
|
+
declare function projectDisplayUser<TUser extends object>(user: TUser, projector?: (user: TUser) => unknown): DisplayUser;
|
|
173
|
+
declare function encodeDisplayCookie(envelope: DisplayCookieEnvelope): string;
|
|
174
|
+
declare function decodeDisplayCookie(raw: string): DisplayCookieEnvelope | undefined;
|
|
175
|
+
type ParsedDisplayCookie = {
|
|
176
|
+
name: string;
|
|
177
|
+
prefix: string;
|
|
178
|
+
envelope: DisplayCookieEnvelope;
|
|
179
|
+
};
|
|
180
|
+
declare function readDisplayCookies(cookieHeader: string | null | undefined): ParsedDisplayCookie[];
|
|
181
|
+
/** Client ordering: newest session window first. Invalid timestamps sort last. */
|
|
182
|
+
declare function compareDisplayExpiryDesc(a: string | undefined, b: string | undefined): number;
|
|
183
|
+
declare function profileCookieName(cookiesPrefix: string): string;
|
|
184
|
+
declare function discoveredProfileCookieName(tenantId: string): string;
|
|
185
|
+
/**
|
|
99
186
|
* Minimal logger interface compatible with common structured logging patterns.
|
|
100
187
|
*/
|
|
101
188
|
interface Logger {
|
|
@@ -2258,20 +2345,18 @@ type IamPrincipalKind = {
|
|
|
2258
2345
|
assignment: IamAssignmentPolicy;
|
|
2259
2346
|
delta?: IamDeltaMode;
|
|
2260
2347
|
};
|
|
2348
|
+
/**
|
|
2349
|
+
* Destination-side inbox contract. The destination owns idempotency: when a pending request
|
|
2350
|
+
* already exists for the same (subjectType, subject, target, operation) tuple, `create` must
|
|
2351
|
+
* return that request with `created: false` (the handler answers 200 instead of 201). Operation
|
|
2352
|
+
* arrays are forbidden — one request carries exactly one `'grant' | 'revoke'`.
|
|
2353
|
+
*/
|
|
2261
2354
|
type IAMAccessRequestsConfig = {
|
|
2262
2355
|
create: (request: AccessRequestCreate) => Promise<{
|
|
2263
2356
|
request: AccessRequestResult;
|
|
2264
2357
|
created: boolean;
|
|
2265
2358
|
}>;
|
|
2266
2359
|
};
|
|
2267
|
-
type AccessRequestSubmit = {
|
|
2268
|
-
subject: AccessChange["subject"];
|
|
2269
|
-
subjectType: SubjectType;
|
|
2270
|
-
targetType: EntitlementType;
|
|
2271
|
-
target: AccessChange["target"];
|
|
2272
|
-
operation: "grant" | "revoke";
|
|
2273
|
-
justification?: string;
|
|
2274
|
-
};
|
|
2275
2360
|
type IAMEntitlementRequestUrlContext = {
|
|
2276
2361
|
request: Request;
|
|
2277
2362
|
tenantId?: string;
|
|
@@ -3003,6 +3088,22 @@ interface SessionStore<TExtended = object> {
|
|
|
3003
3088
|
*/
|
|
3004
3089
|
delete(sid: string): Promise<void>;
|
|
3005
3090
|
}
|
|
3091
|
+
type DisplayCookieAttributes = {
|
|
3092
|
+
path: string;
|
|
3093
|
+
domain?: string;
|
|
3094
|
+
secure: boolean;
|
|
3095
|
+
sameSite: "Strict" | "Lax";
|
|
3096
|
+
};
|
|
3097
|
+
type DisplayCookieCandidate = ParsedDisplayCookie & {
|
|
3098
|
+
kind: "session" | "discovered";
|
|
3099
|
+
/** Authoritative session-window expiry from the peer session record. */
|
|
3100
|
+
sessionExpiresAt?: Date;
|
|
3101
|
+
live: boolean;
|
|
3102
|
+
};
|
|
3103
|
+
type DisplayCookieTrim = (candidates: DisplayCookieCandidate[], options: {
|
|
3104
|
+
max: number;
|
|
3105
|
+
maxDiscovered: number;
|
|
3106
|
+
}) => DisplayCookieCandidate[];
|
|
3006
3107
|
/**
|
|
3007
3108
|
* What a login/logout `after*` hook may return:
|
|
3008
3109
|
* - a `string` destination (validated against the same-origin safety floor),
|
|
@@ -3029,6 +3130,10 @@ type AfterLoginContext<
|
|
|
3029
3130
|
> = {
|
|
3030
3131
|
request: Request;
|
|
3031
3132
|
context?: TCtx;
|
|
3133
|
+
/** Current Ops policy for App-invoked discovered-tenant cookie planning. */
|
|
3134
|
+
displayCookie?: DisplayCookieConfig;
|
|
3135
|
+
/** Effective attributes shared by SDK session/display cookies. */
|
|
3136
|
+
displayCookieAttributes: DisplayCookieAttributes;
|
|
3032
3137
|
} & ({
|
|
3033
3138
|
ok: true;
|
|
3034
3139
|
user: TUser;
|
|
@@ -3089,6 +3194,85 @@ type IdentityResolution<T> = {
|
|
|
3089
3194
|
};
|
|
3090
3195
|
import { StandardSchemaV1 as StandardSchemaV16 } from "@standard-schema/spec";
|
|
3091
3196
|
/**
|
|
3197
|
+
* Header media types are intentionally limited to values the SDK puts on the wire or has committed
|
|
3198
|
+
* to use. This is not a general MIME-type catalog; format metadata belongs with its owning feature.
|
|
3199
|
+
*/
|
|
3200
|
+
declare const JSON_MEDIA_TYPE = "application/json";
|
|
3201
|
+
declare const SCIM_MEDIA_TYPE = "application/scim+json";
|
|
3202
|
+
declare const FORM_MEDIA_TYPE = "application/x-www-form-urlencoded";
|
|
3203
|
+
declare const XML_MEDIA_TYPE = "application/xml";
|
|
3204
|
+
declare const OCTET_STREAM_MEDIA_TYPE = "application/octet-stream";
|
|
3205
|
+
/** Spreadable `Accept` header for outbound requests that expect a JSON body. */
|
|
3206
|
+
declare const ACCEPT_JSON: Readonly<{
|
|
3207
|
+
Accept: typeof JSON_MEDIA_TYPE;
|
|
3208
|
+
}>;
|
|
3209
|
+
/**
|
|
3210
|
+
* Spreadable `Accept` header for outbound SCIM requests. Plain JSON is listed second so an
|
|
3211
|
+
* intermediary that only negotiates it can still match, while RFC 7644 servers keep answering
|
|
3212
|
+
* `application/scim+json`.
|
|
3213
|
+
*/
|
|
3214
|
+
declare const ACCEPT_SCIM: Readonly<{
|
|
3215
|
+
Accept: `${typeof SCIM_MEDIA_TYPE}, ${typeof JSON_MEDIA_TYPE}`;
|
|
3216
|
+
}>;
|
|
3217
|
+
/** Spreadable `Accept` header reserved for SAML and other XML document retrieval. */
|
|
3218
|
+
declare const ACCEPT_XML: Readonly<{
|
|
3219
|
+
Accept: typeof XML_MEDIA_TYPE;
|
|
3220
|
+
}>;
|
|
3221
|
+
/** Spreadable `Accept` header reserved for binary secret and file retrieval. */
|
|
3222
|
+
declare const ACCEPT_OCTET_STREAM: Readonly<{
|
|
3223
|
+
Accept: typeof OCTET_STREAM_MEDIA_TYPE;
|
|
3224
|
+
}>;
|
|
3225
|
+
/** Spreadable `Content-Type` header for a JSON body. */
|
|
3226
|
+
declare const CONTENT_TYPE_JSON: Readonly<{
|
|
3227
|
+
"Content-Type": typeof JSON_MEDIA_TYPE;
|
|
3228
|
+
}>;
|
|
3229
|
+
/** Spreadable `Content-Type` header for an RFC 7644 SCIM body. */
|
|
3230
|
+
declare const CONTENT_TYPE_SCIM: Readonly<{
|
|
3231
|
+
"Content-Type": typeof SCIM_MEDIA_TYPE;
|
|
3232
|
+
}>;
|
|
3233
|
+
/** Spreadable `Content-Type` header for a URL-encoded form body. */
|
|
3234
|
+
declare const CONTENT_TYPE_FORM: Readonly<{
|
|
3235
|
+
"Content-Type": typeof FORM_MEDIA_TYPE;
|
|
3236
|
+
}>;
|
|
3237
|
+
/** Spreadable `Content-Type` header for an XML body. */
|
|
3238
|
+
declare const CONTENT_TYPE_XML: Readonly<{
|
|
3239
|
+
"Content-Type": typeof XML_MEDIA_TYPE;
|
|
3240
|
+
}>;
|
|
3241
|
+
/** Spreadable `Content-Type` header for an opaque binary body. */
|
|
3242
|
+
declare const CONTENT_TYPE_OCTET_STREAM: Readonly<{
|
|
3243
|
+
"Content-Type": typeof OCTET_STREAM_MEDIA_TYPE;
|
|
3244
|
+
}>;
|
|
3245
|
+
/** Bounded diagnostic view of a response body that was not the expected representation. */
|
|
3246
|
+
type UnexpectedBodySummary = {
|
|
3247
|
+
contentType?: string;
|
|
3248
|
+
/** HTML `<title>` when present, else (unless redacted) the first ~300 chars of body text. */
|
|
3249
|
+
excerpt?: string;
|
|
3250
|
+
};
|
|
3251
|
+
type ReadJsonResponseOptions = {
|
|
3252
|
+
log?: Logger;
|
|
3253
|
+
/** `ion.operation` value for the mismatch warning (defaults to `http.response`). */
|
|
3254
|
+
operation?: string;
|
|
3255
|
+
/** Secret-bearing transports set this so the excerpt never carries raw body text (title only). */
|
|
3256
|
+
redact?: boolean;
|
|
3257
|
+
};
|
|
3258
|
+
/** Whether the response declares a JSON-compatible media type (`application/json` or any `+json`). */
|
|
3259
|
+
declare function isJsonResponse(response: Response): boolean;
|
|
3260
|
+
/**
|
|
3261
|
+
* Summarize a body the caller did not expect (typically an intermediary's HTML error page) as
|
|
3262
|
+
* `{ contentType, excerpt }` without ever surfacing the full payload. Consumes the response body;
|
|
3263
|
+
* pass a `.clone()` when the original must remain readable.
|
|
3264
|
+
*/
|
|
3265
|
+
declare function unexpectedBodySummary(response: Response, options?: {
|
|
3266
|
+
redact?: boolean;
|
|
3267
|
+
}): Promise<UnexpectedBodySummary>;
|
|
3268
|
+
/**
|
|
3269
|
+
* Parse an expected-JSON response after verifying its media type. A non-JSON body (a proxy, tunnel,
|
|
3270
|
+
* or misconfigured origin answering instead of the service) warn-logs `reason: 'non_json_response'`
|
|
3271
|
+
* with a bounded, title-first excerpt and throws — the mismatch must reach Ops as an operational
|
|
3272
|
+
* signal, never as an opaque JSON parse error.
|
|
3273
|
+
*/
|
|
3274
|
+
declare function readJsonResponse<T>(response: Response, options?: ReadJsonResponseOptions): Promise<T>;
|
|
3275
|
+
/**
|
|
3092
3276
|
* Result type for Standard Schema validation (success or failure).
|
|
3093
3277
|
*/
|
|
3094
3278
|
type ValidateResult<T> = StandardSchemaV16.Result<T>;
|
|
@@ -3183,6 +3367,11 @@ type SSOConfig<
|
|
|
3183
3367
|
cookiesSecure?: boolean;
|
|
3184
3368
|
cookiesSameSite?: "Strict" | "Lax";
|
|
3185
3369
|
/**
|
|
3370
|
+
* Parent hostname shared by host-scoped tenants. Omit for host-only cookies.
|
|
3371
|
+
* ConfigSource-only; must match the App's host routing `baseDomain`.
|
|
3372
|
+
*/
|
|
3373
|
+
cookiesDomain?: string;
|
|
3374
|
+
/**
|
|
3186
3375
|
* Optional tenant/application id copied into server-side sessions.
|
|
3187
3376
|
* Server integrations default this from the Ionite instance id.
|
|
3188
3377
|
*/
|
|
@@ -3243,6 +3432,28 @@ type SSOConfig<
|
|
|
3243
3432
|
* @default 86400
|
|
3244
3433
|
*/
|
|
3245
3434
|
sessionWindowSeconds?: number;
|
|
3435
|
+
/**
|
|
3436
|
+
* Browser-readable display cookie beside the opaque session cookie. ConfigSource-only.
|
|
3437
|
+
* Off unless `enabled` is true. The server never reads this cookie to authenticate.
|
|
3438
|
+
*/
|
|
3439
|
+
displayCookie?: DisplayCookieConfig;
|
|
3440
|
+
/**
|
|
3441
|
+
* What `GET ${basePath}/auth/user` returns. ConfigSource-only.
|
|
3442
|
+
* `full` is the verified user, `display` is the {@link displayUser} projection, `off` is 404.
|
|
3443
|
+
* @default 'full'
|
|
3444
|
+
*/
|
|
3445
|
+
userEndpoint?: UserEndpointPolicy;
|
|
3446
|
+
/**
|
|
3447
|
+
* Code-only projection of the full user into the display cookie and the `display` user endpoint.
|
|
3448
|
+
* Omitted: name, email, and avatar. Cannot override a disabled {@link displayCookie}.
|
|
3449
|
+
*/
|
|
3450
|
+
displayUser?: (user: WorkforceUser) => unknown;
|
|
3451
|
+
/**
|
|
3452
|
+
* Code-only cap trim. Candidates are live sessions newest first, then discovered hints newest
|
|
3453
|
+
* first. `max` and `maxDiscovered` are enforced independently after the hook; the session cookie
|
|
3454
|
+
* being written is kept even if this hook omits it.
|
|
3455
|
+
*/
|
|
3456
|
+
trimDisplayCookies?: DisplayCookieTrim;
|
|
3246
3457
|
} & SSOHandlerConfig;
|
|
3247
3458
|
type StateCookie = {
|
|
3248
3459
|
state: string;
|
|
@@ -4506,6 +4717,33 @@ type CIAMConfig<
|
|
|
4506
4717
|
*/
|
|
4507
4718
|
cookiesSameSite?: "Strict" | "Lax";
|
|
4508
4719
|
/**
|
|
4720
|
+
* Parent hostname shared by host-scoped tenants. Omit for host-only cookies.
|
|
4721
|
+
* ConfigSource-only; must match the App's host routing `baseDomain`.
|
|
4722
|
+
*/
|
|
4723
|
+
cookiesDomain?: string;
|
|
4724
|
+
/**
|
|
4725
|
+
* Browser-readable display cookie beside the opaque customer session cookie. ConfigSource-only.
|
|
4726
|
+
* Off unless `enabled` is true. The server never reads this cookie to authenticate.
|
|
4727
|
+
*/
|
|
4728
|
+
displayCookie?: DisplayCookieConfig;
|
|
4729
|
+
/**
|
|
4730
|
+
* What `GET ${basePath}/auth/customer` returns. ConfigSource-only.
|
|
4731
|
+
* `full` is the verified customer, `display` is the {@link displayUser} projection, `off` is 404.
|
|
4732
|
+
* @default 'full'
|
|
4733
|
+
*/
|
|
4734
|
+
userEndpoint?: UserEndpointPolicy;
|
|
4735
|
+
/**
|
|
4736
|
+
* Code-only projection of the full customer into the display cookie and the `display` customer
|
|
4737
|
+
* endpoint. Omitted: name, email, and avatar. Cannot override a disabled {@link displayCookie}.
|
|
4738
|
+
*/
|
|
4739
|
+
displayUser?: (user: Customer) => unknown;
|
|
4740
|
+
/**
|
|
4741
|
+
* Code-only cap trim. Candidates are live sessions newest first, then discovered hints newest
|
|
4742
|
+
* first. `max` and `maxDiscovered` are enforced independently after the hook; the session cookie
|
|
4743
|
+
* being written is kept even if this hook omits it.
|
|
4744
|
+
*/
|
|
4745
|
+
trimDisplayCookies?: DisplayCookieTrim;
|
|
4746
|
+
/**
|
|
4509
4747
|
* Optional tenant/application id copied into server-side sessions.
|
|
4510
4748
|
* Server integrations default this from the Ionite instance id.
|
|
4511
4749
|
*/
|
|
@@ -4578,6 +4816,8 @@ type CIAM<
|
|
|
4578
4816
|
resolveCustomer: (request: Request) => Promise<IdentityResolution<Customer>>;
|
|
4579
4817
|
logout: (request: Request) => Promise<Response>;
|
|
4580
4818
|
handler: (request: Request) => Promise<Response>;
|
|
4819
|
+
/** `GET ${basePath}/auth/customer`, including the Ops `userEndpoint` policy and display-cookie sync. */
|
|
4820
|
+
customerHandler: (request: Request) => Promise<Response>;
|
|
4581
4821
|
/**
|
|
4582
4822
|
* Returns the sanitized, ordered list of enabled customer-login providers
|
|
4583
4823
|
* for the given request origin (never includes secrets).
|
|
@@ -4993,6 +5233,14 @@ type FrameworkTmConfig<TTenant extends BaseTenant = BaseTenant> = {
|
|
|
4993
5233
|
tenant: TTenant;
|
|
4994
5234
|
previousLocator?: ConfigLocator;
|
|
4995
5235
|
}) => void | Promise<void>;
|
|
5236
|
+
/** Runs after a tenant POST has durably upserted its row. Awaited; the return value is ignored and failures are logged without rolling back the tenant. */
|
|
5237
|
+
onTenantCreated?: (context: {
|
|
5238
|
+
tenant: TTenant;
|
|
5239
|
+
}) => unknown;
|
|
5240
|
+
/** Runs after a tenant DELETE has removed its row. Awaited; the return value is ignored and failures are logged without changing the HTTP result. */
|
|
5241
|
+
onTenantDeleted?: (context: {
|
|
5242
|
+
tenantId: string;
|
|
5243
|
+
}) => unknown;
|
|
4996
5244
|
};
|
|
4997
5245
|
type RecordTenantConsentInput = {
|
|
4998
5246
|
handle: string;
|
|
@@ -5049,6 +5297,25 @@ type TenantIonCache = {
|
|
|
5049
5297
|
fetch(id: string): Promise<Ionite | undefined>;
|
|
5050
5298
|
delete(id: string): unknown;
|
|
5051
5299
|
};
|
|
5300
|
+
type TenantDirectoryIdentity = {
|
|
5301
|
+
id?: string;
|
|
5302
|
+
email?: string;
|
|
5303
|
+
externalId?: string;
|
|
5304
|
+
};
|
|
5305
|
+
/**
|
|
5306
|
+
* Optional App-owned identity-to-tenant directory. This is deliberately separate from
|
|
5307
|
+
* {@link TenantStore}: tenant routing, Tenant Management, and ordinary multi-tenant Apps never need
|
|
5308
|
+
* these methods.
|
|
5309
|
+
*
|
|
5310
|
+
* Implement `findUserTenants` only for post-login directory discovery (for example, seeding
|
|
5311
|
+
* short-lived discovered-tenant display cookies). Implement `findTenantsByEmailDomain` only for
|
|
5312
|
+
* pre-login home-realm discovery where a domain is genuinely authoritative. The SDK never calls
|
|
5313
|
+
* either method implicitly; omitting both changes no SDK behavior.
|
|
5314
|
+
*/
|
|
5315
|
+
interface TenantDirectory<TTenant extends BaseTenant = BaseTenant> {
|
|
5316
|
+
findUserTenants?(identity: TenantDirectoryIdentity, options?: ListOptions): Promise<ListResult<TTenant>>;
|
|
5317
|
+
findTenantsByEmailDomain?(domain: string, options?: ListOptions): Promise<ListResult<TTenant>>;
|
|
5318
|
+
}
|
|
5052
5319
|
interface TenantStore<TTenant extends BaseTenant = BaseTenant> {
|
|
5053
5320
|
get(id: string): Promise<TTenant | undefined>;
|
|
5054
5321
|
list(options?: ListOptions): Promise<ListResult<TTenant>>;
|
|
@@ -5793,6 +6060,10 @@ type Authz = {
|
|
|
5793
6060
|
entitlements: {
|
|
5794
6061
|
list(options?: ListOptions): Promise<ListResult<Entitlement>>;
|
|
5795
6062
|
};
|
|
6063
|
+
/** Durable catalog authority, when wired. Used by explicit app-owned entitlement lifecycles. */
|
|
6064
|
+
readonly catalogStore?: AccessCatalogStore;
|
|
6065
|
+
/** Durable direct-grant authority, when wired. Used by explicit app-owned grant lifecycles. */
|
|
6066
|
+
readonly accessStore?: AccessAssignmentStore;
|
|
5796
6067
|
/** The wired closure index powering `has*`, when the app provided one via stores. */
|
|
5797
6068
|
accessIndex?: AccessIndex;
|
|
5798
6069
|
has(subject: AccessRef<BaseUser>, targetType: OaaAccessTargetType, target: AccessRef<Group | Role | Permission>, resource: AccessRef<Resource> | undefined, subjectType: SubjectType): Promise<AuthzDecision>;
|
|
@@ -6173,24 +6444,46 @@ type TenantPathRoutingStrategy = {
|
|
|
6173
6444
|
ui?: TenantPathNamespace;
|
|
6174
6445
|
api?: TenantPathNamespace;
|
|
6175
6446
|
};
|
|
6447
|
+
type TenantHostRoutingStrategy = {
|
|
6448
|
+
type: "host";
|
|
6449
|
+
baseDomain: string;
|
|
6450
|
+
};
|
|
6451
|
+
type TenantSelectorRoutingStrategy = {
|
|
6452
|
+
type: "selector";
|
|
6453
|
+
};
|
|
6176
6454
|
/**
|
|
6177
|
-
*
|
|
6178
|
-
*
|
|
6179
|
-
*
|
|
6180
|
-
* resolver (see `ResolveTenantFromRequestOptions.custom`) that does its own validation.
|
|
6455
|
+
* Routing selects which tenant runtime should handle a request; it never authenticates that choice.
|
|
6456
|
+
* Path segments, hosts, headers, and cookies are all untrusted selectors. Every strategy must still
|
|
6457
|
+
* enforce the SDK's tenant-bound session check before serving tenant data.
|
|
6181
6458
|
*/
|
|
6182
|
-
type TenantRoutingStrategy = TenantPathRoutingStrategy;
|
|
6459
|
+
type TenantRoutingStrategy = TenantPathRoutingStrategy | TenantHostRoutingStrategy | TenantSelectorRoutingStrategy;
|
|
6183
6460
|
type TenantPathMatch = {
|
|
6184
6461
|
id: string;
|
|
6185
6462
|
restSegments: string[];
|
|
6186
6463
|
restPath: string;
|
|
6187
6464
|
};
|
|
6465
|
+
type TenantHostMatch = {
|
|
6466
|
+
id: string;
|
|
6467
|
+
};
|
|
6188
6468
|
declare const DEFAULT_TENANT_UI_NAMESPACE: TenantPathNamespace;
|
|
6189
6469
|
declare const DEFAULT_TENANT_API_NAMESPACE: TenantPathNamespace;
|
|
6190
6470
|
declare function normalizeTenantPathNamespace(namespace?: TenantPathNamespace): TenantPathNamespace;
|
|
6191
|
-
declare function normalizeTenantRoutingStrategy(strategy?: TenantRoutingStrategy):
|
|
6471
|
+
declare function normalizeTenantRoutingStrategy(strategy?: TenantRoutingStrategy): TenantRoutingStrategy;
|
|
6472
|
+
/**
|
|
6473
|
+
* Throws on an empty result: a host strategy with no `baseDomain` would otherwise silently match no
|
|
6474
|
+
* host and every tenant request would 404 with nothing pointing at the configuration mistake.
|
|
6475
|
+
*/
|
|
6476
|
+
declare function normalizeTenantBaseDomain(baseDomain: string): string;
|
|
6477
|
+
declare function matchTenantHost(hostname: string, baseDomain: string): TenantHostMatch | null;
|
|
6192
6478
|
declare function matchTenantPath(pathname: string, namespace?: TenantPathNamespace): TenantPathMatch | null;
|
|
6193
6479
|
declare function buildTenantPath(id: string, restPath?: string, namespace?: TenantPathNamespace): string;
|
|
6480
|
+
/**
|
|
6481
|
+
* Only the path strategy encodes the tenant in a URL the SDK can build. Host and selector strategies
|
|
6482
|
+
* return the normalized `restPath` unchanged because the tenant is carried elsewhere (the origin, or
|
|
6483
|
+
* App-owned selector state): a scheme-relative `//{id}.{baseDomain}` guess would break behind port
|
|
6484
|
+
* mappings and dev proxies, and a selector switch is a mutation the App must perform explicitly.
|
|
6485
|
+
*/
|
|
6486
|
+
declare function buildTenantUrl(id: string, restPath?: string, strategy?: TenantRoutingStrategy, namespace?: "api" | "ui"): string;
|
|
6194
6487
|
import { StandardSchemaV1 as StandardSchemaV110 } from "@standard-schema/spec";
|
|
6195
6488
|
type RegisterSSOAppPayload = {
|
|
6196
6489
|
/** Redirect URIs for the client. */
|
|
@@ -6321,4 +6614,4 @@ type LfvErrorResponse = {
|
|
|
6321
6614
|
};
|
|
6322
6615
|
/** Generates a ULID */
|
|
6323
6616
|
declare function generateULID(prefix?: string): string;
|
|
6324
|
-
export { AccessAssignmentStore, AccessCatalogStore, AccessChange, AccessCheckReason, AccessCheckResult, AccessCheckTarget, AccessIndex, AccessMutationResult, AccessMutationStatus, AccessProvenance, AccessRef, AccessRequestCreate, AccessRequestResult,
|
|
6617
|
+
export { ACCEPT_JSON, ACCEPT_OCTET_STREAM, ACCEPT_SCIM, ACCEPT_XML, AccessAssignmentStore, AccessCatalogStore, AccessChange, AccessCheckReason, AccessCheckResult, AccessCheckTarget, AccessIndex, AccessMutationResult, AccessMutationStatus, AccessProvenance, AccessRef, AccessRequestCreate, AccessRequestResult, AccessStatus, Address, ApplicationValidators, AssignmentPolicyError, AuthenticatedPrincipal, AuthenticatedUser, Authz, AuthzConfig, AuthzDecision, AuthzEntityBase, AuthzOaaConfig, AuthzOaaPrincipalConfig, AuthzScimGroupExtension, AuthzScimGroupType, AwsConfigLocator, AwsSecretsConfig, AzureAuthMethod, AzureConfigLocator, AzureSecretsConfig, BaseCustomer, BaseTenant, BaseUser, BaseWorkloadIdentity, CANONICAL_RISK_LEVELS, CIAM, CIAMConfig, CIAMConfigFromCode, CIAMConfigFromCodeInput, CIAMProviderBranding, CIAMProviderColors, CIAMProviderConfig, CIAMProviderDescriptor, CIAMProviderType, CIAMValidators, CONTENT_TYPE_FORM, CONTENT_TYPE_JSON, CONTENT_TYPE_OCTET_STREAM, CONTENT_TYPE_SCIM, CONTENT_TYPE_XML, CacheConfig, CachedWorkloadToken, CapabilitiezManifest, CapabilityEndpointUrls, CapabilityKey, CapabilityState, CatalogChange, CatalogChangeKind, CatalogChangeListener, CatalogEntityKind, ChangeListener, ClientCredentialsWorkloadConfig, CodeCatalog, CodeCatalogInput, CodeCatalogNamespace, ConfigApplyStatus, ConfigChangeCallback, ConfigChangeOptions, ConfigChangeResult, ConfigErrorKind, ConfigExportEnvelope, ConfigLocator, ConfigSource, ConfigSourceEnv, ConfigSourceError, ConfigSourceErrorInit, ConfigSourceResolver, ConfigSourceType, ConfigSubscriptionOptions, ConnectRequestContext, CreateGroupOptions, CreateTenantRequest, CreateUserOptions, Customer, CustomerStore, CustomerStoreOptions, DEFAULT_DISCOVERED_COOKIE_MAX, DEFAULT_DISCOVERED_COOKIE_TTL_SECONDS, DEFAULT_DISPLAY_COOKIE_MAX, DEFAULT_RISK_LEVEL, DEFAULT_SECRET_MIME_TYPES, DEFAULT_TENANT_API_NAMESPACE, DEFAULT_TENANT_UI_NAMESPACE, DISCOVERED_COOKIE_PREFIX, DISPLAY_COOKIE_SUFFIX, DISPLAY_COOKIE_VERSION, DestinationReference, DevSecretsConfig, DiscoveredDisplayCookieConfig, DisplayAuthType, DisplayCookieConfig, DisplayCookieEnvelope, DisplayIdentity, DisplayUser, ECID_SCHEME, EcidFormatError, EffectiveEdge, EgressChannelOutcome, EgressOutcome, Email, EndpointOperation, EndpointPermission, EnterpriseExtension, Entitlement, EntitlementType, EntityStore, EnvironmentType, FORM_MEDIA_TYPE, FrameworkConfig, FrameworkConfigInput, FrameworkLfvConfig, FrameworkOtelConfig, FrameworkSecretsModuleConfig, FrameworkSecretsSourceConfig, FrameworkStores, FrameworkTmConfig, FrameworkWorkloadConfig, FrameworkWorkloadConfigFromCode, FrameworkWorkloadIncomingOutgoing, GcpConfigLocator, GcpSecretsConfig, Group, GroupMember, GroupResource, GroupsInboundHandlerConfig, IAM, IAMAccessRequestsConfig, IAMAppRegistry, IAMAppValidators, IAMConfig, IAMConfigFromCode, IAMDiscoveryConfig, IAMDiscoveryContext, IAMDiscoveryHandlerConfig, IAMEndpointFlag, IAMGroupsInbound, IAMGroupsOutbound, IAMHandlerConfig, IAMInboundCustomersConfig, IAMInboundPrincipalContext, IAMInboundUserContext, IAMInboundUsersConfig, IAMInboundWorkloadsConfig, IAMPrincipalsInbound, IAMUsersInbound, IAMValidators, ION_AUTHZ_GROUP_SCHEMA, ION_AUTHZ_OAA_SYNC, ION_CAPABILITIEZ_READ, ION_CIAM_MAGIC_LINK_CREATE, ION_ENDPOINT_PERMISSIONS, ION_IAM_ACCESS_REQUESTS_WRITE, ION_IAM_CUSTOMERS_WRITE, ION_IAM_GROUPS_WRITE, ION_IAM_READ, ION_IAM_USERS_WRITE, ION_IAM_WORKLOADS_WRITE, ION_SCIM_CUSTOMER_SCHEMA, ION_SCIM_USER_EXTENSION_URN, ION_SCIM_WORKLOAD_SCHEMA, ION_SDK_PERMISSIONS, ION_TENANT_MANAGE, IamAssignmentPolicy, IamDeltaEmitter, IamDeltaMode, IamDeltaReconcileInput, IamDeltaReconcileResult, IamDeltaResourceType, IamPrincipalKind, IamPrincipalKindFlag, IdTokenClaims, IdentityResolution, InMemoryTenantStoreOptions, InferSecretType, Ionite, IoniteBase, IoniteError, IoniteErrorOptions, IoniteUserExtension, IoniteValidators, JSON_MEDIA_TYPE, JWTAssertionClaims, JwtBearerWorkloadConfig, KNOWN_BASE_CUSTOMER_KEYS, KNOWN_BASE_USER_KEYS, KNOWN_ENTITLEMENT_KEYS, KNOWN_WORKLOAD_KEYS, Kms, KmsAddKeysRequest, KmsAddKeysResult, KmsAllocationPolicy, KmsAllocationStrategy, KmsConfig, KmsIssuedKey, KmsIssuerEvent, KmsIssuerEventListener, KmsIssuerEventName, KmsKey, KmsKeyState, KmsParkDisposition, KmsParkReport, KmsParkRequest, KmsParkResult, KmsPool, KmsPoolConfig, KmsPoolControlDocument, KmsPoolDocument, KmsPoolIssuer, KmsPoolListener, KmsPoolSlot, KmsRevokeKeyRequest, KmsRevokeKeyResult, LfvActionAcceptedResponse, LfvActionName, LfvActionRequestBase, LfvCallbackEnvelope, LfvCallbackHeaders, LfvCallbackKind, LfvCallbackTransport, LfvEd25519PrivateJwk, LfvEd25519PublicJwk, LfvErrorCode, LfvErrorResponse, LfvJwks, LfvOtpRequest, LfvOtpResponse, ListFilter, ListOptions, ListResult, Logger, MagicLink, MagicLinkStore, MetaData, MirrorConfigLocator, ModifiableFrameworkConfig, ModuleName, ModuleReadiness, ModuleReadinessState, Name, NoReserved, OCTET_STREAM_MEDIA_TYPE, OaaAccessChangeBatchItem, OaaAccessTargetType, OaaClient, OaaPrincipalPopulation, OaaSyncInput, OaaSyncOptions, OaaSyncResult, OidcCallbackParams, Otel, OtelAttributeValue, OtelAttributes, OtelConfig, OtelConsoleMode, OtelLevels, OtelLogLevel, OtelLogRecord, OtelMetricsSignalConfig, OtelOAuthClientCredentialsConfig, OtelProtocol, OtelProviderType, OtelSignalConfig, OtelSignalName, PLATFORM_ASSIGNABLE_SUBJECT_TYPES, ParsedEcid, Permission, PhoneNumber, Photo, PrincipalInboundHandlerConfig, ReactiveHandle, ReadJsonResponseOptions, ReadinessReport, ReadyAccessCatalogEntry, ReadyzEndpointConfig, ReconcileReport, RecordTenantConsentInput, RegisterIAMAppError, RegisterIAMAppPayload, RegisterIAMAppResult, RegisterSSOAppError, RegisterSSOAppPayload, RegisterSSOAppResult, RemoteConfig, RemoteConfigLoadErrorKind, RemoteConfigRetryContext, RemoteConfigRetryHook, RemoteConfigRetryOptions, RemoteTmConfig, RequireReadyResult, ResolvedRoute, ResolvedVaultLfvSecretsConfig, Resource, ResourceChange, ResourceChangeListener, ResourceProvider, RiskLevel, Role, RouteFilterResult, RouteModule, RoutingOptions, SCIM_MEDIA_TYPE, SSO, SSOAppRegistry, SSOAppValidators, SSOConfig, SSOConfigFromCode, SSOHandlerConfig, SSOValidators, ScimAuthenticationScheme, ScimCustomer, ScimError, Group2 as ScimGroup, ScimListResponse, ScimMutationSummary, ScimResourceType, ScimResourceTypeSchemaExtension, ScimResult, Role2 as ScimRole, ScimSchemaAttributeDefinition, ScimSchemaDefinition, ScimServiceProviderConfig, User as ScimUser, ScimWorkload, Secret, SecretContentType, SecretContentTypeMismatchError, SecretEvent, SecretEventListener, SecretEventName, SecretFormat, SecretHandle, SecretLifecycleRequest, SecretRequestSeverity, SecretTypeDescriptor, SecretTypeInput, SecretTypeRegistryEntry, Secrets, SecretsModuleConfig, SecretsOperationOptions, SecretsSource, SecretsSourceConfig, SecretsSourceMap, SecretsSourceType, SecretsSubscriptionOptions, SecretsValidators, SecretsWriteOptions, ServerOnlyWorkloadConfig, Session, SessionStore, SetTenantIntegrationOptions, StagedIntegration, StandardSchemaWithValidate, StateCookie, StoreConflictError, StoreConflictKind, SubjectRef, SubjectScope, SubjectType, SubjectTypeScoping, SubscriptionMode, TenantDirectory, TenantDirectoryIdentity, TenantHostMatch, TenantHostRoutingStrategy, TenantIntegration, TenantIntegrationStatus, TenantIntegrationView, TenantIonCache, TenantManagement, TenantPathMatch, TenantPathNamespace, TenantPathRoutingStrategy, TenantResponse, TenantRoutingStrategy, TenantSelectorRoutingStrategy, TenantStatus, TenantStore, TenantValidators, TenantWebhookPayload, TmIntegratorConfig, TokenResponse, TokenValidationResult, TrustedIdp, TrustedProvisioningClient, UnexpectedBodySummary, UpdateTenantRequest, UserEndpointPolicy, UserStore, UserStoreOptions, UsersInboundHandlerConfig, ValidateResult, VaultConfigLocator, VaultLfvSecretsConfig, VaultSecretsConfig, VaultWebSocketAuthHeader, VaultWebSocketSecretsConfig, VaultWorkloadAuthConfig, WorkforceUser, Workload, WorkloadClient, WorkloadConfig, WorkloadConfigMap, WorkloadGetToken, WorkloadIdentity, WorkloadIdentityStore, WorkloadIncomingOutgoing, WorkloadPrincipal, WorkloadTokenResponse, WorkloadTokenStore, WorkloadValidators, X509Certificate, XML_MEDIA_TYPE, accessRefId, accessRootId, assertEcid, assertRequiredSubjectType, assertValidSubjectTypeScoping, buildTenantPath, buildTenantUrl, catalogEntityStore, claimsToUser, compareDisplayExpiryDesc, configTrustedClientGrants, customAttributes, customerResourceSchema, debugLogger, decodeDisplayCookie, decodeUser, deepEqualPlain, defaultDisplayUser, defaultLogger, defaultSecretContentType, defineCatalog, defineSecretType, deprecateRetiredCodeCatalogRows, discoveredProfileCookieName, encodeDisplayCookie, formatEcid, formatLogLine, generateULID, getCodeCatalogEntity, groupResourceSchema, idTokenClaimsSchema, infoLogger, isCodeCatalog, isConfigLocator, isConfigSourceError, isEcid, isJsonResponse, isStoreConflictError, jwtAssertionClaimsSchema, list, listGenerator, matchTenantHost, matchTenantPath, matchesListFilter, materializeCodeCatalogEntity, mergeCodeCatalogEntity, mergeConfig, must, normalizeTenantBaseDomain, normalizeTenantPathNamespace, normalizeTenantRoutingStrategy, oidcCallbackSchema, parseEcid, parseJsonc, parseKmsPoolControlDocument, parseKmsPoolDocument, prettyLogger, profileCookieName, projectDisplayUser, readDisplayCookies, readJsonResponse, readyCatalogEntry, remoteConfigSecretType, resolveDiscoveredCookieMax, resolveDiscoveredCookieTtlSeconds, resolveDisplayCookieMax, sanitizeDisplayUser, serializeConfig, silentLogger, stableConfigHash, stripJsonComments, tmIntegrationState, toCodeCatalog, tokenResponseSchema, trimTrailingSlash, trustedClientPermissionsForPrincipal, unexpectedBodySummary, unionCatalogRead, userSchema, validationFailureResponse, version, waitOn, warnLogger, withValidate, workloadResourceSchema, workloadTokenResponseSchema };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`,"\\n")}function $e(O,_,z){if(z==null)return;if(z instanceof Error){if(O.push(`${_}.name=${Ee(z.name)}`),O.push(`${_}.message=${Ee(z.message)}`),z.stack)O.push(`${_}.stack=${Ee(z.stack)}`);return}O.push(`${_}=${Ee(z)}`)}function Te(O,_,z=[],Z=new Date){let ge=st(_ instanceof Error?_.message:_??""),te=[];for(let[le,fe]of z.entries()){if(fe&&typeof fe==="object"&&!Array.isArray(fe)&&!(fe instanceof Error)&&Object.getPrototypeOf(fe)===Object.prototype){for(let[ye,ke]of Object.entries(fe))$e(te,ye,ke);continue}$e(te,`param.${le}`,fe)}return[Z.toISOString(),nt[O],ge,...te].filter(Boolean).join(" ")}var Ue={trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},it=Ue,at={trace:()=>{},debug:console.debug,info:console.info,warn:console.warn,error:console.error},pt={trace:()=>{},debug:()=>{},info:console.info,warn:console.warn,error:console.error},ct={trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},mt={trace:()=>{},debug:(O,..._)=>globalThis.console.debug(Te("debug",O,_)),info:(O,..._)=>globalThis.console.info(Te("info",O,_)),warn:(O,..._)=>globalThis.console.warn(Te("warn",O,_)),error:(O,..._)=>globalThis.console.error(Te("error",O,_))};function ut(O,_){if(typeof _!=="number"||_<=0)return O;return new Promise((z,Z)=>{let ge=setTimeout(()=>{Z(Error(`Authz catalog entry did not become ready within ${_}ms`))},_);O.then(()=>{clearTimeout(ge),z()},(te)=>{clearTimeout(ge),Z(te)})})}function dt(O,_){let z=!1,Z,ge=_.then(()=>{z=!0},(le)=>{z=!1,Z=le}),te=O;return Object.defineProperty(te,"ready",{enumerable:!1,configurable:!0,value:(le)=>ut(ge.then(()=>{if(!z)throw Z}),le)}),Object.defineProperty(te,"isReady",{enumerable:!1,configurable:!0,value:()=>z}),te}var Le=Object.freeze({jsonc:"application/json",env:"text/x-dotenv",text:"text/plain",binary:"application/octet-stream",yaml:"application/yaml",toml:"application/toml",xml:"application/xml"});function De(O){if(!O.id.trim())throw Error("defineSecretType: id is required");let _=O.mimeType?.trim()||Le[O.format],z=Object.freeze({id:O.id,...O.label?{label:O.label}:{},format:O.format,mimeType:_,...O.schemaUrl?{schemaUrl:O.schemaUrl}:{},typeId:O.id});return Object.freeze({id:O.id,...O.label?{label:O.label}:{},format:O.format,mimeType:_,...O.schemaUrl?{schemaUrl:O.schemaUrl}:{},...O.schema?{schema:O.schema}:{},toRegistryEntry:()=>z})}function lt(O="jsonc"){return{format:O,mimeType:Le[O],typeId:O}}class ze extends Error{constructor(O,_){super(`Secret content type mismatch: expected "${O.mimeType}" (${O.format}) but received "${_.mimeType}" (${_.format})`);this.name="SecretContentTypeMismatchError",this.expected=O,this.received=_}}var gt=De({id:"ionite-remote-config",label:"ionite RemoteConfig",format:"jsonc",mimeType:"application/vnd.ionite.remote-config+json",schemaUrl:"https://ionite.com/schemas/remote-config.json"});var Ve={beforeTenantSegments:["ui"]},Ge={beforeTenantSegments:["api"]};function Fe(O){return(O??[]).map((_)=>_.trim()).filter(Boolean)}function yt(O){let _=O.trim();if(!_)return"/";let z=_.replace(/\\/g,"/").replace(/\/+/g,"/");return z.startsWith("/")?z:`/${z}`}function Be(O){return yt(O).split("/").filter(Boolean)}function Ae(O){return{beforeTenantSegments:Fe(O?.beforeTenantSegments),afterTenantSegments:Fe(O?.afterTenantSegments)}}function ft(O){return{type:"path",ui:Ae(O?.ui??Ve),api:Ae(O?.api??Ge)}}function St(O,_){let z=Ae(_),Z=z.beforeTenantSegments??[],ge=z.afterTenantSegments??[],te=Be(O),le=Z.length+1+ge.length;if(te.length<le)return null;for(let Ce=0;Ce<Z.length;Ce++)if(te[Ce]!==Z[Ce])return null;let fe=Z.length,ye=te[fe];if(!ye)return null;for(let Ce=0;Ce<ge.length;Ce++)if(te[fe+1+Ce]!==ge[Ce])return null;let ke=te.slice(fe+1+ge.length);return{id:decodeURIComponent(ye),restSegments:ke,restPath:ke.length>0?`/${ke.join("/")}`:"/"}}function Ct(O,_="/",z){let Z=Ae(z),ge=Z.beforeTenantSegments??[],te=Z.afterTenantSegments??[],le=Be(_),fe=[...ge,encodeURIComponent(O),...te,...le];return fe.length>0?`/${fe.join("/")}`:"/"}function kt(O){return{"~standard":{version:1,vendor:O,validate:(_)=>{if(typeof _!=="object"||_===null)return{issues:[{message:"Expected an object"}]};let z=_,Z=[],ge={...z},te=["iss","sub"];for(let ye of te)if(ye in z){if(typeof z[ye]!=="string")Z.push({message:`${ye} must be a string`,path:[ye]})}else Z.push({message:`${ye} is required`,path:[ye]});if("aud"in z&&z.aud!==void 0){let ye=z.aud;if(typeof ye!=="string"&&!Array.isArray(ye))Z.push({message:"aud must be a string or array of strings",path:["aud"]});else if(Array.isArray(ye)&&!ye.every((ke)=>typeof ke==="string"))Z.push({message:"aud array must contain only strings",path:["aud"]})}let le=["jti","scope"];for(let ye of le)if(ye in z&&z[ye]!==void 0){if(typeof z[ye]!=="string")Z.push({message:`${ye} must be a string`,path:[ye]})}let fe=["exp","iat"];for(let ye of fe)if(ye in z){if(typeof z[ye]!=="number")Z.push({message:`${ye} must be a number`,path:[ye]})}else Z.push({message:`${ye} is required`,path:[ye]});if(Z.length>0)return{issues:Z};return{value:ge}}}}}function Rt(O){return{"~standard":{version:1,vendor:O,validate:(_)=>{if(typeof _!=="object"||_===null)return{issues:[{message:"Expected an object"}]};let z=_,Z=[],ge={};if("access_token"in z)if(typeof z.access_token==="string")ge.access_token=z.access_token;else Z.push({message:"access_token must be a string",path:["access_token"]});else Z.push({message:"access_token is required",path:["access_token"]});if("token_type"in z)if(typeof z.token_type==="string")ge.token_type=z.token_type;else Z.push({message:"token_type must be a string",path:["token_type"]});else Z.push({message:"token_type is required",path:["token_type"]});if("scope"in z)if(typeof z.scope==="string"||z.scope===void 0)ge.scope=z.scope;else Z.push({message:"scope must be a string",path:["scope"]});if("refresh_token"in z)if(typeof z.refresh_token==="string"||z.refresh_token===void 0)ge.refresh_token=z.refresh_token;else Z.push({message:"refresh_token must be a string",path:["refresh_token"]});if("expires"in z)if(typeof z.expires==="string"||z.expires===void 0)ge.expires=z.expires;else Z.push({message:"expires must be a string",path:["expires"]});if("expires_in"in z)if(typeof z.expires_in==="number"||z.expires_in===void 0)ge.expires_in=z.expires_in;else Z.push({message:"expires_in must be a number",path:["expires_in"]});if(Z.length>0)return{issues:Z};return{value:ge}}}}}function Tt(O){let _=new Uint8Array(O);return crypto.getRandomValues(_),_}function At(O){let _="",z=Tt(O);for(let Z=0;Z<O;Z++){let ge=z[Z]%32;_+="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(ge)}return _}function ht(O,_){let z="";for(let Z=_;Z>0;Z--){let ge=O%32;z="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(ge)+z,O=Math.floor(O/32)}return z}function bt(O){let _=Date.now(),z=ht(_,10),Z=At(16);return`${O??""}${z}${Z}`}export{V as AssignmentPolicyError,U as CANONICAL_RISK_LEVELS,he as ConfigSourceError,u as DEFAULT_RISK_LEVEL,Le as DEFAULT_SECRET_MIME_TYPES,Ge as DEFAULT_TENANT_API_NAMESPACE,Ve as DEFAULT_TENANT_UI_NAMESPACE,ne as ECID_SCHEME,k as EcidFormatError,e as ION_AUTHZ_GROUP_SCHEMA,Me as ION_AUTHZ_OAA_SYNC,ve as ION_CAPABILITIEZ_READ,Ke as ION_CIAM_MAGIC_LINK_CREATE,Qe as ION_ENDPOINT_PERMISSIONS,_e as ION_IAM_ACCESS_REQUESTS_WRITE,Oe as ION_IAM_CUSTOMERS_WRITE,xe as ION_IAM_GROUPS_WRITE,Ie as ION_IAM_READ,we as ION_IAM_USERS_WRITE,Pe as ION_IAM_WORKLOADS_WRITE,g as ION_SCIM_CUSTOMER_SCHEMA,s as ION_SCIM_USER_EXTENSION_URN,f as ION_SCIM_WORKLOAD_SCHEMA,Ze as ION_SDK_PERMISSIONS,Ne as ION_TENANT_MANAGE,G as IoniteError,S as KNOWN_BASE_CUSTOMER_KEYS,h as KNOWN_BASE_USER_KEYS,o as KNOWN_ENTITLEMENT_KEYS,b as KNOWN_WORKLOAD_KEYS,d as PLATFORM_ASSIGNABLE_SUBJECT_TYPES,ze as SecretContentTypeMismatchError,m as StoreConflictError,n as accessRefId,c as accessRootId,w as assertEcid,M as assertRequiredSubjectType,W as assertValidSubjectTypeScoping,Ct as buildTenantPath,I as catalogEntityStore,P as claimsToUser,X as configTrustedClientGrants,r as customAttributes,K as customerResourceSchema,at as debugLogger,ue as decodeUser,p as deepEqualPlain,it as defaultLogger,lt as defaultSecretContentType,F as defineCatalog,De as defineSecretType,j as deprecateRetiredCodeCatalogRows,re as formatEcid,Te as formatLogLine,bt as generateULID,A as getCodeCatalogEntity,me as groupResourceSchema,l as idTokenClaimsSchema,pt as infoLogger,H as isCodeCatalog,B as isConfigLocator,Ye as isConfigSourceError,J as isEcid,T as isStoreConflictError,kt as jwtAssertionClaimsSchema,R as list,i as listGenerator,St as matchTenantPath,Q as matchesListFilter,v as materializeCodeCatalogEntity,y as mergeCodeCatalogEntity,oe as mergeConfig,t as must,Ae as normalizeTenantPathNamespace,ft as normalizeTenantRoutingStrategy,N as oidcCallbackSchema,se as parseEcid,ie as parseJsonc,rt as parseKmsPoolControlDocument,ot as parseKmsPoolDocument,mt as prettyLogger,dt as readyCatalogEntry,gt as remoteConfigSecretType,et as serializeConfig,Ue as silentLogger,ae as stableConfigHash,Y as stripJsonComments,de as tmIntegrationState,ee as toCodeCatalog,L as tokenResponseSchema,C as trimTrailingSlash,E as trustedClientPermissionsForPrincipal,x as unionCatalogRead,pe as userSchema,D as validationFailureResponse,Je as version,ce as waitOn,ct as warnLogger,a as withValidate,q as workloadResourceSchema,Rt as workloadTokenResponseSchema};
|
|
1
|
+
import{F,Ae,d,R,A,I,o,M,c,Ie,H,f,e,g,ue,J,de,Se,ve,ke,D,j,T,N,Y,L,n,p,Ee,K,Pe,_e,Ue,Q,ee,W,te,pe,me,m,q,be,z,v,x,V,Oe,E,Ce,Me,De,P,re,se,y,s,je,_,fe,ge,i,oe,Ne,Le,r,w,h,$e,Ke,Te,B,a,l,t,ie,We,we,qe,U,S,ze,Ve,G,Be,k,O,ye,he,Ge,u,b,C,He,Je,ae,ce}from"./shared/core-anx7e6cp.js";var Kt="0.0.24-beta.20260927.13";class nt extends Error{constructor(X,Z){super(X,Z.cause!==void 0?{cause:Z.cause}:void 0);this.name="ConfigSourceError",this.kind=Z.kind,this.recoverable=Z.recoverable,this.code=Z.code,this.status=Z.status,this.path=Z.path,this.sourceType=Z.sourceType,Object.setPrototypeOf(this,nt.prototype)}}function Nt(X){return X instanceof nt}var Ze=["workload"],at={id:"ion:iam:read",name:"Read Identities (SCIM)",description:"Authorizes a workload to list and read Users, Groups, Workloads, and Customers via the SCIM endpoints.",requestable:!1,permissionTypes:["DataRead"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},pt={id:"ion:iam:users:write",name:"Manage Identities (SCIM Users)",description:"Authorizes a workload to create, replace, modify (including attribute changes), and delete Users via SCIM, including access-root revocation on user delete.",requestable:!1,permissionTypes:["DataCreate","DataWrite","DataDelete"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},ct={id:"ion:iam:groups:write",name:"Manage Groups & Access (SCIM Groups)",description:"Authorizes a workload to create, replace, modify, and delete Groups via SCIM, including membership changes that grant or revoke entitlements.",requestable:!1,permissionTypes:["DataCreate","DataWrite","DataDelete"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},mt={id:"ion:iam:workloads:write",name:"Manage Workloads (SCIM Workloads)",description:"Authorizes a workload to create, replace, modify, and delete Workload principals via SCIM, including access-root revocation on delete.",requestable:!1,permissionTypes:["DataCreate","DataWrite","DataDelete"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},lt={id:"ion:iam:customers:write",name:"Manage Customers (SCIM Customers)",description:"Authorizes a workload to create, replace, modify, and delete Customer principals via SCIM, including access-root revocation on delete.",requestable:!1,permissionTypes:["DataCreate","DataWrite","DataDelete"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},ut={id:"ion:iam:access-requests:write",name:"Submit Access Requests",description:"Authorizes a workload to submit an access request on a principal's behalf via the AccessRequests endpoint.",requestable:!1,permissionTypes:["DataCreate"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},dt={id:"ion:capabilitiez:read",name:"Read Capability Manifest",description:"Authorizes a workload to read the capability manifest at the capabilitiez endpoint (only when RemoteConfig.capabilitiez is enabled).",requestable:!1,permissionTypes:["DataRead"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},gt={id:"ion:ciam:magic-link:create",name:"Issue CIAM Magic Links",description:"Authorizes a caller to mint customer magic-link login credentials via the magic-link endpoint. Grant narrowly.",requestable:!1,permissionTypes:["DataCreate"],assignableSubjectTypes:["workload","user"],recommendedSubjectTypes:Ze},yt={id:"ion:authz:oaa:sync",name:"Trigger OAA Full Sync",description:"Authorizes a workload (Ops/ECI client) to trigger a full OAA reconcile via the authz OAA sync endpoint (only when RemoteConfig.authz.oaa.fullSync.enabled is true).",requestable:!1,permissionTypes:["DataWrite"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},ft={id:"ion:tenant:manage",name:"Manage Tenants",description:"Authorizes a workload (ECI/TMS client) to create, read, update, and delete tenant records via the tenant-management endpoints.",requestable:!1,permissionTypes:["DataCreate","DataRead","DataWrite","DataDelete"],assignableSubjectTypes:Ze,recommendedSubjectTypes:Ze},Dt=[at,pt,ct,mt,lt,ut,dt,gt,yt,ft],Lt={"iam.read":{permission:at,subjectType:["workload"]},"iam.users.write":{permission:pt,subjectType:["workload"]},"iam.groups.write":{permission:ct,subjectType:["workload"]},"iam.workloads.write":{permission:mt,subjectType:["workload"]},"iam.customers.write":{permission:lt,subjectType:["workload"]},"iam.access-requests.write":{permission:ut,subjectType:["workload"]},"capabilitiez.read":{permission:dt,subjectType:["workload"]},"ciam.magic-link.create":{permission:gt,subjectType:["workload","user"]},"authz.oaa.sync":{permission:yt,subjectType:["workload"]},"tenant.manage":{permission:ft,subjectType:["workload"]}};var Wt=["sessionStore","userStore","customerStore","accessStore","tokenStore","magicLinkStore","store"];function kt(X){if(X===null||typeof X!=="object")return X;let Z={};for(let[ne,le]of Object.entries(X)){if(Wt.includes(ne)||ne==="validators"||ne==="setStores")continue;Z[ne]=le!==null&&typeof le==="object"&&!Array.isArray(le)&&Object.getPrototypeOf(le)===Object.prototype?kt(le):le}return Z}function jt(X){return kt(X)}function st(X,Z){if(!X||typeof X!=="object"||Array.isArray(X))throw Error(`${Z} must be an object.`);return X}function tt(X,Z){if(X===void 0)return;if(typeof X!=="string"||X.length===0||!Number.isFinite(Date.parse(X)))throw Error(`${Z} must be a valid timestamp string.`);return X}function Rt(X,Z,ne){if(!Array.isArray(X)||!ne.allowEmpty&&X.length===0)throw Error(`${Z} keys must be ${ne.allowEmpty?"an":"a non-empty"} array.`);let le=new Set;return X.map((xe,Re)=>{let Fe=st(xe,`${Z} keys[${Re}]`);if(typeof Fe.id!=="string"||Fe.id.length===0)throw Error(`${Z} keys[${Re}].id must be a non-empty string.`);if(le.has(Fe.id))throw Error(`${Z} contains duplicate key id "${Fe.id}".`);if(le.add(Fe.id),!["pending","active","deprecated","rotated","revoked"].includes(String(Fe.state)))throw Error(`${Z} keys[${Re}].state is invalid.`);if(Fe.value!==void 0&&(typeof Fe.value!=="string"||Fe.value.length===0))throw Error(`${Z} keys[${Re}].value must be a non-empty string when present.`);let Xe=Fe.meta===void 0?void 0:st(Fe.meta,`${Z} keys[${Re}].meta`);return{id:Fe.id,state:Fe.state,...Fe.value===void 0?{}:{value:Fe.value},...Fe.notBefore===void 0?{}:{notBefore:tt(Fe.notBefore,`${Z} keys[${Re}].notBefore`)},...Fe.notAfter===void 0?{}:{notAfter:tt(Fe.notAfter,`${Z} keys[${Re}].notAfter`)},...Fe.createdAt===void 0?{}:{createdAt:tt(Fe.createdAt,`${Z} keys[${Re}].createdAt`)},...Fe.activatedAt===void 0?{}:{activatedAt:tt(Fe.activatedAt,`${Z} keys[${Re}].activatedAt`)},...Fe.deprecatedAt===void 0?{}:{deprecatedAt:tt(Fe.deprecatedAt,`${Z} keys[${Re}].deprecatedAt`)},...Fe.rotatedAt===void 0?{}:{rotatedAt:tt(Fe.rotatedAt,`${Z} keys[${Re}].rotatedAt`)},...Fe.revokedAt===void 0?{}:{revokedAt:tt(Fe.revokedAt,`${Z} keys[${Re}].revokedAt`)},...Xe?{meta:{...Xe}}:{}}})}function Ut(X,Z,ne){if(X===void 0)return;if(!Array.isArray(X))throw Error(`${ne} slots must be an array.`);let le=new Set,xe=X.map((Re,Fe)=>{if(Re===null)return null;if(typeof Re!=="string"||Re.length===0)throw Error(`${ne} slots[${Fe}] must be a non-empty key id or null.`);if(le.has(Re))throw Error(`${ne} slots contain duplicate key id "${Re}".`);le.add(Re);let Xe=Z.find((Ye)=>Ye.id===Re);if(!Xe)throw Error(`${ne} slot key "${Re}" is not present in keys.`);if(Xe.state!=="active")throw Error(`${ne} slot key "${Re}" must have state "active".`);if(!Xe.value)throw Error(`${ne} slot key "${Re}" must include a value.`);return Re});if(Z.length===0&&xe.some((Re)=>Re!==null))throw Error(`${ne} slots must be omitted or all-null when keys is empty.`);return xe}function $t(X){let ne=st(X,"KMS pool");if(ne.kind!=="kms")throw Error('KMS pool kind must be "kms".');let le=Rt(ne.keys,"KMS pool",{allowEmpty:!0}),xe=Ut(ne.slots,le,"KMS pool");return xe?{kind:"kms",slots:xe,keys:le}:{kind:"kms",keys:le}}function zt(X){let ne=st(X,"KMS pool control document");if(ne.kind!=="kms")throw Error('KMS pool control document kind must be "kms".');return{kind:"kms",keys:Rt(ne.keys,"KMS pool control document",{allowEmpty:!0})}}var Ft={trace:"TRACE",debug:"DEBUG",info:"INFO ",warn:"WARN ",error:"ERROR"};function At(X){if(typeof X==="string")return X;try{return JSON.stringify(X)??String(X)}catch{return String(X)}}function it(X){let Z=At(X);return/^[A-Za-z0-9_./:@+|-]+$/.test(Z)?Z:JSON.stringify(Z)}function qt(X){return At(X).replaceAll("\r","\\r").replaceAll(`
|
|
2
|
+
`,"\\n")}function Et(X,Z,ne){if(ne==null)return;if(ne instanceof Error){if(X.push(`${Z}.name=${it(ne.name)}`),X.push(`${Z}.message=${it(ne.message)}`),ne.stack)X.push(`${Z}.stack=${it(ne.stack)}`);return}X.push(`${Z}=${it(ne)}`)}function ot(X,Z,ne=[],le=new Date){let xe=qt(Z instanceof Error?Z.message:Z??""),Re=[];for(let[Fe,Xe]of ne.entries()){if(Xe&&typeof Xe==="object"&&!Array.isArray(Xe)&&!(Xe instanceof Error)&&Object.getPrototypeOf(Xe)===Object.prototype){for(let[Ye,et]of Object.entries(Xe))Et(Re,Ye,et);continue}Et(Re,`param.${Fe}`,Xe)}return[le.toISOString(),Ft[X],xe,...Re].filter(Boolean).join(" ")}var ht={trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Vt=ht,Gt={trace:()=>{},debug:console.debug,info:console.info,warn:console.warn,error:console.error},Bt={trace:()=>{},debug:()=>{},info:console.info,warn:console.warn,error:console.error},Ht={trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},Yt={trace:()=>{},debug:(X,...Z)=>globalThis.console.debug(ot("debug",X,Z)),info:(X,...Z)=>globalThis.console.info(ot("info",X,Z)),warn:(X,...Z)=>globalThis.console.warn(ot("warn",X,Z)),error:(X,...Z)=>globalThis.console.error(ot("error",X,Z))};function Jt(X,Z){if(typeof Z!=="number"||Z<=0)return X;return new Promise((ne,le)=>{let xe=setTimeout(()=>{le(Error(`Authz catalog entry did not become ready within ${Z}ms`))},Z);X.then(()=>{clearTimeout(xe),ne()},(Re)=>{clearTimeout(xe),le(Re)})})}function Xt(X,Z){let ne=!1,le,xe=Z.then(()=>{ne=!0},(Fe)=>{ne=!1,le=Fe}),Re=X;return Object.defineProperty(Re,"ready",{enumerable:!1,configurable:!0,value:(Fe)=>Jt(xe.then(()=>{if(!ne)throw le}),Fe)}),Object.defineProperty(Re,"isReady",{enumerable:!1,configurable:!0,value:()=>ne}),Re}var St=Object.freeze({jsonc:s,env:"text/x-dotenv",text:"text/plain",binary:ge,yaml:"application/yaml",toml:"application/toml",xml:fe});function Ct(X){if(!X.id.trim())throw Error("defineSecretType: id is required");let Z=X.mimeType?.trim()||St[X.format],ne=Object.freeze({id:X.id,...X.label?{label:X.label}:{},format:X.format,mimeType:Z,...X.schemaUrl?{schemaUrl:X.schemaUrl}:{},typeId:X.id});return Object.freeze({id:X.id,...X.label?{label:X.label}:{},format:X.format,mimeType:Z,...X.schemaUrl?{schemaUrl:X.schemaUrl}:{},...X.schema?{schema:X.schema}:{},toRegistryEntry:()=>ne})}function Zt(X="jsonc"){return{format:X,mimeType:St[X],typeId:X}}class It extends Error{constructor(X,Z){super(`Secret content type mismatch: expected "${X.mimeType}" (${X.format}) but received "${Z.mimeType}" (${Z.format})`);this.name="SecretContentTypeMismatchError",this.expected=X,this.received=Z}}var Qt=Ct({id:"ionite-remote-config",label:"ionite RemoteConfig",format:"jsonc",mimeType:"application/vnd.ionite.remote-config+json",schemaUrl:"https://ionite.com/schemas/remote-config.json"});var _t={beforeTenantSegments:["ui"]},xt={beforeTenantSegments:["api"]};function bt(X){return(X??[]).map((Z)=>Z.trim()).filter(Boolean)}function Ot(X){let Z=X.trim();if(!Z)return"/";let ne=Z.replace(/\\/g,"/").replace(/\/+/g,"/");return ne.startsWith("/")?ne:`/${ne}`}function Pt(X){return Ot(X).split("/").filter(Boolean)}function rt(X){return{beforeTenantSegments:bt(X?.beforeTenantSegments),afterTenantSegments:bt(X?.afterTenantSegments)}}function wt(X){if(X?.type==="host")return{type:"host",baseDomain:Tt(X.baseDomain)};if(X?.type==="selector")return X;return{type:"path",ui:rt(X?.ui??_t),api:rt(X?.api??xt)}}function Tt(X){let Z=X.trim().replace(/^\.+|\.+$/g,"").toLowerCase();if(!Z)throw Error('Host tenant routing requires a non-empty baseDomain such as "app.example.com".');return Z}function eo(X,Z){let ne=X.trim().replace(/\.$/,"").toLowerCase(),le=Tt(Z);if(!ne.endsWith(`.${le}`))return null;let xe=ne.slice(0,-(le.length+1));if(!xe||xe.includes("."))return null;return{id:xe}}function to(X,Z){let ne=rt(Z),le=ne.beforeTenantSegments??[],xe=ne.afterTenantSegments??[],Re=Pt(X),Fe=le.length+1+xe.length;if(Re.length<Fe)return null;for(let Qe=0;Qe<le.length;Qe++)if(Re[Qe]!==le[Qe])return null;let Xe=le.length,Ye=Re[Xe];if(!Ye)return null;for(let Qe=0;Qe<xe.length;Qe++)if(Re[Xe+1+Qe]!==xe[Qe])return null;let et=Re.slice(Xe+1+xe.length);return{id:decodeURIComponent(Ye),restSegments:et,restPath:et.length>0?`/${et.join("/")}`:"/"}}function Mt(X,Z="/",ne){let le=rt(ne),xe=le.beforeTenantSegments??[],Re=le.afterTenantSegments??[],Fe=Pt(Z),Xe=[...xe,encodeURIComponent(X),...Re,...Fe];return Xe.length>0?`/${Xe.join("/")}`:"/"}function oo(X,Z="/",ne,le="ui"){let xe=wt(ne);if(xe.type==="host"||xe.type==="selector")return Ot(Z);return Mt(X,Z,xe[le])}function ro(X){return{"~standard":{version:1,vendor:X,validate:(Z)=>{if(typeof Z!=="object"||Z===null)return{issues:[{message:"Expected an object"}]};let ne=Z,le=[],xe={...ne},Re=["iss","sub"];for(let Ye of Re)if(Ye in ne){if(typeof ne[Ye]!=="string")le.push({message:`${Ye} must be a string`,path:[Ye]})}else le.push({message:`${Ye} is required`,path:[Ye]});if("aud"in ne&&ne.aud!==void 0){let Ye=ne.aud;if(typeof Ye!=="string"&&!Array.isArray(Ye))le.push({message:"aud must be a string or array of strings",path:["aud"]});else if(Array.isArray(Ye)&&!Ye.every((et)=>typeof et==="string"))le.push({message:"aud array must contain only strings",path:["aud"]})}let Fe=["jti","scope"];for(let Ye of Fe)if(Ye in ne&&ne[Ye]!==void 0){if(typeof ne[Ye]!=="string")le.push({message:`${Ye} must be a string`,path:[Ye]})}let Xe=["exp","iat"];for(let Ye of Xe)if(Ye in ne){if(typeof ne[Ye]!=="number")le.push({message:`${Ye} must be a number`,path:[Ye]})}else le.push({message:`${Ye} is required`,path:[Ye]});if(le.length>0)return{issues:le};return{value:xe}}}}}function no(X){return{"~standard":{version:1,vendor:X,validate:(Z)=>{if(typeof Z!=="object"||Z===null)return{issues:[{message:"Expected an object"}]};let ne=Z,le=[],xe={};if("access_token"in ne)if(typeof ne.access_token==="string")xe.access_token=ne.access_token;else le.push({message:"access_token must be a string",path:["access_token"]});else le.push({message:"access_token is required",path:["access_token"]});if("token_type"in ne)if(typeof ne.token_type==="string")xe.token_type=ne.token_type;else le.push({message:"token_type must be a string",path:["token_type"]});else le.push({message:"token_type is required",path:["token_type"]});if("scope"in ne)if(typeof ne.scope==="string"||ne.scope===void 0)xe.scope=ne.scope;else le.push({message:"scope must be a string",path:["scope"]});if("refresh_token"in ne)if(typeof ne.refresh_token==="string"||ne.refresh_token===void 0)xe.refresh_token=ne.refresh_token;else le.push({message:"refresh_token must be a string",path:["refresh_token"]});if("expires"in ne)if(typeof ne.expires==="string"||ne.expires===void 0)xe.expires=ne.expires;else le.push({message:"expires must be a string",path:["expires"]});if("expires_in"in ne)if(typeof ne.expires_in==="number"||ne.expires_in===void 0)xe.expires_in=ne.expires_in;else le.push({message:"expires_in must be a number",path:["expires_in"]});if(le.length>0)return{issues:le};return{value:xe}}}}}function so(X){let Z=new Uint8Array(X);return crypto.getRandomValues(Z),Z}function io(X){let Z="",ne=so(X);for(let le=0;le<X;le++){let xe=ne[le]%32;Z+="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(xe)}return Z}function ao(X,Z){let ne="";for(let le=Z;le>0;le--){let xe=X%32;ne="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(xe)+ne,X=Math.floor(X/32)}return ne}function po(X){let Z=Date.now(),ne=ao(Z,10),le=io(16);return`${X??""}${ne}${le}`}export{i as ACCEPT_JSON,Le as ACCEPT_OCTET_STREAM,oe as ACCEPT_SCIM,Ne as ACCEPT_XML,de as AssignmentPolicyError,H as CANONICAL_RISK_LEVELS,h as CONTENT_TYPE_FORM,r as CONTENT_TYPE_JSON,Ke as CONTENT_TYPE_OCTET_STREAM,w as CONTENT_TYPE_SCIM,$e as CONTENT_TYPE_XML,nt as ConfigSourceError,_e as DEFAULT_DISCOVERED_COOKIE_MAX,Ue as DEFAULT_DISCOVERED_COOKIE_TTL_SECONDS,Pe as DEFAULT_DISPLAY_COOKIE_MAX,f as DEFAULT_RISK_LEVEL,St as DEFAULT_SECRET_MIME_TYPES,xt as DEFAULT_TENANT_API_NAMESPACE,_t as DEFAULT_TENANT_UI_NAMESPACE,Q as DISCOVERED_COOKIE_PREFIX,Ee as DISPLAY_COOKIE_SUFFIX,K as DISPLAY_COOKIE_VERSION,Oe as ECID_SCHEME,E as EcidFormatError,_ as FORM_MEDIA_TYPE,e as ION_AUTHZ_GROUP_SCHEMA,yt as ION_AUTHZ_OAA_SYNC,dt as ION_CAPABILITIEZ_READ,gt as ION_CIAM_MAGIC_LINK_CREATE,Lt as ION_ENDPOINT_PERMISSIONS,ut as ION_IAM_ACCESS_REQUESTS_WRITE,lt as ION_IAM_CUSTOMERS_WRITE,ct as ION_IAM_GROUPS_WRITE,at as ION_IAM_READ,pt as ION_IAM_USERS_WRITE,mt as ION_IAM_WORKLOADS_WRITE,C as ION_SCIM_CUSTOMER_SCHEMA,u as ION_SCIM_USER_EXTENSION_URN,b as ION_SCIM_WORKLOAD_SCHEMA,Dt as ION_SDK_PERMISSIONS,ft as ION_TENANT_MANAGE,ye as IoniteError,s as JSON_MEDIA_TYPE,A as KNOWN_BASE_CUSTOMER_KEYS,R as KNOWN_BASE_USER_KEYS,d as KNOWN_ENTITLEMENT_KEYS,I as KNOWN_WORKLOAD_KEYS,ge as OCTET_STREAM_MEDIA_TYPE,g as PLATFORM_ASSIGNABLE_SUBJECT_TYPES,je as SCIM_MEDIA_TYPE,It as SecretContentTypeMismatchError,k as StoreConflictError,fe as XML_MEDIA_TYPE,n as accessRefId,p as accessRootId,P as assertEcid,J as assertRequiredSubjectType,ue as assertValidSubjectTypeScoping,Mt as buildTenantPath,oo as buildTenantUrl,j as catalogEntityStore,G as claimsToUser,v as compareDisplayExpiryDesc,Ae as configTrustedClientGrants,o as customAttributes,ce as customerResourceSchema,Gt as debugLogger,be as decodeDisplayCookie,Be as decodeUser,S as deepEqualPlain,pe as defaultDisplayUser,Vt as defaultLogger,Zt as defaultSecretContentType,ke as defineCatalog,Ct as defineSecretType,Y as deprecateRetiredCodeCatalogRows,V as discoveredProfileCookieName,q as encodeDisplayCookie,Me as formatEcid,ot as formatLogLine,po as generateULID,D as getCodeCatalogEntity,Je as groupResourceSchema,y as idTokenClaimsSchema,Bt as infoLogger,Se as isCodeCatalog,he as isConfigLocator,Nt as isConfigSourceError,Ce as isEcid,Te as isJsonResponse,O as isStoreConflictError,ro as jwtAssertionClaimsSchema,M as list,c as listGenerator,eo as matchTenantHost,to as matchTenantPath,Ie as matchesListFilter,N as materializeCodeCatalogEntity,T as mergeCodeCatalogEntity,We as mergeConfig,t as must,Tt as normalizeTenantBaseDomain,rt as normalizeTenantPathNamespace,wt as normalizeTenantRoutingStrategy,re as oidcCallbackSchema,De as parseEcid,qe as parseJsonc,zt as parseKmsPoolControlDocument,$t as parseKmsPoolDocument,Yt as prettyLogger,x as profileCookieName,m as projectDisplayUser,z as readDisplayCookies,a as readJsonResponse,Xt as readyCatalogEntry,Qt as remoteConfigSecretType,W as resolveDiscoveredCookieMax,te as resolveDiscoveredCookieTtlSeconds,ee as resolveDisplayCookieMax,me as sanitizeDisplayUser,jt as serializeConfig,ht as silentLogger,ze as stableConfigHash,we as stripJsonComments,Ge as tmIntegrationState,ve as toCodeCatalog,se as tokenResponseSchema,U as trimTrailingSlash,F as trustedClientPermissionsForPrincipal,B as unexpectedBodySummary,L as unionCatalogRead,He as userSchema,ie as validationFailureResponse,Kt as version,Ve as waitOn,Ht as warnLogger,l as withValidate,ae as workloadResourceSchema,no as workloadTokenResponseSchema};
|