@mastra/auth-okta 0.2.4 → 0.2.5
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.
|
@@ -50,6 +50,14 @@ export interface IMastraAuthProvider<TUser = unknown> {
|
|
|
50
50
|
* Map an authenticated user to a memory resource id
|
|
51
51
|
*/
|
|
52
52
|
mapUserToResourceId?(user: TUser): string | undefined | null;
|
|
53
|
+
/**
|
|
54
|
+
* Return response headers (typically `Set-Cookie` for a rotated session)
|
|
55
|
+
* that the provider accumulated while handling this request and clear them
|
|
56
|
+
* from the provider's per-request state. The server middleware appends them
|
|
57
|
+
* to the outgoing response so that server-to-server session refreshes
|
|
58
|
+
* reach the browser.
|
|
59
|
+
*/
|
|
60
|
+
consumePendingResponseHeaders?(request: MastraAuthRequest): Record<string, string> | undefined;
|
|
53
61
|
}
|
|
54
62
|
export declare abstract class MastraAuthProvider<TUser = unknown> extends MastraBase implements IMastraAuthProvider<TUser> {
|
|
55
63
|
protected?: MastraAuthConfig['protected'];
|
|
@@ -97,6 +105,7 @@ export declare class CompositeAuth extends MastraAuthProvider implements ISSOPro
|
|
|
97
105
|
*/
|
|
98
106
|
get isSimpleAuth(): boolean;
|
|
99
107
|
authenticateToken(token: string, request: MastraAuthRequest): Promise<unknown | null>;
|
|
108
|
+
consumePendingResponseHeaders(request: MastraAuthRequest): Record<string, string> | undefined;
|
|
100
109
|
authorizeUser(user: unknown, request: MastraAuthRequest): Promise<boolean>;
|
|
101
110
|
/**
|
|
102
111
|
* Forward cookie header to SSO provider for PKCE validation.
|
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
|
-
//#region ../../packages/_internals/auth/dist/ee-
|
|
4
|
+
//#region ../../packages/_internals/auth/dist/ee-XRuijAiF.js
|
|
5
5
|
/**
|
|
6
6
|
* FGA enforcement utility for checking fine-grained authorization.
|
|
7
7
|
*
|
|
@@ -113,7 +113,7 @@ function resolvePermissionsFromMapping(roles, mapping) {
|
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/rbac-provider.ts
|
|
115
115
|
/** Default cache TTL in milliseconds (60 seconds) */
|
|
116
|
-
const DEFAULT_CACHE_TTL_MS =
|
|
116
|
+
const DEFAULT_CACHE_TTL_MS = 6e4;
|
|
117
117
|
/** Default max cache size (number of users) */
|
|
118
118
|
const DEFAULT_CACHE_MAX_SIZE = 1e3;
|
|
119
119
|
/** Page size for the Okta list-user-groups call (Okta max is 200) */
|
|
@@ -893,7 +893,7 @@ var MastraAuthOkta = class extends MastraAuthProvider {
|
|
|
893
893
|
const stateId = state.includes("|") ? state.split("|")[0] : state;
|
|
894
894
|
const actualRedirectUri = redirectUri ?? this.redirectUri;
|
|
895
895
|
stateStore.set(stateId, {
|
|
896
|
-
expiresAt: Date.now() +
|
|
896
|
+
expiresAt: Date.now() + 6e5,
|
|
897
897
|
redirectUri: actualRedirectUri
|
|
898
898
|
});
|
|
899
899
|
for (const [key, value] of stateStore.entries()) if (value.expiresAt < Date.now()) stateStore.delete(key);
|