@classic-homes/auth 1.45.0 → 1.46.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/README.md +7 -0
- package/dist/auth.svelte-IWSWWF6U.js +3 -0
- package/dist/{chunk-ADCPJOPQ.js → chunk-7SFVHDFP.js} +42 -3
- package/dist/{chunk-42EO3FSU.js → chunk-BGQVBSXN.js} +3 -3
- package/dist/{chunk-5X6E5MZG.js → chunk-EFS272S3.js} +21 -1
- package/dist/{chunk-W2ASN4NE.js → chunk-Q4Q3CJVC.js} +2 -2
- package/dist/{chunk-J2WAFXA6.js → chunk-TJRFP24M.js} +3 -3
- package/dist/core/index.d.ts +34 -3
- package/dist/core/index.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/svelte/index.js +5 -5
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/auth.svelte-AN7ZNZ2W.js +0 -3
package/README.md
CHANGED
|
@@ -364,6 +364,13 @@ until installed and do nothing on the server.
|
|
|
364
364
|
`has*`, `checkAuth` (`source: 'route'`), `filterByAccess`/`canAccess`
|
|
365
365
|
(`'nav'`) and API 403s (`'http'`, path only, never the query string).
|
|
366
366
|
Each event carries the requirement, `allowed` and what was `missing`.
|
|
367
|
+
- While a probe is installed, requests to the API origin (never other hosts)
|
|
368
|
+
send `X-Access-Debug: 1`. CHAPI answers admin sessions with
|
|
369
|
+
`X-Access-Redacted: taxId=vendors:read:sensitive, notes=*`, reported as an
|
|
370
|
+
informational `source: 'redacted'` event (`allowed: true`, path only) with
|
|
371
|
+
`fields: { name, permission }[]`; `*` means no permission is configured
|
|
372
|
+
(default-deny). It reflects the real token, never "view as". No header, no
|
|
373
|
+
event. The custom header makes cross-origin API requests preflighted.
|
|
367
374
|
- `setAccessSubject(userId, { roles, permissions })` previews the UI as another
|
|
368
375
|
role set ("view as") for that user only. Checks for other users are
|
|
369
376
|
unaffected, `authStore.user` is never changed, and the preview ends on any
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isInitialized, getConfig, getUserRoles, clearAccessSubject, getStorage, isTokenExpired, getFetch, isAccessProbeActive, isValidRedirectUrl,
|
|
1
|
+
import { isInitialized, getConfig, getUserRoles, clearAccessSubject, getStorage, isTokenExpired, getFetch, isAccessProbeActive, isValidRedirectUrl, ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, parseRedactedHeader, reportAccess, requirementFromDenial, decodeJWT } from './chunk-EFS272S3.js';
|
|
2
2
|
|
|
3
3
|
// src/core/sso-state.ts
|
|
4
4
|
var SSO_CLIENT_STATE_PARAM = "client_state";
|
|
@@ -236,7 +236,7 @@ function writeStoredTokens(accessToken, refreshToken) {
|
|
|
236
236
|
}
|
|
237
237
|
async function syncSvelteStore(apply) {
|
|
238
238
|
try {
|
|
239
|
-
const { authStore } = await import('./auth.svelte-
|
|
239
|
+
const { authStore } = await import('./auth.svelte-IWSWWF6U.js');
|
|
240
240
|
apply(authStore);
|
|
241
241
|
} catch {
|
|
242
242
|
}
|
|
@@ -392,12 +392,46 @@ function isApiOrigin(url, baseUrl) {
|
|
|
392
392
|
function isRecord(value) {
|
|
393
393
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function probePath(endpoint) {
|
|
396
396
|
let path = endpoint.split(/[?#]/, 1)[0];
|
|
397
397
|
try {
|
|
398
398
|
if (/^https?:\/\//i.test(path)) path = new URL(path).pathname;
|
|
399
399
|
} catch {
|
|
400
400
|
}
|
|
401
|
+
return path;
|
|
402
|
+
}
|
|
403
|
+
function reportRedacted(method, endpoint, response) {
|
|
404
|
+
let header;
|
|
405
|
+
let truncated;
|
|
406
|
+
try {
|
|
407
|
+
header = response.headers.get(ACCESS_REDACTED_HEADER);
|
|
408
|
+
truncated = response.headers.get(ACCESS_REDACTED_TRUNCATED_HEADER);
|
|
409
|
+
} catch {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const { fields, omitted } = parseRedactedHeader(header);
|
|
413
|
+
if (fields.length === 0) return;
|
|
414
|
+
const serverOmitted = Number.parseInt(truncated ?? "", 10);
|
|
415
|
+
const fieldsOmitted = omitted + (Number.isFinite(serverOmitted) && serverOmitted > 0 ? Math.min(serverOmitted, 1e6) : 0);
|
|
416
|
+
const permissions = [...new Set(fields.map((f) => f.permission).filter((p) => p !== "*"))];
|
|
417
|
+
const path = probePath(endpoint);
|
|
418
|
+
reportAccess({
|
|
419
|
+
source: "redacted",
|
|
420
|
+
requirement: permissions.length ? { permissions } : {},
|
|
421
|
+
// Informational: the request succeeded, the fields say what was withheld.
|
|
422
|
+
allowed: true,
|
|
423
|
+
missing: { roles: [], permissions: [] },
|
|
424
|
+
// The server redacted for the real token, never the "view as" preview.
|
|
425
|
+
subjectId: null,
|
|
426
|
+
simulated: false,
|
|
427
|
+
label: `${method} ${path}`,
|
|
428
|
+
http: { method, endpoint: path, status: response.status },
|
|
429
|
+
fields,
|
|
430
|
+
...fieldsOmitted > 0 && { fieldsOmitted }
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
function reportForbidden(method, endpoint, code, details) {
|
|
434
|
+
const path = probePath(endpoint);
|
|
401
435
|
const requirement = requirementFromDenial(code, details) ?? {};
|
|
402
436
|
reportAccess({
|
|
403
437
|
source: "http",
|
|
@@ -465,6 +499,8 @@ async function apiRequestInternal(endpoint, options, isRetry, startedIn) {
|
|
|
465
499
|
"Content-Type": "application/json",
|
|
466
500
|
...fetchOptions.headers
|
|
467
501
|
};
|
|
502
|
+
const accessDebug = isAccessProbeActive() && (!isAbsolute || isApiOrigin(url, config.baseUrl));
|
|
503
|
+
if (accessDebug) headers[ACCESS_DEBUG_HEADER] = "1";
|
|
468
504
|
if (authenticated) {
|
|
469
505
|
const accessToken = getAccessToken();
|
|
470
506
|
const sessionToken = getSessionToken();
|
|
@@ -498,6 +534,9 @@ async function apiRequestInternal(endpoint, options, isRetry, startedIn) {
|
|
|
498
534
|
}
|
|
499
535
|
throw new Error("Authentication service unavailable. Please try again.");
|
|
500
536
|
}
|
|
537
|
+
if (accessDebug && isAccessProbeActive()) {
|
|
538
|
+
reportRedacted((fetchOptions.method ?? "GET").toUpperCase(), endpoint, response);
|
|
539
|
+
}
|
|
501
540
|
let data;
|
|
502
541
|
const contentType = response.headers.get("content-type");
|
|
503
542
|
if (contentType?.includes("application/json")) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { authApi, InvalidAuthResponseError, RoleDeniedError } from './chunk-
|
|
2
|
-
import { getUserRoles } from './chunk-
|
|
1
|
+
import { authApi, InvalidAuthResponseError, RoleDeniedError } from './chunk-7SFVHDFP.js';
|
|
2
|
+
import { getUserRoles } from './chunk-EFS272S3.js';
|
|
3
3
|
|
|
4
4
|
// src/core/guards.ts
|
|
5
5
|
function isMfaChallengeResponse(response) {
|
|
@@ -19,7 +19,7 @@ function getAvailableMethods(response) {
|
|
|
19
19
|
async function setStoreAuth(response) {
|
|
20
20
|
let store;
|
|
21
21
|
try {
|
|
22
|
-
store = (await import('./auth.svelte-
|
|
22
|
+
store = (await import('./auth.svelte-IWSWWF6U.js')).authStore;
|
|
23
23
|
} catch {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -287,6 +287,26 @@ function requirementFromDenial(code, details) {
|
|
|
287
287
|
const requireAll = mode === "any" ? false : mode === "all" ? true : isPermission;
|
|
288
288
|
return isPermission ? { permissions: list, requireAllPermissions: requireAll } : { roles: list, requireAllRoles: requireAll };
|
|
289
289
|
}
|
|
290
|
+
var ACCESS_DEBUG_HEADER = "X-Access-Debug";
|
|
291
|
+
var ACCESS_REDACTED_HEADER = "X-Access-Redacted";
|
|
292
|
+
var ACCESS_REDACTED_TRUNCATED_HEADER = "X-Access-Redacted-Truncated";
|
|
293
|
+
var MAX_REDACTED_FIELDS = 100;
|
|
294
|
+
var MAX_REDACTED_HEADER = 16384;
|
|
295
|
+
var REDACTED_ENTRY = /^([A-Za-z0-9_.:*-]{1,128})=([A-Za-z0-9_.:*-]{1,128})$/;
|
|
296
|
+
function parseRedactedHeader(value) {
|
|
297
|
+
const fields = [];
|
|
298
|
+
let omitted = 0;
|
|
299
|
+
if (!value) return { fields, omitted };
|
|
300
|
+
const seen = /* @__PURE__ */ new Set();
|
|
301
|
+
for (const raw of value.slice(0, MAX_REDACTED_HEADER).split(",")) {
|
|
302
|
+
const match = REDACTED_ENTRY.exec(raw.trim());
|
|
303
|
+
if (!match || seen.has(match[1])) continue;
|
|
304
|
+
seen.add(match[1]);
|
|
305
|
+
if (fields.length >= MAX_REDACTED_FIELDS) omitted += 1;
|
|
306
|
+
else fields.push({ name: match[1], permission: match[2] });
|
|
307
|
+
}
|
|
308
|
+
return { fields, omitted };
|
|
309
|
+
}
|
|
290
310
|
|
|
291
311
|
// src/core/roles.ts
|
|
292
312
|
var ROLE_NAMES = [
|
|
@@ -387,4 +407,4 @@ function hasAllRoles(user, roles) {
|
|
|
387
407
|
return allowed;
|
|
388
408
|
}
|
|
389
409
|
|
|
390
|
-
export { ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, isValidRedirectUrl, isValidSSOLogoutUrl, onAccessSubjectChange, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject };
|
|
410
|
+
export { ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, isValidRedirectUrl, isValidSSOLogoutUrl, onAccessSubjectChange, parseRedactedHeader, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvalidAuthResponseError, bumpSessionGeneration, authApi } from './chunk-
|
|
2
|
-
import { onAccessSubjectChange, isInitialized, getConfig, isValidSSOLogoutUrl, hasRole, hasAnyRole, hasAllRoles, effectiveSubject, reportDecision, decodeJWT, getStorage, getDefaultStorage } from './chunk-
|
|
1
|
+
import { InvalidAuthResponseError, bumpSessionGeneration, authApi } from './chunk-7SFVHDFP.js';
|
|
2
|
+
import { onAccessSubjectChange, isInitialized, getConfig, isValidSSOLogoutUrl, hasRole, hasAnyRole, hasAllRoles, effectiveSubject, reportDecision, decodeJWT, getStorage, getDefaultStorage } from './chunk-EFS272S3.js';
|
|
3
3
|
|
|
4
4
|
// src/svelte/stores/auth.svelte.ts
|
|
5
5
|
var STORAGE_VERSION = 2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { authService } from './chunk-
|
|
2
|
-
import { authStore, currentUser, isAuthenticated, authActions } from './chunk-
|
|
3
|
-
import { evaluateAccess, effectiveSubject, isAccessProbeActive, reportDecision, isInitialized, initAuth } from './chunk-
|
|
1
|
+
import { authService } from './chunk-BGQVBSXN.js';
|
|
2
|
+
import { authStore, currentUser, isAuthenticated, authActions } from './chunk-Q4Q3CJVC.js';
|
|
3
|
+
import { evaluateAccess, effectiveSubject, isAccessProbeActive, reportDecision, isInitialized, initAuth } from './chunk-EFS272S3.js';
|
|
4
4
|
|
|
5
5
|
// src/svelte/guards/auth-guard.ts
|
|
6
6
|
function checkAuth(options = {}) {
|
package/dist/core/index.d.ts
CHANGED
|
@@ -762,7 +762,18 @@ type AccessCheckSource =
|
|
|
762
762
|
/** A 403 from the API. */
|
|
763
763
|
| 'http'
|
|
764
764
|
/** A UI element (the inspector's own `RequireAccess` / `requires`). */
|
|
765
|
-
| 'element'
|
|
765
|
+
| 'element'
|
|
766
|
+
/**
|
|
767
|
+
* Fields the API left out of a response (`X-Access-Redacted`). Informational,
|
|
768
|
+
* not a denial: `allowed` is true and `missing` is empty; see `fields`.
|
|
769
|
+
*/
|
|
770
|
+
| 'redacted';
|
|
771
|
+
/** A top-level response field the API withheld, and the permission that would reveal it. */
|
|
772
|
+
interface RedactedField {
|
|
773
|
+
name: string;
|
|
774
|
+
/** `*` = the field has no permission configured and is dropped by default-deny. */
|
|
775
|
+
permission: string;
|
|
776
|
+
}
|
|
766
777
|
interface AccessCheckEvent extends AccessEvaluation {
|
|
767
778
|
source: AccessCheckSource;
|
|
768
779
|
requirement: AccessRequirement;
|
|
@@ -772,13 +783,17 @@ interface AccessCheckEvent extends AccessEvaluation {
|
|
|
772
783
|
simulated: boolean;
|
|
773
784
|
/** Human-readable context: a nav item id/href, or `METHOD /path` for HTTP. */
|
|
774
785
|
label?: string;
|
|
775
|
-
/** Present for `http` events. */
|
|
786
|
+
/** Present for `http` and `redacted` events. */
|
|
776
787
|
http?: {
|
|
777
788
|
method: string;
|
|
778
789
|
endpoint: string;
|
|
779
790
|
status: number;
|
|
780
791
|
code?: string;
|
|
781
792
|
};
|
|
793
|
+
/** Present for `redacted` events: the withheld fields, in the order the server listed them. */
|
|
794
|
+
fields?: RedactedField[];
|
|
795
|
+
/** `redacted` events: entries the server (or the parser's cap) left out of `fields`. */
|
|
796
|
+
fieldsOmitted?: number;
|
|
782
797
|
}
|
|
783
798
|
type AccessProbe = (event: AccessCheckEvent) => void;
|
|
784
799
|
type SubjectUser = {
|
|
@@ -835,5 +850,21 @@ declare function reportDecision(source: AccessCheckSource, user: SubjectUser | n
|
|
|
835
850
|
* optional `mode: 'any' | 'all'` overrides the defaults (permissions: all).
|
|
836
851
|
*/
|
|
837
852
|
declare function requirementFromDenial(code: string | undefined, details: unknown): AccessRequirement | null;
|
|
853
|
+
/** Request header asking CHAPI to say which fields it redacted (admin sessions only). */
|
|
854
|
+
declare const ACCESS_DEBUG_HEADER = "X-Access-Debug";
|
|
855
|
+
/** Response header: `name=permission` entries joined by `", "`. */
|
|
856
|
+
declare const ACCESS_REDACTED_HEADER = "X-Access-Redacted";
|
|
857
|
+
/** Response header: how many entries the server left out of {@link ACCESS_REDACTED_HEADER}. */
|
|
858
|
+
declare const ACCESS_REDACTED_TRUNCATED_HEADER = "X-Access-Redacted-Truncated";
|
|
859
|
+
/**
|
|
860
|
+
* Parse an `X-Access-Redacted` value (`taxId=vendors:read:sensitive, notes=*`).
|
|
861
|
+
* Malformed entries are skipped, a repeated name keeps its first permission,
|
|
862
|
+
* and at most 100 fields are kept; `omitted` counts the valid ones dropped by
|
|
863
|
+
* that cap. A missing or empty header yields no fields.
|
|
864
|
+
*/
|
|
865
|
+
declare function parseRedactedHeader(value: string | null | undefined): {
|
|
866
|
+
fields: RedactedField[];
|
|
867
|
+
omitted: number;
|
|
868
|
+
};
|
|
838
869
|
|
|
839
|
-
export { type AccessCheckEvent, type AccessCheckSource, type AccessEvaluation, type AccessProbe, type AccessRequirement, type AccessSubject, ApiKey, type ApiRequestOptions, type ApiResponse, ChangePasswordData, CreateApiKeyRequest, CreateApiKeyResponse, Device, type JWTPayload, LinkedAccount, LoginCredentials, LoginResponse, LogoutResponse, MFAChallengeData, MFAChallengeEmailResponse, MFASetupResponse, MFAStatus, Pagination, ProfileUpdateData, ROLE_HIERARCHY, ROLE_NAMES, type RefreshOutcome, type RefreshSessionOptions, RegisterData, RegisterResponse, type RoleName, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SecurityEvent, Session, type SsoClientStateResult, type SsoClientStateVerification, UpdateApiKeyRequest, User, UserPreferences, UserRolesResponse, api, apiRequest, authApi, clearAccessSubject, clearStoredAuth, computePrimaryRole, consumeSsoClientState, createSsoClientState, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, extractData, getAccessSubjectOverride, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initCrossTabSync, isAccessProbeActive, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, onAccessSubjectChange, refreshSession, reportAccess, reportDecision, requirementFromDenial, setAccessProbe, setAccessSubject, updateStoredTokens, verifySsoClientState };
|
|
870
|
+
export { ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, type AccessCheckEvent, type AccessCheckSource, type AccessEvaluation, type AccessProbe, type AccessRequirement, type AccessSubject, ApiKey, type ApiRequestOptions, type ApiResponse, ChangePasswordData, CreateApiKeyRequest, CreateApiKeyResponse, Device, type JWTPayload, LinkedAccount, LoginCredentials, LoginResponse, LogoutResponse, MFAChallengeData, MFAChallengeEmailResponse, MFASetupResponse, MFAStatus, Pagination, ProfileUpdateData, ROLE_HIERARCHY, ROLE_NAMES, type RedactedField, type RefreshOutcome, type RefreshSessionOptions, RegisterData, RegisterResponse, type RoleName, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SecurityEvent, Session, type SsoClientStateResult, type SsoClientStateVerification, UpdateApiKeyRequest, User, UserPreferences, UserRolesResponse, api, apiRequest, authApi, clearAccessSubject, clearStoredAuth, computePrimaryRole, consumeSsoClientState, createSsoClientState, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, extractData, getAccessSubjectOverride, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initCrossTabSync, isAccessProbeActive, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, onAccessSubjectChange, parseRedactedHeader, refreshSession, reportAccess, reportDecision, requirementFromDenial, setAccessProbe, setAccessSubject, updateStoredTokens, verifySsoClientState };
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-
|
|
2
|
-
export { ApiError, InvalidAuthResponseError, MFAChallengeEmailError, RoleDeniedError, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SessionChangedError, api, apiRequest, authApi, clearStoredAuth, consumeSsoClientState, createSsoClientState, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, isApiError, isRoleDeniedError, isSessionChangedError, refreshSession, updateStoredTokens, verifySsoClientState } from '../chunk-
|
|
3
|
-
export { ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, onAccessSubjectChange, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject } from '../chunk-
|
|
1
|
+
export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-BGQVBSXN.js';
|
|
2
|
+
export { ApiError, InvalidAuthResponseError, MFAChallengeEmailError, RoleDeniedError, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SessionChangedError, api, apiRequest, authApi, clearStoredAuth, consumeSsoClientState, createSsoClientState, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, isApiError, isRoleDeniedError, isSessionChangedError, refreshSession, updateStoredTokens, verifySsoClientState } from '../chunk-7SFVHDFP.js';
|
|
3
|
+
export { ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, onAccessSubjectChange, parseRedactedHeader, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject } from '../chunk-EFS272S3.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { A as ApiKey, a as AuthConfig, b as AuthState, C as ChangePasswordData, c as CreateApiKeyRequest, d as CreateApiKeyResponse, D as Device, L as LinkedAccount, e as LoginCredentials, f as LoginResponse, g as LogoutResponse, M as MFAChallengeData, h as MFAChallengeEmailResponse, i as MFASetupResponse, j as MFAStatus, P as Pagination, k as ProfileUpdateData, R as RegisterData, l as RegisterResponse, m as ResetPasswordData, S as SSOConfig, n as SecurityEvent, o as Session, p as StorageAdapter, U as UpdateApiKeyRequest, q as User, r as UserPreferences, s as UserRolesResponse, t as createMemoryStorage, u as createSessionStorage, v as getConfig, w as getDefaultStorage, x as getFetch, y as getStorage, z as initAuth, B as isInitialized, E as resetConfig } from './types-DF5Ny2IA.js';
|
|
2
|
-
export { AccessCheckEvent, AccessCheckSource, AccessEvaluation, AccessProbe, AccessRequirement, AccessSubject, ApiRequestOptions, ApiResponse, JWTPayload, ROLE_HIERARCHY, ROLE_NAMES, RefreshOutcome, RefreshSessionOptions, RoleName, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SsoClientStateResult, SsoClientStateVerification, api, apiRequest, authApi, clearAccessSubject, clearStoredAuth, computePrimaryRole, consumeSsoClientState, createSsoClientState, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, extractData, getAccessSubjectOverride, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initCrossTabSync, isAccessProbeActive, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, onAccessSubjectChange, refreshSession, reportAccess, reportDecision, requirementFromDenial, setAccessProbe, setAccessSubject, updateStoredTokens, verifySsoClientState } from './core/index.js';
|
|
2
|
+
export { ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, AccessCheckEvent, AccessCheckSource, AccessEvaluation, AccessProbe, AccessRequirement, AccessSubject, ApiRequestOptions, ApiResponse, JWTPayload, ROLE_HIERARCHY, ROLE_NAMES, RedactedField, RefreshOutcome, RefreshSessionOptions, RoleName, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SsoClientStateResult, SsoClientStateVerification, api, apiRequest, authApi, clearAccessSubject, clearStoredAuth, computePrimaryRole, consumeSsoClientState, createSsoClientState, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, extractData, getAccessSubjectOverride, getAccessToken, getAvailableMethods, getEffectiveLevel, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initCrossTabSync, isAccessProbeActive, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, onAccessSubjectChange, parseRedactedHeader, refreshSession, reportAccess, reportDecision, requirementFromDenial, setAccessProbe, setAccessSubject, updateStoredTokens, verifySsoClientState } from './core/index.js';
|
|
3
3
|
export { A as ApiError, a as AuthService, I as InvalidAuthResponseError, L as LoginOptions, M as MFAChallengeEmailError, b as MFAVerifyOptions, R as RoleDeniedError, S as SessionChangedError, c as authService, f as formatUserRoles, g as getAvatarFallback, d as getDisplayName, e as getGreeting, h as getUserEmail, i as getUserInitials, j as isApiError, k as isRoleDeniedError, l as isSessionChangedError } from './user-utils-DYyljbJR.js';
|
|
4
4
|
export { AuthClient, AuthGuardOptions, AuthGuardResult, AuthHookOptions, CreateAuthClientOptions, NavFilterOptions, RoleRestrictedItem, authActions, authStore, canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, currentUser, filterByAccess, filterNavSections, isAuthenticated, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './svelte/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-
|
|
2
|
-
export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-
|
|
4
|
-
export { ApiError, InvalidAuthResponseError, MFAChallengeEmailError, RoleDeniedError, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SessionChangedError, api, apiRequest, authApi, clearStoredAuth, consumeSsoClientState, createSsoClientState, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, isApiError, isRoleDeniedError, isSessionChangedError, refreshSession, updateStoredTokens, verifySsoClientState } from './chunk-
|
|
5
|
-
export { ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, onAccessSubjectChange, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject } from './chunk-
|
|
1
|
+
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-TJRFP24M.js';
|
|
2
|
+
export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-BGQVBSXN.js';
|
|
3
|
+
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-Q4Q3CJVC.js';
|
|
4
|
+
export { ApiError, InvalidAuthResponseError, MFAChallengeEmailError, RoleDeniedError, SSO_CLIENT_STATE_PARAM, SSO_CLIENT_STATE_TTL_MS, SessionChangedError, api, apiRequest, authApi, clearStoredAuth, consumeSsoClientState, createSsoClientState, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, isApiError, isRoleDeniedError, isSessionChangedError, refreshSession, updateStoredTokens, verifySsoClientState } from './chunk-7SFVHDFP.js';
|
|
5
|
+
export { ACCESS_DEBUG_HEADER, ACCESS_REDACTED_HEADER, ACCESS_REDACTED_TRUNCATED_HEADER, ROLE_HIERARCHY, ROLE_NAMES, clearAccessSubject, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, effectiveSubject, evaluateAccess, extractClaims, getAccessSubjectOverride, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isAccessProbeActive, isInitialized, isTokenExpired, onAccessSubjectChange, parseRedactedHeader, reportAccess, reportDecision, requirementFromDenial, resetConfig, setAccessProbe, setAccessSubject } from './chunk-EFS272S3.js';
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-
|
|
2
|
-
export { formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials } from '../chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-
|
|
4
|
-
export { InvalidAuthResponseError, RoleDeniedError, SessionChangedError, isRoleDeniedError, isSessionChangedError } from '../chunk-
|
|
5
|
-
export { initAuth, isInitialized } from '../chunk-
|
|
1
|
+
export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-TJRFP24M.js';
|
|
2
|
+
export { formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials } from '../chunk-BGQVBSXN.js';
|
|
3
|
+
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-Q4Q3CJVC.js';
|
|
4
|
+
export { InvalidAuthResponseError, RoleDeniedError, SessionChangedError, isRoleDeniedError, isSessionChangedError } from '../chunk-7SFVHDFP.js';
|
|
5
|
+
export { initAuth, isInitialized } from '../chunk-EFS272S3.js';
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasRole, hasAnyRole, hasAllRoles, initAuth, resetConfig, getUserRoles, isTokenExpired, decodeJWT } from '../chunk-
|
|
1
|
+
import { hasRole, hasAnyRole, hasAllRoles, initAuth, resetConfig, getUserRoles, isTokenExpired, decodeJWT } from '../chunk-EFS272S3.js';
|
|
2
2
|
|
|
3
3
|
// src/testing/fixtures/users.ts
|
|
4
4
|
var mockUser = {
|
package/package.json
CHANGED