@mastra/auth-workos 0.0.0-consolidate-changesets-20250904042643

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/LICENSE.md +15 -0
  3. package/README.md +78 -0
  4. package/dist/chunk-32EQK4OY.js +974 -0
  5. package/dist/chunk-32EQK4OY.js.map +1 -0
  6. package/dist/chunk-B2N25K77.cjs +979 -0
  7. package/dist/chunk-B2N25K77.cjs.map +1 -0
  8. package/dist/chunk-G7ML3FDV.js +9 -0
  9. package/dist/chunk-G7ML3FDV.js.map +1 -0
  10. package/dist/chunk-UYPX6MT6.cjs +32 -0
  11. package/dist/chunk-UYPX6MT6.cjs.map +1 -0
  12. package/dist/getMachineId-bsd-G4THBH3V.js +23 -0
  13. package/dist/getMachineId-bsd-G4THBH3V.js.map +1 -0
  14. package/dist/getMachineId-bsd-GQTQCD37.cjs +25 -0
  15. package/dist/getMachineId-bsd-GQTQCD37.cjs.map +1 -0
  16. package/dist/getMachineId-darwin-3P7FJFHV.js +24 -0
  17. package/dist/getMachineId-darwin-3P7FJFHV.js.map +1 -0
  18. package/dist/getMachineId-darwin-43NRSF2D.cjs +26 -0
  19. package/dist/getMachineId-darwin-43NRSF2D.cjs.map +1 -0
  20. package/dist/getMachineId-linux-H4F4I7A5.js +19 -0
  21. package/dist/getMachineId-linux-H4F4I7A5.js.map +1 -0
  22. package/dist/getMachineId-linux-TZ3NOAZ5.cjs +21 -0
  23. package/dist/getMachineId-linux-TZ3NOAZ5.cjs.map +1 -0
  24. package/dist/getMachineId-unsupported-EZLLFFYA.cjs +13 -0
  25. package/dist/getMachineId-unsupported-EZLLFFYA.cjs.map +1 -0
  26. package/dist/getMachineId-unsupported-T3AERO5R.js +11 -0
  27. package/dist/getMachineId-unsupported-T3AERO5R.js.map +1 -0
  28. package/dist/getMachineId-win-B5AEGZT7.cjs +47 -0
  29. package/dist/getMachineId-win-B5AEGZT7.cjs.map +1 -0
  30. package/dist/getMachineId-win-Z5QAASBF.js +25 -0
  31. package/dist/getMachineId-win-Z5QAASBF.js.map +1 -0
  32. package/dist/index.cjs +464 -0
  33. package/dist/index.cjs.map +1 -0
  34. package/dist/index.d.ts +17 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +462 -0
  37. package/dist/index.js.map +1 -0
  38. package/package.json +55 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,99 @@
1
+ # @mastra/auth-workos
2
+
3
+ ## 0.0.0-consolidate-changesets-20250904042643
4
+
5
+ ### Patch Changes
6
+
7
+ - de3cbc6: Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
8
+ - f5e7282: Cookie vuln
9
+ MastraEmbeddingModel and ts hack
10
+ Support file download
11
+ Add tripwire chunk to streamVNext full stream
12
+ Ensure original stacktrace is preserved during workflow runs
13
+ improveEmbeddingModelStuff
14
+ upgrade ai v5 versions to latest for core and memory
15
+ Add maxSteps
16
+ Pass provider options
17
+ fix default stream options onFinish being overridden
18
+ add deployer, server and clientjs handlers for agent builder template
19
+ temp disable agent-builder workflows import
20
+ Inngest: move zod to peerDependencies
21
+ added providerOptions to createVectorQueryTool and createGraphRAGTool
22
+ dependencies updates:
23
+ - Updated dependency [`zod-to-json-schema@^3.24.6` ↗︎](https://www.npmjs.com/package/zod-to-json-schema/v/3.24.6) (from `^3.24.5`, in `dependencies`)
24
+ - Updated dependencies [de3cbc6]
25
+ - @mastra/auth@0.0.0-consolidate-changesets-20250904042643
26
+
27
+ ## 0.10.5-alpha.1
28
+
29
+ ### Patch Changes
30
+
31
+ - [#7343](https://github.com/mastra-ai/mastra/pull/7343) [`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e) Thanks [@LekoArts](https://github.com/LekoArts)! - Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
32
+
33
+ - Updated dependencies [[`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e)]:
34
+ - @mastra/auth@0.1.3-alpha.0
35
+
36
+ ## 0.10.5-alpha.0
37
+
38
+ ### Patch Changes
39
+
40
+ - [#7220](https://github.com/mastra-ai/mastra/pull/7220) [`cb9aa8c`](https://github.com/mastra-ai/mastra/commit/cb9aa8c8564bafa1b6e5321cca5a1bc4d3170590) Thanks [@abhiaiyer91](https://github.com/abhiaiyer91)! - Cookie vuln
41
+
42
+ - Updated dependencies []:
43
+ - @mastra/auth@0.1.2
44
+
45
+ ## 0.10.4
46
+
47
+ ### Patch Changes
48
+
49
+ - [`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix peerdpes for @mastra/core
50
+
51
+ - Updated dependencies [[`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430)]:
52
+ - @mastra/auth@0.1.2
53
+
54
+ ## 0.10.3
55
+
56
+ ### Patch Changes
57
+
58
+ - 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
59
+ - Updated dependencies [4a406ec]
60
+ - @mastra/auth@0.1.1
61
+
62
+ ## 0.10.3-alpha.0
63
+
64
+ ### Patch Changes
65
+
66
+ - 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
67
+ - Updated dependencies [4a406ec]
68
+ - @mastra/auth@0.1.1-alpha.0
69
+
70
+ ## 0.10.2
71
+
72
+ ### Patch Changes
73
+
74
+ - 9c159ee: dependencies updates:
75
+ - Updated dependency [`@workos-inc/node@^7.57.0` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.57.0) (from `^7.54.0`, in `dependencies`)
76
+ - @mastra/auth@0.1.0
77
+
78
+ ## 0.10.2-alpha.0
79
+
80
+ ### Patch Changes
81
+
82
+ - 9c159ee: dependencies updates:
83
+ - Updated dependency [`@workos-inc/node@^7.57.0` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.57.0) (from `^7.54.0`, in `dependencies`)
84
+
85
+ ## 0.10.1
86
+
87
+ ### Patch Changes
88
+
89
+ - 63f6b7d: dependencies updates:
90
+ - Updated dependency [`@workos-inc/node@^7.54.0` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.54.0) (from `^7.50.1`, in `dependencies`)
91
+ - @mastra/auth@0.1.0
92
+
93
+ ## 0.10.1-alpha.0
94
+
95
+ ### Patch Changes
96
+
97
+ - 63f6b7d: dependencies updates:
98
+ - Updated dependency [`@workos-inc/node@^7.54.0` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.54.0) (from `^7.50.1`, in `dependencies`)
99
+ - @mastra/auth@0.1.0
package/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ # Apache License 2.0
2
+
3
+ Copyright (c) 2025 Kepler Software, Inc.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @mastra/auth-workos
2
+
3
+ A WorkOS authentication provider for Mastra, enabling seamless integration of WorkOS authentication and authorization in your applications.
4
+
5
+ ## Features
6
+
7
+ - 🔐 WorkOS authentication integration
8
+ - 👥 User management and organization membership support
9
+ - 🔑 JWT token verification using WorkOS JWKS
10
+ - 👮‍♂️ Role-based authorization with admin role support
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @mastra/auth-workos
16
+ # or
17
+ yarn add @mastra/auth-workos
18
+ # or
19
+ pnpm add @mastra/auth-workos
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```typescript
25
+ import { Mastra } from '@mastra/core';
26
+ import { MastraAuthWorkos } from '@mastra/auth-workos';
27
+
28
+ // Initialize with environment variables
29
+ const auth = new MastraAuthWorkos();
30
+
31
+ // Or initialize with explicit configuration
32
+ const auth = new MastraAuthWorkos({
33
+ apiKey: 'your_workos_api_key',
34
+ clientId: 'your_workos_client_id',
35
+ });
36
+
37
+ // Enable auth in Mastra
38
+ const mastra = new Mastra({
39
+ ...
40
+ server: {
41
+ experimental_auth: auth,
42
+ },
43
+ });
44
+ ```
45
+
46
+ ## Configuration
47
+
48
+ The package requires the following configuration:
49
+
50
+ ### Environment Variables
51
+
52
+ - `WORKOS_API_KEY`: Your WorkOS API key
53
+ - `WORKOS_CLIENT_ID`: Your WorkOS client ID
54
+
55
+ ### Options
56
+
57
+ You can also provide these values directly when initializing the provider:
58
+
59
+ ```typescript
60
+ interface MastraAuthWorkosOptions {
61
+ apiKey?: string;
62
+ clientId?: string;
63
+ }
64
+ ```
65
+
66
+ ## API
67
+
68
+ ### `authenticateToken(token: string): Promise<WorkosUser | null>`
69
+
70
+ Verifies a JWT token using WorkOS JWKS and returns the user information if valid.
71
+
72
+ ### `authorizeUser(user: WorkosUser): Promise<boolean>`
73
+
74
+ Checks if a user has admin privileges by verifying their organization memberships and roles.
75
+
76
+ ## License
77
+
78
+ MIT