@mastra/auth-cloud 1.2.1-alpha.0 → 1.2.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 +16 -0
- package/dist/_types/@internal_auth/dist/ee/interfaces/permissions.generated.d.ts +30 -12
- package/dist/_types/@internal_auth/dist/provider/index.d.ts +39 -2
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @mastra/auth-cloud
|
|
2
2
|
|
|
3
|
+
## 1.2.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`705ff39`](https://github.com/mastra-ai/mastra/commit/705ff3969e57214ff2fdaf3815d751dd558886ed)]:
|
|
8
|
+
- @mastra/auth@1.1.2-alpha.0
|
|
9
|
+
|
|
10
|
+
## 1.2.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 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))
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`5c0df77`](https://github.com/mastra-ai/mastra/commit/5c0df776c40efa420f8c07a2f3ee66010296618e)]:
|
|
17
|
+
- @mastra/auth@1.1.1
|
|
18
|
+
|
|
3
19
|
## 1.2.1-alpha.0
|
|
4
20
|
|
|
5
21
|
### 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", "
|
|
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
|
|
72
|
-
readonly '
|
|
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
|
-
/**
|
|
158
|
-
readonly '
|
|
159
|
-
/**
|
|
160
|
-
readonly '
|
|
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", "
|
|
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
|
-
/**
|
|
359
|
-
readonly
|
|
360
|
-
/**
|
|
361
|
-
readonly
|
|
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
|
-
|
|
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:
|
|
79
|
+
constructor(providers: IMastraAuthProvider[]);
|
|
43
80
|
private findProvider;
|
|
44
81
|
private rememberAuthenticatedProvider;
|
|
45
82
|
private takeAuthenticatedProvider;
|
package/dist/index.cjs
CHANGED
|
@@ -617,7 +617,7 @@ var MastraBase = class {
|
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
619
|
|
|
620
|
-
// ../../packages/_internals/auth/dist/chunk-
|
|
620
|
+
// ../../packages/_internals/auth/dist/chunk-7GLKLOU3.js
|
|
621
621
|
var MastraAuthProvider = class extends MastraBase {
|
|
622
622
|
protected;
|
|
623
623
|
public;
|
|
@@ -936,7 +936,7 @@ var MastraCloudAuthProvider = class extends MastraAuthProvider {
|
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
938
|
|
|
939
|
-
// ../../packages/_internals/auth/dist/chunk-
|
|
939
|
+
// ../../packages/_internals/auth/dist/chunk-GVS7OL46.js
|
|
940
940
|
var RESOURCE_EXPANSIONS = {
|
|
941
941
|
stored: [
|
|
942
942
|
"stored-agents",
|