@mastra/auth-workos
Advanced tools
+7
-0
| # @mastra/auth-workos | ||
| ## 1.6.2-alpha.0 | ||
| ### Patch Changes | ||
| - Updated dependencies [[`705ff39`](https://github.com/mastra-ai/mastra/commit/705ff3969e57214ff2fdaf3815d751dd558886ed)]: | ||
| - @mastra/auth@1.1.2-alpha.0 | ||
| ## 1.6.1 | ||
@@ -4,0 +11,0 @@ |
@@ -13,3 +13,3 @@ /** | ||
| */ | ||
| export declare const RESOURCES: readonly ["a2a", "agent-builder", "agent-controller", "agents", "auth", "background-tasks", "channels", "datasets", "embedders", "experiments", "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"]; | ||
| 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"]; | ||
| /** | ||
@@ -74,2 +74,4 @@ * Resource type union. | ||
| readonly 'experiments:*': "experiments:*"; | ||
| /** Full access to heartbeats */ | ||
| readonly 'heartbeats:*': "heartbeats:*"; | ||
| /** Full access to infrastructure */ | ||
@@ -163,2 +165,10 @@ readonly 'infrastructure:*': "infrastructure:*"; | ||
| readonly 'experiments:read': "experiments:read"; | ||
| /** Delete heartbeats */ | ||
| readonly 'heartbeats:delete': "heartbeats:delete"; | ||
| /** Execute heartbeats */ | ||
| readonly 'heartbeats:execute': "heartbeats:execute"; | ||
| /** View heartbeats */ | ||
| readonly 'heartbeats:read': "heartbeats:read"; | ||
| /** Create and modify heartbeats */ | ||
| readonly 'heartbeats:write': "heartbeats:write"; | ||
| /** View infrastructure */ | ||
@@ -309,3 +319,3 @@ readonly 'infrastructure:read': "infrastructure:read"; | ||
| */ | ||
| 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", "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"]; | ||
| 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"]; | ||
| /** | ||
@@ -366,2 +376,10 @@ * Specific permission type (e.g., 'agents:read', 'workflows:execute'). | ||
| readonly EXPERIMENTS_READ: "experiments:read"; | ||
| /** Delete heartbeats */ | ||
| readonly HEARTBEATS_DELETE: "heartbeats:delete"; | ||
| /** Execute heartbeats */ | ||
| readonly HEARTBEATS_EXECUTE: "heartbeats:execute"; | ||
| /** View heartbeats */ | ||
| readonly HEARTBEATS_READ: "heartbeats:read"; | ||
| /** Create and modify heartbeats */ | ||
| readonly HEARTBEATS_WRITE: "heartbeats:write"; | ||
| /** View infrastructure */ | ||
@@ -368,0 +386,0 @@ readonly INFRASTRUCTURE_READ: "infrastructure:read"; |
@@ -17,6 +17,43 @@ import { MastraBase } from '../_types/@internal_core/dist/base/index.d.ts'; | ||
| } | ||
| export declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase { | ||
| /** | ||
| * Structural description of the public surface of a `MastraAuthProvider`. | ||
| * | ||
| * Auth provider packages bundle their own copy of the `MastraAuthProvider` | ||
| * declaration, so provider class types cannot be compared nominally across | ||
| * package boundaries — `#private`/`protected` members would make otherwise | ||
| * identical copies mutually unassignable. Positions that accept user-supplied | ||
| * providers (e.g. `server.auth`, `CompositeAuth`) accept this interface | ||
| * instead of the class. | ||
| * | ||
| * Note: methods intentionally use method syntax (not property syntax) so they | ||
| * are checked bivariantly — providers with a narrower `TUser` must remain | ||
| * assignable to `IMastraAuthProvider<unknown>`. | ||
| */ | ||
| export interface IMastraAuthProvider<TUser = unknown> { | ||
| name?: string; | ||
| /** | ||
| * Protected paths for the auth provider | ||
| */ | ||
| protected?: MastraAuthConfig['protected']; | ||
| /** | ||
| * Public paths for the auth provider | ||
| */ | ||
| public?: MastraAuthConfig['public']; | ||
| /** | ||
| * Authenticate a token and return the payload | ||
| */ | ||
| authenticateToken(token: string, request: MastraAuthRequest): Promise<TUser | null>; | ||
| /** | ||
| * Authorize a user for a path and method | ||
| */ | ||
| authorizeUser(user: TUser, request: MastraAuthRequest): Promise<boolean> | boolean; | ||
| /** | ||
| * Map an authenticated user to a memory resource id | ||
| */ | ||
| mapUserToResourceId?(user: TUser): string | undefined | null; | ||
| } | ||
| export declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase implements IMastraAuthProvider<TUser> { | ||
| protected?: MastraAuthConfig['protected']; | ||
| public?: MastraAuthConfig['public']; | ||
| mapUserToResourceId?(user: TUser): string | undefined | null; | ||
| constructor(options?: MastraAuthProviderOptions<TUser>); | ||
@@ -43,3 +80,3 @@ /** | ||
| private authenticatedProviderByPrimitive; | ||
| constructor(providers: MastraAuthProvider[]); | ||
| constructor(providers: IMastraAuthProvider[]); | ||
| private findProvider; | ||
@@ -46,0 +83,0 @@ private rememberAuthenticatedProvider; |
+2
-2
@@ -160,3 +160,3 @@ 'use strict'; | ||
| // ../../packages/_internals/auth/dist/chunk-XG6GH2VJ.js | ||
| // ../../packages/_internals/auth/dist/chunk-7GLKLOU3.js | ||
| var MastraAuthProvider = class extends MastraBase { | ||
@@ -791,3 +791,3 @@ protected; | ||
| // ../../packages/_internals/auth/dist/chunk-7SVOHBXQ.js | ||
| // ../../packages/_internals/auth/dist/chunk-GVS7OL46.js | ||
| var FGADeniedError = class extends Error { | ||
@@ -794,0 +794,0 @@ user; |
+2
-2
@@ -158,3 +158,3 @@ import { verifyJwks } from '@mastra/auth'; | ||
| // ../../packages/_internals/auth/dist/chunk-XG6GH2VJ.js | ||
| // ../../packages/_internals/auth/dist/chunk-7GLKLOU3.js | ||
| var MastraAuthProvider = class extends MastraBase { | ||
@@ -789,3 +789,3 @@ protected; | ||
| // ../../packages/_internals/auth/dist/chunk-7SVOHBXQ.js | ||
| // ../../packages/_internals/auth/dist/chunk-GVS7OL46.js | ||
| var FGADeniedError = class extends Error { | ||
@@ -792,0 +792,0 @@ user; |
+5
-5
| { | ||
| "name": "@mastra/auth-workos", | ||
| "version": "1.6.1", | ||
| "version": "1.6.2-alpha.0", | ||
| "description": "Mastra WorkOS Auth integration", | ||
@@ -26,3 +26,3 @@ "type": "module", | ||
| "lru-cache": "^11.2.7", | ||
| "@mastra/auth": "1.1.1" | ||
| "@mastra/auth": "1.1.2-alpha.0" | ||
| }, | ||
@@ -40,5 +40,5 @@ "peerDependencies": { | ||
| "vitest": "4.1.8", | ||
| "@internal/auth": "0.0.1", | ||
| "@internal/types-builder": "0.0.84", | ||
| "@internal/lint": "0.0.109" | ||
| "@internal/lint": "0.0.110", | ||
| "@internal/types-builder": "0.0.85", | ||
| "@internal/auth": "0.0.2" | ||
| }, | ||
@@ -45,0 +45,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
718456
0.77%7516
0.74%1
Infinity%+ Added
- Removed
Updated