@mastra/auth-workos 1.6.7 → 1.6.8
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/dist/_types/@internal_auth/dist/_types/@internal_core/dist/base/index.d.ts +2 -5
- package/dist/_types/@internal_auth/dist/_types/@internal_core/dist/{index-Biaf3BmX.d.ts → index-TNVgGNjs.d.ts} +1 -5
- package/dist/_types/@internal_auth/dist/session/index.d.ts +9 -0
- package/dist/index.cjs +12 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -23
- package/dist/index.js.map +1 -1
- package/dist/session-storage.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as IMastraLogger, u as RegisteredLogger } from "../index-
|
|
2
|
-
|
|
3
|
-
declare class MastraBase {
|
|
1
|
+
import { i as IMastraLogger, u as RegisteredLogger } from "../index-TNVgGNjs.js";
|
|
2
|
+
export declare class MastraBase {
|
|
4
3
|
#private;
|
|
5
4
|
component: RegisteredLogger;
|
|
6
5
|
protected logger: IMastraLogger;
|
|
@@ -26,6 +25,4 @@ declare class MastraBase {
|
|
|
26
25
|
*/
|
|
27
26
|
__setLogger(logger: IMastraLogger): void;
|
|
28
27
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { MastraBase };
|
|
31
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Transform } from "stream";
|
|
2
|
-
//#region src/logger/adapter.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* OpenTelemetry-compatible trace correlation fields, injected at the top
|
|
5
4
|
* level of a logger's native record.
|
|
@@ -91,8 +90,6 @@ declare function exportTrackedException(ctx: LoggerAdapterContext | undefined, e
|
|
|
91
90
|
* so the derived record preserves all context from the native call.
|
|
92
91
|
*/
|
|
93
92
|
declare function buildLogRecordData(args: unknown[]): Record<string, unknown> | undefined;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/logger/index.d.ts
|
|
96
93
|
declare const RegisteredLogger: {
|
|
97
94
|
readonly AGENT: 'AGENT';
|
|
98
95
|
readonly OBSERVABILITY: 'OBSERVABILITY';
|
|
@@ -314,6 +311,5 @@ declare class ConsoleLogger extends MastraLogger {
|
|
|
314
311
|
hasMore: boolean;
|
|
315
312
|
}>;
|
|
316
313
|
}
|
|
317
|
-
//#endregion
|
|
318
314
|
export { buildLogRecordData as _, LogFilter as a, LoggerTransport as c, createCustomTransport as d, AdaptableLogger as f, TraceFields as g, LoggerAdapterOptions as h, IMastraLogger as i, MastraLogger as l, LoggerAdapterContext as m, ConsoleLogger as n, LogFilterContext as o, AdapterLogSink as p, ConsoleLoggerOptions as r, LogLevel as s, BaseLogMessage as t, RegisteredLogger as u, exportTrackedException as v, isAdaptableLogger as y };
|
|
319
|
-
//# sourceMappingURL=index-
|
|
315
|
+
//# sourceMappingURL=index-TNVgGNjs.d.ts.map
|
|
@@ -24,6 +24,15 @@ export interface ISessionProvider<TSession extends Session = Session> {
|
|
|
24
24
|
getSessionIdFromRequest(request: Request): string | null;
|
|
25
25
|
getSessionHeaders(session: TSession): Record<string, string>;
|
|
26
26
|
getClearSessionHeaders(): Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional: `Set-Cookie` values expiring legacy copies of the session cookie
|
|
29
|
+
* (for example one an earlier release scoped to a shared parent `Domain`).
|
|
30
|
+
* A browser only deletes a cookie whose exact `(name, Domain, Path)` match,
|
|
31
|
+
* so servers append these to every response that sets or clears the session
|
|
32
|
+
* cookie; otherwise a stale shared-domain copy keeps being sent to every
|
|
33
|
+
* sibling host until it expires.
|
|
34
|
+
*/
|
|
35
|
+
getLegacySessionClearCookies?(): string[];
|
|
27
36
|
}
|
|
28
37
|
export { MemorySessionProvider, type MemorySessionProviderOptions } from './memory.js';
|
|
29
38
|
export { CookieSessionProvider, type CookieSessionProviderOptions } from './cookie.js';
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let _mastra_auth = require("@mastra/auth");
|
|
|
3
3
|
let _workos_authkit_session = require("@workos/authkit-session");
|
|
4
4
|
let _workos_inc_node = require("@workos-inc/node");
|
|
5
5
|
let lru_cache = require("lru-cache");
|
|
6
|
-
|
|
6
|
+
// ../../packages/_internal-core/dist/logger/index.js
|
|
7
7
|
/**
|
|
8
8
|
* Export a tracked exception through the adapter sink, mirroring the
|
|
9
9
|
* DualLogger dual-write shape (`errorId`/`domain`/`category`/`details`/`cause`
|
|
@@ -236,8 +236,7 @@ var ConsoleLogger = class ConsoleLogger extends MastraLogger {
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
|
-
|
|
240
|
-
//#region ../../packages/_internal-core/dist/base/index.js
|
|
239
|
+
// ../../packages/_internal-core/dist/base/index.js
|
|
241
240
|
var MastraBase = class {
|
|
242
241
|
component = RegisteredLogger.LLM;
|
|
243
242
|
logger;
|
|
@@ -271,8 +270,7 @@ var MastraBase = class {
|
|
|
271
270
|
this.logger = "child" in logger && typeof logger.child === "function" ? logger.child({ component: this.component }) : logger;
|
|
272
271
|
}
|
|
273
272
|
};
|
|
274
|
-
|
|
275
|
-
//#region ../../packages/_internals/auth/dist/provider/index.js
|
|
273
|
+
// ../../packages/_internals/auth/dist/provider/index.js
|
|
276
274
|
var MastraAuthProvider = class extends MastraBase {
|
|
277
275
|
protected;
|
|
278
276
|
public;
|
|
@@ -284,7 +282,7 @@ var MastraAuthProvider = class extends MastraBase {
|
|
|
284
282
|
if (options?.authorizeUser) this.authorizeUser = options.authorizeUser.bind(this);
|
|
285
283
|
this.protected = options?.protected;
|
|
286
284
|
this.public = options?.public;
|
|
287
|
-
this.mapUserToResourceId = options
|
|
285
|
+
if (options?.mapUserToResourceId) this.mapUserToResourceId = options.mapUserToResourceId;
|
|
288
286
|
}
|
|
289
287
|
registerOptions(opts) {
|
|
290
288
|
if (opts?.authorizeUser) this.authorizeUser = opts.authorizeUser.bind(this);
|
|
@@ -293,8 +291,7 @@ var MastraAuthProvider = class extends MastraBase {
|
|
|
293
291
|
if (opts?.public) this.public = opts.public;
|
|
294
292
|
}
|
|
295
293
|
};
|
|
296
|
-
|
|
297
|
-
//#region src/session-storage.ts
|
|
294
|
+
// src/session-storage.ts
|
|
298
295
|
/**
|
|
299
296
|
* Hono/Web Request session storage adapter for WorkOS AuthKit.
|
|
300
297
|
*
|
|
@@ -328,8 +325,7 @@ var WebSessionStorage = class extends _workos_authkit_session.CookieSessionStora
|
|
|
328
325
|
}, {})[name] ?? null;
|
|
329
326
|
}
|
|
330
327
|
};
|
|
331
|
-
|
|
332
|
-
//#region src/types.ts
|
|
328
|
+
// src/types.ts
|
|
333
329
|
/**
|
|
334
330
|
* Maps a WorkOS User to EEUser format.
|
|
335
331
|
*/
|
|
@@ -346,8 +342,7 @@ function mapWorkOSUserToEEUser(user) {
|
|
|
346
342
|
}
|
|
347
343
|
};
|
|
348
344
|
}
|
|
349
|
-
|
|
350
|
-
//#region src/auth-provider.ts
|
|
345
|
+
// src/auth-provider.ts
|
|
351
346
|
function getWebRequest(request) {
|
|
352
347
|
if (request instanceof Request) return request;
|
|
353
348
|
return request.raw instanceof Request ? request.raw : void 0;
|
|
@@ -940,8 +935,7 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
|
|
|
940
935
|
return this.redirectUri;
|
|
941
936
|
}
|
|
942
937
|
};
|
|
943
|
-
|
|
944
|
-
//#region ../../packages/_internals/auth/dist/ee-XRuijAiF.js
|
|
938
|
+
// ../../packages/_internals/auth/dist/ee-CAe-UJ9n.js
|
|
945
939
|
/**
|
|
946
940
|
* FGA enforcement utility for checking fine-grained authorization.
|
|
947
941
|
*
|
|
@@ -1069,8 +1063,7 @@ function resolvePermissionsFromMapping(roles, mapping) {
|
|
|
1069
1063
|
* @license Mastra Enterprise License - see ee/LICENSE
|
|
1070
1064
|
* @packageDocumentation
|
|
1071
1065
|
*/
|
|
1072
|
-
|
|
1073
|
-
//#region src/rbac-provider.ts
|
|
1066
|
+
// src/rbac-provider.ts
|
|
1074
1067
|
/**
|
|
1075
1068
|
* WorkOS RBAC provider that maps organization roles to Mastra permissions.
|
|
1076
1069
|
*
|
|
@@ -1300,8 +1293,7 @@ var MastraRBACWorkos = class {
|
|
|
1300
1293
|
return (this.options.organizationId ? user.memberships.filter((m) => m.organizationId === this.options.organizationId) : user.memberships).map((m) => m.role.slug);
|
|
1301
1294
|
}
|
|
1302
1295
|
};
|
|
1303
|
-
|
|
1304
|
-
//#region src/fga-provider.ts
|
|
1296
|
+
// src/fga-provider.ts
|
|
1305
1297
|
/**
|
|
1306
1298
|
* WorkOS FGA provider for Mastra.
|
|
1307
1299
|
*
|
|
@@ -1737,8 +1729,7 @@ var MastraFGAWorkos = class {
|
|
|
1737
1729
|
};
|
|
1738
1730
|
}
|
|
1739
1731
|
};
|
|
1740
|
-
|
|
1741
|
-
//#region src/directory-sync.ts
|
|
1732
|
+
// src/directory-sync.ts
|
|
1742
1733
|
/**
|
|
1743
1734
|
* WorkOSDirectorySync handles SCIM webhook events from WorkOS for automated
|
|
1744
1735
|
* user provisioning and deprovisioning.
|
|
@@ -1947,8 +1938,7 @@ var WorkOSDirectorySync = class {
|
|
|
1947
1938
|
return (await this.workos.directorySync.listGroups({ directory: directoryId })).data;
|
|
1948
1939
|
}
|
|
1949
1940
|
};
|
|
1950
|
-
|
|
1951
|
-
//#region src/admin-portal.ts
|
|
1941
|
+
// src/admin-portal.ts
|
|
1952
1942
|
/**
|
|
1953
1943
|
* WorkOS Admin Portal integration for customer self-service configuration.
|
|
1954
1944
|
*
|
|
@@ -2041,7 +2031,6 @@ var WorkOSAdminPortal = class {
|
|
|
2041
2031
|
})).link;
|
|
2042
2032
|
}
|
|
2043
2033
|
};
|
|
2044
|
-
//#endregion
|
|
2045
2034
|
exports.MastraAuthWorkos = MastraAuthWorkos;
|
|
2046
2035
|
exports.MastraFGAWorkos = MastraFGAWorkos;
|
|
2047
2036
|
exports.MastraRBACWorkos = MastraRBACWorkos;
|