@mastra/auth-okta 0.1.1-alpha.0 → 0.1.2-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mastra/auth-okta
2
2
 
3
+ ## 0.1.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Hardened several string-parsing code paths against regular-expression denial of service (ReDoS). Path normalization, URL trimming, LLM token stripping, and observation parsing now use linear-time string scanning instead of regexes that could back-track polynomially on adversarial input. No behavior changes. ([#18801](https://github.com/mastra-ai/mastra/pull/18801))
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Improved auth package builds by removing the direct core dependency from auth providers while preserving the existing public auth APIs. ([#17142](https://github.com/mastra-ai/mastra/pull/17142))
14
+
3
15
  ## 0.1.1-alpha.0
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +10,7 @@
10
10
  * All known API resources.
11
11
  * Derived from SERVER_ROUTES paths in @mastra/server.
12
12
  */
13
- export declare const RESOURCES: readonly ["a2a", "agent-builder", "agents", "auth", "background-tasks", "channels", "datasets", "embedders", "experiments", "harness", "infrastructure", "logs", "mcp", "memory", "observability", "processor-providers", "processors", "schedules", "scores", "stored-agents", "stored-mcp-clients", "stored-prompt-blocks", "stored-scorers", "stored-skills", "stored-workspaces", "system", "tool-providers", "tools", "vector", "vectors", "workflows", "workspaces"];
13
+ export declare const RESOURCES: readonly ["a2a", "agent-builder", "agent-controller", "agents", "auth", "background-tasks", "channels", "datasets", "embedders", "experiments", "heartbeats", "infrastructure", "logs", "mcp", "memory", "observability", "processor-providers", "processors", "schedules", "scores", "stored-agents", "stored-mcp-clients", "stored-prompt-blocks", "stored-scorers", "stored-skills", "stored-workspaces", "system", "tool-providers", "tools", "vector", "vectors", "workflows", "workspaces"];
14
14
  /**
15
15
  * Resource type union.
16
16
  */
@@ -54,6 +54,8 @@ export declare const PERMISSION_PATTERNS: {
54
54
  readonly 'a2a:*': "a2a:*";
55
55
  /** Full access to agent builder */
56
56
  readonly 'agent-builder:*': "agent-builder:*";
57
+ /** Full access to agent controller sessions */
58
+ readonly 'agent-controller:*': "agent-controller:*";
57
59
  /** Full access to agents */
58
60
  readonly 'agents:*': "agents:*";
59
61
  /** Full access to auth */
@@ -68,8 +70,8 @@ export declare const PERMISSION_PATTERNS: {
68
70
  readonly 'embedders:*': "embedders:*";
69
71
  /** Full access to experiments */
70
72
  readonly 'experiments:*': "experiments:*";
71
- /** Full access to harness sessions */
72
- readonly 'harness:*': "harness:*";
73
+ /** Full access to heartbeats */
74
+ readonly 'heartbeats:*': "heartbeats:*";
73
75
  /** Full access to infrastructure */
74
76
  readonly 'infrastructure:*': "infrastructure:*";
75
77
  /** Full access to logs */
@@ -124,6 +126,10 @@ export declare const PERMISSION_PATTERNS: {
124
126
  readonly 'agent-builder:read': "agent-builder:read";
125
127
  /** Create and modify agent builder */
126
128
  readonly 'agent-builder:write': "agent-builder:write";
129
+ /** Execute agent controller sessions */
130
+ readonly 'agent-controller:execute': "agent-controller:execute";
131
+ /** View agent controller sessions */
132
+ readonly 'agent-controller:read': "agent-controller:read";
127
133
  /** Create agents */
128
134
  readonly 'agents:create': "agents:create";
129
135
  /** Delete agents */
@@ -154,10 +160,14 @@ export declare const PERMISSION_PATTERNS: {
154
160
  readonly 'embedders:read': "embedders:read";
155
161
  /** View experiments */
156
162
  readonly 'experiments:read': "experiments:read";
157
- /** Execute harness sessions */
158
- readonly 'harness:execute': "harness:execute";
159
- /** View harness sessions */
160
- readonly 'harness:read': "harness:read";
163
+ /** Delete heartbeats */
164
+ readonly 'heartbeats:delete': "heartbeats:delete";
165
+ /** Execute heartbeats */
166
+ readonly 'heartbeats:execute': "heartbeats:execute";
167
+ /** View heartbeats */
168
+ readonly 'heartbeats:read': "heartbeats:read";
169
+ /** Create and modify heartbeats */
170
+ readonly 'heartbeats:write': "heartbeats:write";
161
171
  /** View infrastructure */
162
172
  readonly 'infrastructure:read': "infrastructure:read";
163
173
  /** View logs */
@@ -303,7 +313,7 @@ export type PermissionPattern = keyof typeof PERMISSION_PATTERNS;
303
313
  /**
304
314
  * All valid resource:action permission combinations (excludes wildcards).
305
315
  */
306
- export declare const PERMISSIONS: readonly ["a2a:read", "a2a:write", "agent-builder:execute", "agent-builder:read", "agent-builder:write", "agents:create", "agents:delete", "agents:execute", "agents:read", "agents:write", "auth:read", "background-tasks:read", "channels:read", "channels:write", "datasets:delete", "datasets:execute", "datasets:read", "datasets:write", "embedders:read", "experiments:read", "harness:execute", "harness:read", "infrastructure:read", "logs:read", "mcp:execute", "mcp:read", "mcp:write", "memory:delete", "memory:execute", "memory:read", "memory:write", "observability:read", "observability:write", "processor-providers:read", "processors:execute", "processors:read", "schedules:execute", "schedules:read", "schedules:write", "scores:read", "scores:write", "stored-agents:delete", "stored-agents:publish", "stored-agents:read", "stored-agents:write", "stored-mcp-clients:delete", "stored-mcp-clients:publish", "stored-mcp-clients:read", "stored-mcp-clients:write", "stored-prompt-blocks:delete", "stored-prompt-blocks:publish", "stored-prompt-blocks:read", "stored-prompt-blocks:write", "stored-scorers:delete", "stored-scorers:publish", "stored-scorers:read", "stored-scorers:write", "stored-skills:delete", "stored-skills:publish", "stored-skills:read", "stored-skills:write", "stored-workspaces:delete", "stored-workspaces:read", "stored-workspaces:write", "system:read", "tool-providers:delete", "tool-providers:read", "tool-providers:write", "tools:execute", "tools:read", "vector:delete", "vector:execute", "vector:read", "vector:write", "vectors:read", "workflows:delete", "workflows:execute", "workflows:read", "workflows:write", "workspaces:delete", "workspaces:read", "workspaces:write"];
316
+ export declare const PERMISSIONS: readonly ["a2a:read", "a2a:write", "agent-builder:execute", "agent-builder:read", "agent-builder:write", "agent-controller:execute", "agent-controller:read", "agents:create", "agents:delete", "agents:execute", "agents:read", "agents:write", "auth:read", "background-tasks:read", "channels:read", "channels:write", "datasets:delete", "datasets:execute", "datasets:read", "datasets:write", "embedders:read", "experiments:read", "heartbeats:delete", "heartbeats:execute", "heartbeats:read", "heartbeats:write", "infrastructure:read", "logs:read", "mcp:execute", "mcp:read", "mcp:write", "memory:delete", "memory:execute", "memory:read", "memory:write", "observability:read", "observability:write", "processor-providers:read", "processors:execute", "processors:read", "schedules:execute", "schedules:read", "schedules:write", "scores:read", "scores:write", "stored-agents:delete", "stored-agents:publish", "stored-agents:read", "stored-agents:write", "stored-mcp-clients:delete", "stored-mcp-clients:publish", "stored-mcp-clients:read", "stored-mcp-clients:write", "stored-prompt-blocks:delete", "stored-prompt-blocks:publish", "stored-prompt-blocks:read", "stored-prompt-blocks:write", "stored-scorers:delete", "stored-scorers:publish", "stored-scorers:read", "stored-scorers:write", "stored-skills:delete", "stored-skills:publish", "stored-skills:read", "stored-skills:write", "stored-workspaces:delete", "stored-workspaces:read", "stored-workspaces:write", "system:read", "tool-providers:delete", "tool-providers:read", "tool-providers:write", "tools:execute", "tools:read", "vector:delete", "vector:execute", "vector:read", "vector:write", "vectors:read", "workflows:delete", "workflows:execute", "workflows:read", "workflows:write", "workspaces:delete", "workspaces:read", "workspaces:write"];
307
317
  /**
308
318
  * Specific permission type (e.g., 'agents:read', 'workflows:execute').
309
319
  */
@@ -325,6 +335,10 @@ export declare const MastraFGAPermissions: {
325
335
  readonly AGENT_BUILDER_READ: "agent-builder:read";
326
336
  /** Create and modify agent builder */
327
337
  readonly AGENT_BUILDER_WRITE: "agent-builder:write";
338
+ /** Execute agent controller sessions */
339
+ readonly AGENT_CONTROLLER_EXECUTE: "agent-controller:execute";
340
+ /** View agent controller sessions */
341
+ readonly AGENT_CONTROLLER_READ: "agent-controller:read";
328
342
  /** Create agents */
329
343
  readonly AGENTS_CREATE: "agents:create";
330
344
  /** Delete agents */
@@ -355,10 +369,14 @@ export declare const MastraFGAPermissions: {
355
369
  readonly EMBEDDERS_READ: "embedders:read";
356
370
  /** View experiments */
357
371
  readonly EXPERIMENTS_READ: "experiments:read";
358
- /** Execute harness sessions */
359
- readonly HARNESS_EXECUTE: "harness:execute";
360
- /** View harness sessions */
361
- readonly HARNESS_READ: "harness:read";
372
+ /** Delete heartbeats */
373
+ readonly HEARTBEATS_DELETE: "heartbeats:delete";
374
+ /** Execute heartbeats */
375
+ readonly HEARTBEATS_EXECUTE: "heartbeats:execute";
376
+ /** View heartbeats */
377
+ readonly HEARTBEATS_READ: "heartbeats:read";
378
+ /** Create and modify heartbeats */
379
+ readonly HEARTBEATS_WRITE: "heartbeats:write";
362
380
  /** View infrastructure */
363
381
  readonly INFRASTRUCTURE_READ: "infrastructure:read";
364
382
  /** View logs */
@@ -14,7 +14,44 @@ export interface MastraAuthProviderOptions<TUser = unknown> {
14
14
  */
15
15
  public?: MastraAuthConfig['public'];
16
16
  }
17
- export declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase {
17
+ /**
18
+ * Structural description of the public surface of a `MastraAuthProvider`.
19
+ *
20
+ * Auth provider packages bundle their own copy of the `MastraAuthProvider`
21
+ * declaration, so provider class types cannot be compared nominally across
22
+ * package boundaries — `#private`/`protected` members would make otherwise
23
+ * identical copies mutually unassignable. Positions that accept user-supplied
24
+ * providers (e.g. `server.auth`, `CompositeAuth`) accept this interface
25
+ * instead of the class.
26
+ *
27
+ * Note: methods intentionally use method syntax (not property syntax) so they
28
+ * are checked bivariantly — providers with a narrower `TUser` must remain
29
+ * assignable to `IMastraAuthProvider<unknown>`.
30
+ */
31
+ export interface IMastraAuthProvider<TUser = unknown> {
32
+ name?: string;
33
+ /**
34
+ * Protected paths for the auth provider
35
+ */
36
+ protected?: MastraAuthConfig['protected'];
37
+ /**
38
+ * Public paths for the auth provider
39
+ */
40
+ public?: MastraAuthConfig['public'];
41
+ /**
42
+ * Authenticate a token and return the payload
43
+ */
44
+ authenticateToken(token: string, request: MastraAuthRequest): Promise<TUser | null>;
45
+ /**
46
+ * Authorize a user for a path and method
47
+ */
48
+ authorizeUser(user: TUser, request: MastraAuthRequest): Promise<boolean> | boolean;
49
+ /**
50
+ * Map an authenticated user to a memory resource id
51
+ */
52
+ mapUserToResourceId?(user: TUser): string | undefined | null;
53
+ }
54
+ export declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase implements IMastraAuthProvider<TUser> {
18
55
  protected?: MastraAuthConfig['protected'];
19
56
  public?: MastraAuthConfig['public'];
20
57
  mapUserToResourceId?(user: TUser): string | undefined | null;
@@ -39,7 +76,7 @@ export declare class CompositeAuth extends MastraAuthProvider implements ISSOPro
39
76
  private providers;
40
77
  private authenticatedProviderByObject;
41
78
  private authenticatedProviderByPrimitive;
42
- constructor(providers: MastraAuthProvider[]);
79
+ constructor(providers: IMastraAuthProvider[]);
43
80
  private findProvider;
44
81
  private rememberAuthenticatedProvider;
45
82
  private takeAuthenticatedProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../src/auth-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,KAAK,eAAe,GAAG;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,KAAK,iBAAiB,GAAG,OAAO,GAAG,eAAe,CAAC;AAUnD,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA0ElE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cACX,SAAQ,kBAAkB,CAAC,QAAQ,CACnC,YAAW,YAAY,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;IAErF,SAAS,CAAC,MAAM,EAA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AO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI5D,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMhD;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,SAAS,IAAI,MAAM;CAGpB"}
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var pkg__default = /*#__PURE__*/_interopDefault(pkg);
10
10
 
11
- // ../../packages/_internals/auth/dist/chunk-JCX4XB6F.js
11
+ // ../../packages/_internals/auth/dist/chunk-GVS7OL46.js
12
12
  var RESOURCE_EXPANSIONS = {
13
13
  stored: [
14
14
  "stored-agents",
@@ -393,7 +393,7 @@ var MastraBase = class {
393
393
  }
394
394
  };
395
395
 
396
- // ../../packages/_internals/auth/dist/chunk-XG6GH2VJ.js
396
+ // ../../packages/_internals/auth/dist/chunk-7GLKLOU3.js
397
397
  var MastraAuthProvider = class extends MastraBase {
398
398
  protected;
399
399
  public;
@@ -440,6 +440,11 @@ function mapOktaClaimsToUser(payload) {
440
440
  }
441
441
 
442
442
  // src/auth-provider.ts
443
+ function trimTrailingSlashes(value) {
444
+ let end = value.length;
445
+ while (end > 0 && value[end - 1] === "/") end--;
446
+ return value.slice(0, end);
447
+ }
443
448
  function getRequestHeader2(request, name) {
444
449
  if (request instanceof Request) {
445
450
  return request.headers.get(name);
@@ -533,7 +538,7 @@ var MastraAuthOkta = class extends MastraAuthProvider {
533
538
  this.domain = domain;
534
539
  this.clientId = clientId;
535
540
  this.clientSecret = clientSecret;
536
- this.issuer = (issuer ?? `https://${domain}/oauth2/default`).replace(/\/+$/, "");
541
+ this.issuer = trimTrailingSlashes(issuer ?? `https://${domain}/oauth2/default`);
537
542
  this.endpointBase = this.issuer.includes("/oauth2/") || this.issuer.endsWith("/oauth2") ? this.issuer : `${this.issuer}/oauth2`;
538
543
  this.redirectUri = redirectUri;
539
544
  this.scopes = options?.scopes ?? DEFAULT_SCOPES;