@mastra/auth-okta 0.2.5 → 0.2.6

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LRUCache } from "lru-cache";
2
2
  import { createRemoteJWKSet, jwtVerify } from "jose";
3
- //#region ../../packages/_internals/auth/dist/ee-XRuijAiF.js
3
+ // ../../packages/_internals/auth/dist/ee-CAe-UJ9n.js
4
4
  /**
5
5
  * FGA enforcement utility for checking fine-grained authorization.
6
6
  *
@@ -109,8 +109,7 @@ function resolvePermissionsFromMapping(roles, mapping) {
109
109
  * @license Mastra Enterprise License - see ee/LICENSE
110
110
  * @packageDocumentation
111
111
  */
112
- //#endregion
113
- //#region src/rbac-provider.ts
112
+ // src/rbac-provider.ts
114
113
  /** Default cache TTL in milliseconds (60 seconds) */
115
114
  const DEFAULT_CACHE_TTL_MS = 6e4;
116
115
  /** Default max cache size (number of users) */
@@ -312,8 +311,7 @@ var MastraRBACOkta = class {
312
311
  return permissions.some((required) => userPermissions.some((granted) => matchesPermission(granted, required)));
313
312
  }
314
313
  };
315
- //#endregion
316
- //#region ../../packages/_internals/auth/dist/types/index.js
314
+ // ../../packages/_internals/auth/dist/types/index.js
317
315
  function headerFromPlainObject(headers, name) {
318
316
  const normalizedName = name.toLowerCase();
319
317
  const matchingKey = Object.keys(headers).find((key) => key.toLowerCase() === normalizedName);
@@ -333,8 +331,7 @@ function getRequestHeader(request, name) {
333
331
  if (headers && typeof headers === "object") return headerFromPlainObject(headers, name);
334
332
  return null;
335
333
  }
336
- //#endregion
337
- //#region ../../packages/_internal-core/dist/logger/index.js
334
+ // ../../packages/_internal-core/dist/logger/index.js
338
335
  /**
339
336
  * Export a tracked exception through the adapter sink, mirroring the
340
337
  * DualLogger dual-write shape (`errorId`/`domain`/`category`/`details`/`cause`
@@ -567,8 +564,7 @@ var ConsoleLogger = class ConsoleLogger extends MastraLogger {
567
564
  };
568
565
  }
569
566
  };
570
- //#endregion
571
- //#region ../../packages/_internal-core/dist/base/index.js
567
+ // ../../packages/_internal-core/dist/base/index.js
572
568
  var MastraBase = class {
573
569
  component = RegisteredLogger.LLM;
574
570
  logger;
@@ -602,8 +598,7 @@ var MastraBase = class {
602
598
  this.logger = "child" in logger && typeof logger.child === "function" ? logger.child({ component: this.component }) : logger;
603
599
  }
604
600
  };
605
- //#endregion
606
- //#region ../../packages/_internals/auth/dist/provider/index.js
601
+ // ../../packages/_internals/auth/dist/provider/index.js
607
602
  var MastraAuthProvider = class extends MastraBase {
608
603
  protected;
609
604
  public;
@@ -615,7 +610,7 @@ var MastraAuthProvider = class extends MastraBase {
615
610
  if (options?.authorizeUser) this.authorizeUser = options.authorizeUser.bind(this);
616
611
  this.protected = options?.protected;
617
612
  this.public = options?.public;
618
- this.mapUserToResourceId = options?.mapUserToResourceId;
613
+ if (options?.mapUserToResourceId) this.mapUserToResourceId = options.mapUserToResourceId;
619
614
  }
620
615
  registerOptions(opts) {
621
616
  if (opts?.authorizeUser) this.authorizeUser = opts.authorizeUser.bind(this);
@@ -624,8 +619,7 @@ var MastraAuthProvider = class extends MastraBase {
624
619
  if (opts?.public) this.public = opts.public;
625
620
  }
626
621
  };
627
- //#endregion
628
- //#region src/types.ts
622
+ // src/types.ts
629
623
  /**
630
624
  * Maps Okta JWT claims to OktaUser format.
631
625
  *
@@ -647,8 +641,7 @@ function mapOktaClaimsToUser(payload) {
647
641
  }
648
642
  };
649
643
  }
650
- //#endregion
651
- //#region src/auth-provider.ts
644
+ // src/auth-provider.ts
652
645
  /**
653
646
  * Trim trailing slashes. Index scan instead of regex to avoid backtracking
654
647
  * (CodeQL js/polynomial-redos).
@@ -1041,7 +1034,6 @@ var MastraAuthOkta = class extends MastraAuthProvider {
1041
1034
  return this.issuer;
1042
1035
  }
1043
1036
  };
1044
- //#endregion
1045
1037
  export { MastraAuthOkta, MastraRBACOkta, mapOktaClaimsToUser };
1046
1038
 
1047
1039
  //# sourceMappingURL=index.js.map