@classic-homes/auth 1.45.0 → 1.47.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 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
@@ -0,0 +1,3 @@
1
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-HWV4ZEZM.js';
2
+ import './chunk-4Q3R4TTI.js';
3
+ import './chunk-TANYGU4O.js';
@@ -1,4 +1,4 @@
1
- import { isInitialized, getConfig, getUserRoles, clearAccessSubject, getStorage, isTokenExpired, getFetch, isAccessProbeActive, isValidRedirectUrl, requirementFromDenial, reportAccess, decodeJWT } from './chunk-5X6E5MZG.js';
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-TANYGU4O.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-AN7ZNZ2W.js');
239
+ const { authStore } = await import('./auth.svelte-CPTJUC3O.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 reportForbidden(method, endpoint, code, details) {
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-ADCPJOPQ.js';
2
- import { getUserRoles } from './chunk-5X6E5MZG.js';
1
+ import { authApi, InvalidAuthResponseError, RoleDeniedError } from './chunk-4Q3R4TTI.js';
2
+ import { getUserRoles } from './chunk-TANYGU4O.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-AN7ZNZ2W.js')).authStore;
22
+ store = (await import('./auth.svelte-CPTJUC3O.js')).authStore;
23
23
  } catch {
24
24
  return;
25
25
  }
@@ -1,5 +1,5 @@
1
- import { InvalidAuthResponseError, bumpSessionGeneration, authApi } from './chunk-ADCPJOPQ.js';
2
- import { onAccessSubjectChange, isInitialized, getConfig, isValidSSOLogoutUrl, hasRole, hasAnyRole, hasAllRoles, effectiveSubject, reportDecision, decodeJWT, getStorage, getDefaultStorage } from './chunk-5X6E5MZG.js';
1
+ import { InvalidAuthResponseError, bumpSessionGeneration, authApi } from './chunk-4Q3R4TTI.js';
2
+ import { onAccessSubjectChange, isInitialized, getConfig, isValidSSOLogoutUrl, hasRole, hasAnyRole, hasAllRoles, effectiveSubject, reportDecision, decodeJWT, getStorage, getDefaultStorage } from './chunk-TANYGU4O.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-42EO3FSU.js';
2
- import { authStore, currentUser, isAuthenticated, authActions } from './chunk-W2ASN4NE.js';
3
- import { evaluateAccess, effectiveSubject, isAccessProbeActive, reportDecision, isInitialized, initAuth } from './chunk-5X6E5MZG.js';
1
+ import { authService } from './chunk-GAN4LIB2.js';
2
+ import { authStore, currentUser, isAuthenticated, authActions } from './chunk-HWV4ZEZM.js';
3
+ import { evaluateAccess, effectiveSubject, isAccessProbeActive, reportDecision, isInitialized, initAuth } from './chunk-TANYGU4O.js';
4
4
 
5
5
  // src/svelte/guards/auth-guard.ts
6
6
  function checkAuth(options = {}) {
@@ -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 = [
@@ -312,6 +332,8 @@ var ROLE_NAMES = [
312
332
  "warranty_staff",
313
333
  "hotsheet_editor",
314
334
  "office_admin",
335
+ "area_manager",
336
+ "project_manager",
315
337
  "employee",
316
338
  "user",
317
339
  "vendor",
@@ -327,7 +349,7 @@ var ROLE_HIERARCHY = {
327
349
  subcontractor: 1,
328
350
  // Staff tier (2): the read-only `employee` floor, the field-app clones of
329
351
  // `agent`, every `<department>_staff` docs role, `hotsheet_editor` and
330
- // `office_admin`.
352
+ // `office_admin`, `area_manager`, `project_manager`.
331
353
  employee: 2,
332
354
  agent: 2,
333
355
  builder: 2,
@@ -349,6 +371,8 @@ var ROLE_HIERARCHY = {
349
371
  warranty_staff: 2,
350
372
  hotsheet_editor: 2,
351
373
  office_admin: 2,
374
+ area_manager: 2,
375
+ project_manager: 2,
352
376
  manager: 3,
353
377
  admin: 4
354
378
  };
@@ -387,4 +411,4 @@ function hasAllRoles(user, roles) {
387
411
  return allowed;
388
412
  }
389
413
 
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 };
414
+ 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 };
@@ -616,7 +616,9 @@ declare function extractClaims<T extends string>(token: string, claims: T[]): Pi
616
616
  * `hotsheet_editor` is a grant-on-top role for the Hotsheet hub's write
617
617
  * surface; `office_admin` is a grant-on-top role for the office
618
618
  * administrative assistant (home closing & financing fields, permits, walks,
619
- * lenders); `employee` is the read-only base staff
619
+ * lenders); `area_manager` / `project_manager` are grant-on-top roles for
620
+ * the construction managers who sign up to attend walks (one person may hold
621
+ * both); `employee` is the read-only base staff
620
622
  * floor (default for Authentik SSO); `vendor`/`customer`/`subcontractor` are
621
623
  * clones of `user`, row-scoped to their own homes.
622
624
  *
@@ -624,7 +626,7 @@ declare function extractClaims<T extends string>(token: string, claims: T[]): Pi
624
626
  * field app's clone of `agent`, the second is that department's docs role.
625
627
  * Someone on the stormwater team who also reads the docs holds both.
626
628
  */
627
- declare const ROLE_NAMES: readonly ["admin", "manager", "agent", "builder", "customer_service", "demo", "stormwater", "accounting_staff", "architecture_staff", "construction_staff", "crl_staff", "design_staff", "hr_staff", "it_staff", "landdev_staff", "marketing_staff", "purchasing_staff", "sales_staff", "stormwater_staff", "warranty_staff", "hotsheet_editor", "office_admin", "employee", "user", "vendor", "customer", "subcontractor", "guest"];
629
+ declare const ROLE_NAMES: readonly ["admin", "manager", "agent", "builder", "customer_service", "demo", "stormwater", "accounting_staff", "architecture_staff", "construction_staff", "crl_staff", "design_staff", "hr_staff", "it_staff", "landdev_staff", "marketing_staff", "purchasing_staff", "sales_staff", "stormwater_staff", "warranty_staff", "hotsheet_editor", "office_admin", "area_manager", "project_manager", "employee", "user", "vendor", "customer", "subcontractor", "guest"];
628
630
  /**
629
631
  * A known role name.
630
632
  *
@@ -762,7 +764,18 @@ type AccessCheckSource =
762
764
  /** A 403 from the API. */
763
765
  | 'http'
764
766
  /** A UI element (the inspector's own `RequireAccess` / `requires`). */
765
- | 'element';
767
+ | 'element'
768
+ /**
769
+ * Fields the API left out of a response (`X-Access-Redacted`). Informational,
770
+ * not a denial: `allowed` is true and `missing` is empty; see `fields`.
771
+ */
772
+ | 'redacted';
773
+ /** A top-level response field the API withheld, and the permission that would reveal it. */
774
+ interface RedactedField {
775
+ name: string;
776
+ /** `*` = the field has no permission configured and is dropped by default-deny. */
777
+ permission: string;
778
+ }
766
779
  interface AccessCheckEvent extends AccessEvaluation {
767
780
  source: AccessCheckSource;
768
781
  requirement: AccessRequirement;
@@ -772,13 +785,17 @@ interface AccessCheckEvent extends AccessEvaluation {
772
785
  simulated: boolean;
773
786
  /** Human-readable context: a nav item id/href, or `METHOD /path` for HTTP. */
774
787
  label?: string;
775
- /** Present for `http` events. */
788
+ /** Present for `http` and `redacted` events. */
776
789
  http?: {
777
790
  method: string;
778
791
  endpoint: string;
779
792
  status: number;
780
793
  code?: string;
781
794
  };
795
+ /** Present for `redacted` events: the withheld fields, in the order the server listed them. */
796
+ fields?: RedactedField[];
797
+ /** `redacted` events: entries the server (or the parser's cap) left out of `fields`. */
798
+ fieldsOmitted?: number;
782
799
  }
783
800
  type AccessProbe = (event: AccessCheckEvent) => void;
784
801
  type SubjectUser = {
@@ -835,5 +852,21 @@ declare function reportDecision(source: AccessCheckSource, user: SubjectUser | n
835
852
  * optional `mode: 'any' | 'all'` overrides the defaults (permissions: all).
836
853
  */
837
854
  declare function requirementFromDenial(code: string | undefined, details: unknown): AccessRequirement | null;
855
+ /** Request header asking CHAPI to say which fields it redacted (admin sessions only). */
856
+ declare const ACCESS_DEBUG_HEADER = "X-Access-Debug";
857
+ /** Response header: `name=permission` entries joined by `", "`. */
858
+ declare const ACCESS_REDACTED_HEADER = "X-Access-Redacted";
859
+ /** Response header: how many entries the server left out of {@link ACCESS_REDACTED_HEADER}. */
860
+ declare const ACCESS_REDACTED_TRUNCATED_HEADER = "X-Access-Redacted-Truncated";
861
+ /**
862
+ * Parse an `X-Access-Redacted` value (`taxId=vendors:read:sensitive, notes=*`).
863
+ * Malformed entries are skipped, a repeated name keeps its first permission,
864
+ * and at most 100 fields are kept; `omitted` counts the valid ones dropped by
865
+ * that cap. A missing or empty header yields no fields.
866
+ */
867
+ declare function parseRedactedHeader(value: string | null | undefined): {
868
+ fields: RedactedField[];
869
+ omitted: number;
870
+ };
838
871
 
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 };
872
+ 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 };
@@ -1,3 +1,3 @@
1
- export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-42EO3FSU.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-ADCPJOPQ.js';
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-5X6E5MZG.js';
1
+ export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-GAN4LIB2.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-4Q3R4TTI.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-TANYGU4O.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-J2WAFXA6.js';
2
- export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-42EO3FSU.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from './chunk-W2ASN4NE.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-ADCPJOPQ.js';
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-5X6E5MZG.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-NRVZY2B3.js';
2
+ export { AuthService, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-GAN4LIB2.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-HWV4ZEZM.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-4Q3R4TTI.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-TANYGU4O.js';
@@ -1,5 +1,5 @@
1
- export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-J2WAFXA6.js';
2
- export { formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials } from '../chunk-42EO3FSU.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-W2ASN4NE.js';
4
- export { InvalidAuthResponseError, RoleDeniedError, SessionChangedError, isRoleDeniedError, isSessionChangedError } from '../chunk-ADCPJOPQ.js';
5
- export { initAuth, isInitialized } from '../chunk-5X6E5MZG.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-NRVZY2B3.js';
2
+ export { formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials } from '../chunk-GAN4LIB2.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-HWV4ZEZM.js';
4
+ export { InvalidAuthResponseError, RoleDeniedError, SessionChangedError, isRoleDeniedError, isSessionChangedError } from '../chunk-4Q3R4TTI.js';
5
+ export { initAuth, isInitialized } from '../chunk-TANYGU4O.js';
@@ -1,4 +1,4 @@
1
- import { hasRole, hasAnyRole, hasAllRoles, initAuth, resetConfig, getUserRoles, isTokenExpired, decodeJWT } from '../chunk-5X6E5MZG.js';
1
+ import { hasRole, hasAnyRole, hasAllRoles, initAuth, resetConfig, getUserRoles, isTokenExpired, decodeJWT } from '../chunk-TANYGU4O.js';
2
2
 
3
3
  // src/testing/fixtures/users.ts
4
4
  var mockUser = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/auth",
3
- "version": "1.45.0",
3
+ "version": "1.47.0",
4
4
  "description": "Authentication services and Svelte bindings for Classic Theme apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,3 +0,0 @@
1
- export { authActions, authStore, currentUser, isAuthenticated } from './chunk-W2ASN4NE.js';
2
- import './chunk-ADCPJOPQ.js';
3
- import './chunk-5X6E5MZG.js';