@mastra/auth-okta 0.2.5 → 0.2.6
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 +9 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -17
- package/dist/index.js.map +1 -1
- package/dist/rbac-provider.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let lru_cache = require("lru-cache");
|
|
3
3
|
let jose = require("jose");
|
|
4
|
-
|
|
4
|
+
// ../../packages/_internals/auth/dist/ee-CAe-UJ9n.js
|
|
5
5
|
/**
|
|
6
6
|
* FGA enforcement utility for checking fine-grained authorization.
|
|
7
7
|
*
|
|
@@ -110,8 +110,7 @@ function resolvePermissionsFromMapping(roles, mapping) {
|
|
|
110
110
|
* @license Mastra Enterprise License - see ee/LICENSE
|
|
111
111
|
* @packageDocumentation
|
|
112
112
|
*/
|
|
113
|
-
|
|
114
|
-
//#region src/rbac-provider.ts
|
|
113
|
+
// src/rbac-provider.ts
|
|
115
114
|
/** Default cache TTL in milliseconds (60 seconds) */
|
|
116
115
|
const DEFAULT_CACHE_TTL_MS = 6e4;
|
|
117
116
|
/** Default max cache size (number of users) */
|
|
@@ -313,8 +312,7 @@ var MastraRBACOkta = class {
|
|
|
313
312
|
return permissions.some((required) => userPermissions.some((granted) => matchesPermission(granted, required)));
|
|
314
313
|
}
|
|
315
314
|
};
|
|
316
|
-
|
|
317
|
-
//#region ../../packages/_internals/auth/dist/types/index.js
|
|
315
|
+
// ../../packages/_internals/auth/dist/types/index.js
|
|
318
316
|
function headerFromPlainObject(headers, name) {
|
|
319
317
|
const normalizedName = name.toLowerCase();
|
|
320
318
|
const matchingKey = Object.keys(headers).find((key) => key.toLowerCase() === normalizedName);
|
|
@@ -334,8 +332,7 @@ function getRequestHeader(request, name) {
|
|
|
334
332
|
if (headers && typeof headers === "object") return headerFromPlainObject(headers, name);
|
|
335
333
|
return null;
|
|
336
334
|
}
|
|
337
|
-
|
|
338
|
-
//#region ../../packages/_internal-core/dist/logger/index.js
|
|
335
|
+
// ../../packages/_internal-core/dist/logger/index.js
|
|
339
336
|
/**
|
|
340
337
|
* Export a tracked exception through the adapter sink, mirroring the
|
|
341
338
|
* DualLogger dual-write shape (`errorId`/`domain`/`category`/`details`/`cause`
|
|
@@ -568,8 +565,7 @@ var ConsoleLogger = class ConsoleLogger extends MastraLogger {
|
|
|
568
565
|
};
|
|
569
566
|
}
|
|
570
567
|
};
|
|
571
|
-
|
|
572
|
-
//#region ../../packages/_internal-core/dist/base/index.js
|
|
568
|
+
// ../../packages/_internal-core/dist/base/index.js
|
|
573
569
|
var MastraBase = class {
|
|
574
570
|
component = RegisteredLogger.LLM;
|
|
575
571
|
logger;
|
|
@@ -603,8 +599,7 @@ var MastraBase = class {
|
|
|
603
599
|
this.logger = "child" in logger && typeof logger.child === "function" ? logger.child({ component: this.component }) : logger;
|
|
604
600
|
}
|
|
605
601
|
};
|
|
606
|
-
|
|
607
|
-
//#region ../../packages/_internals/auth/dist/provider/index.js
|
|
602
|
+
// ../../packages/_internals/auth/dist/provider/index.js
|
|
608
603
|
var MastraAuthProvider = class extends MastraBase {
|
|
609
604
|
protected;
|
|
610
605
|
public;
|
|
@@ -616,7 +611,7 @@ var MastraAuthProvider = class extends MastraBase {
|
|
|
616
611
|
if (options?.authorizeUser) this.authorizeUser = options.authorizeUser.bind(this);
|
|
617
612
|
this.protected = options?.protected;
|
|
618
613
|
this.public = options?.public;
|
|
619
|
-
this.mapUserToResourceId = options
|
|
614
|
+
if (options?.mapUserToResourceId) this.mapUserToResourceId = options.mapUserToResourceId;
|
|
620
615
|
}
|
|
621
616
|
registerOptions(opts) {
|
|
622
617
|
if (opts?.authorizeUser) this.authorizeUser = opts.authorizeUser.bind(this);
|
|
@@ -625,8 +620,7 @@ var MastraAuthProvider = class extends MastraBase {
|
|
|
625
620
|
if (opts?.public) this.public = opts.public;
|
|
626
621
|
}
|
|
627
622
|
};
|
|
628
|
-
|
|
629
|
-
//#region src/types.ts
|
|
623
|
+
// src/types.ts
|
|
630
624
|
/**
|
|
631
625
|
* Maps Okta JWT claims to OktaUser format.
|
|
632
626
|
*
|
|
@@ -648,8 +642,7 @@ function mapOktaClaimsToUser(payload) {
|
|
|
648
642
|
}
|
|
649
643
|
};
|
|
650
644
|
}
|
|
651
|
-
|
|
652
|
-
//#region src/auth-provider.ts
|
|
645
|
+
// src/auth-provider.ts
|
|
653
646
|
/**
|
|
654
647
|
* Trim trailing slashes. Index scan instead of regex to avoid backtracking
|
|
655
648
|
* (CodeQL js/polynomial-redos).
|
|
@@ -1042,7 +1035,6 @@ var MastraAuthOkta = class extends MastraAuthProvider {
|
|
|
1042
1035
|
return this.issuer;
|
|
1043
1036
|
}
|
|
1044
1037
|
};
|
|
1045
|
-
//#endregion
|
|
1046
1038
|
exports.MastraAuthOkta = MastraAuthOkta;
|
|
1047
1039
|
exports.MastraRBACOkta = MastraRBACOkta;
|
|
1048
1040
|
exports.mapOktaClaimsToUser = mapOktaClaimsToUser;
|