@mastra/auth-workos 0.0.0-add-libsql-changeset-20250910154739
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 +93 -0
- package/LICENSE.md +15 -0
- package/README.md +78 -0
- package/dist/chunk-FID6GZ7C.cjs +979 -0
- package/dist/chunk-FID6GZ7C.cjs.map +1 -0
- package/dist/chunk-G7ML3FDV.js +9 -0
- package/dist/chunk-G7ML3FDV.js.map +1 -0
- package/dist/chunk-NFPWCYXA.js +974 -0
- package/dist/chunk-NFPWCYXA.js.map +1 -0
- package/dist/chunk-UYPX6MT6.cjs +32 -0
- package/dist/chunk-UYPX6MT6.cjs.map +1 -0
- package/dist/getMachineId-bsd-33IUL36D.js +23 -0
- package/dist/getMachineId-bsd-33IUL36D.js.map +1 -0
- package/dist/getMachineId-bsd-7LX32PWC.cjs +25 -0
- package/dist/getMachineId-bsd-7LX32PWC.cjs.map +1 -0
- package/dist/getMachineId-darwin-2GRB6VRE.cjs +26 -0
- package/dist/getMachineId-darwin-2GRB6VRE.cjs.map +1 -0
- package/dist/getMachineId-darwin-Y4EF6EE5.js +24 -0
- package/dist/getMachineId-darwin-Y4EF6EE5.js.map +1 -0
- package/dist/getMachineId-linux-6PTMU7AF.cjs +21 -0
- package/dist/getMachineId-linux-6PTMU7AF.cjs.map +1 -0
- package/dist/getMachineId-linux-ZMMZL7AP.js +19 -0
- package/dist/getMachineId-linux-ZMMZL7AP.js.map +1 -0
- package/dist/getMachineId-unsupported-AM53N2Q3.js +11 -0
- package/dist/getMachineId-unsupported-AM53N2Q3.js.map +1 -0
- package/dist/getMachineId-unsupported-VSEGAZUW.cjs +13 -0
- package/dist/getMachineId-unsupported-VSEGAZUW.cjs.map +1 -0
- package/dist/getMachineId-win-GHQJSLHS.cjs +47 -0
- package/dist/getMachineId-win-GHQJSLHS.cjs.map +1 -0
- package/dist/getMachineId-win-RSU6GP4O.js +25 -0
- package/dist/getMachineId-win-RSU6GP4O.js.map +1 -0
- package/dist/index.cjs +464 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +462 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @mastra/auth-workos
|
|
2
|
+
|
|
3
|
+
## 0.0.0-add-libsql-changeset-20250910154739
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dependencies updates: ([#7568](https://github.com/mastra-ai/mastra/pull/7568))
|
|
8
|
+
- Updated dependency [`@workos-inc/node@^7.69.2` ↗︎](https://www.npmjs.com/package/@workos-inc/node/v/7.69.2) (from `^7.69.1`, in `dependencies`)
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @mastra/auth@0.1.3
|
|
11
|
+
|
|
12
|
+
## 0.10.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- de3cbc6: Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
|
|
17
|
+
- cb9aa8c: Cookie vuln
|
|
18
|
+
- Updated dependencies [de3cbc6]
|
|
19
|
+
- @mastra/auth@0.1.3
|
|
20
|
+
|
|
21
|
+
## 0.10.5-alpha.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#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`.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e)]:
|
|
28
|
+
- @mastra/auth@0.1.3-alpha.0
|
|
29
|
+
|
|
30
|
+
## 0.10.5-alpha.0
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- [#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
|
|
35
|
+
|
|
36
|
+
- Updated dependencies []:
|
|
37
|
+
- @mastra/auth@0.1.2
|
|
38
|
+
|
|
39
|
+
## 0.10.4
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430) Thanks [@wardpeet](https://github.com/wardpeet)! - Fix peerdpes for @mastra/core
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [[`c6113ed`](https://github.com/mastra-ai/mastra/commit/c6113ed7f9df297e130d94436ceee310273d6430)]:
|
|
46
|
+
- @mastra/auth@0.1.2
|
|
47
|
+
|
|
48
|
+
## 0.10.3
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
53
|
+
- Updated dependencies [4a406ec]
|
|
54
|
+
- @mastra/auth@0.1.1
|
|
55
|
+
|
|
56
|
+
## 0.10.3-alpha.0
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
61
|
+
- Updated dependencies [4a406ec]
|
|
62
|
+
- @mastra/auth@0.1.1-alpha.0
|
|
63
|
+
|
|
64
|
+
## 0.10.2
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- 9c159ee: dependencies updates:
|
|
69
|
+
- 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`)
|
|
70
|
+
- @mastra/auth@0.1.0
|
|
71
|
+
|
|
72
|
+
## 0.10.2-alpha.0
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 9c159ee: dependencies updates:
|
|
77
|
+
- 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`)
|
|
78
|
+
|
|
79
|
+
## 0.10.1
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- 63f6b7d: dependencies updates:
|
|
84
|
+
- 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`)
|
|
85
|
+
- @mastra/auth@0.1.0
|
|
86
|
+
|
|
87
|
+
## 0.10.1-alpha.0
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- 63f6b7d: dependencies updates:
|
|
92
|
+
- 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`)
|
|
93
|
+
- @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
|