@enterprisestandard/react 0.0.4 → 0.0.5-beta.20260114.1
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/group-store.d.ts +164 -0
- package/dist/group-store.d.ts.map +1 -0
- package/dist/iam.d.ts +205 -12
- package/dist/iam.d.ts.map +1 -1
- package/dist/index.d.ts +44 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3164 -572
- package/dist/index.js.map +29 -0
- package/dist/server.d.ts +6 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/session-store.d.ts +179 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/sso.d.ts +74 -16
- package/dist/sso.d.ts.map +1 -1
- package/dist/tenant-server.d.ts +8 -0
- package/dist/tenant-server.d.ts.map +1 -0
- package/dist/tenant.d.ts +280 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/types/base-user.d.ts +27 -0
- package/dist/types/base-user.d.ts.map +1 -0
- package/dist/types/enterprise-user.d.ts +158 -0
- package/dist/types/enterprise-user.d.ts.map +1 -0
- package/dist/{oidc-schema.d.ts → types/oidc-schema.d.ts} +42 -0
- package/dist/types/oidc-schema.d.ts.map +1 -0
- package/dist/types/scim-schema.d.ts +419 -0
- package/dist/types/scim-schema.d.ts.map +1 -0
- package/dist/types/standard-schema.d.ts.map +1 -0
- package/dist/types/user.d.ts +41 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/workload-schema.d.ts +106 -0
- package/dist/types/workload-schema.d.ts.map +1 -0
- package/dist/ui/sso-provider.d.ts +3 -3
- package/dist/ui/sso-provider.d.ts.map +1 -1
- package/dist/user-store.d.ts +161 -0
- package/dist/user-store.d.ts.map +1 -0
- package/dist/workload-server.d.ts +126 -0
- package/dist/workload-server.d.ts.map +1 -0
- package/dist/workload-token-store.d.ts +187 -0
- package/dist/workload-token-store.d.ts.map +1 -0
- package/dist/workload.d.ts +227 -0
- package/dist/workload.d.ts.map +1 -0
- package/package.json +2 -5
- package/dist/enterprise-user.d.ts +0 -125
- package/dist/enterprise-user.d.ts.map +0 -1
- package/dist/oidc-schema.d.ts.map +0 -1
- package/dist/standard-schema.d.ts.map +0 -1
- /package/dist/{standard-schema.d.ts → types/standard-schema.d.ts} +0 -0
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ESConfig, LoginConfig
|
|
2
|
-
export declare function getUser(request: Request, config?: ESConfig): Promise<import("
|
|
3
|
-
export declare function getRequiredUser(request: Request, config?: ESConfig): Promise<import("
|
|
1
|
+
import type { ESConfig, LoginConfig } from './sso';
|
|
2
|
+
export declare function getUser(request: Request, config?: ESConfig): Promise<import(".").User | undefined>;
|
|
3
|
+
export declare function getRequiredUser(request: Request, config?: ESConfig): Promise<import(".").User>;
|
|
4
4
|
export declare function initiateLogin(config: LoginConfig): Promise<Response>;
|
|
5
5
|
export declare function callback(request: Request, config?: ESConfig): Promise<Response>;
|
|
6
|
-
export declare function handler(request: Request, config?:
|
|
6
|
+
export declare function handler(request: Request, config?: ESConfig): Promise<Response>;
|
|
7
|
+
export * from './tenant-server';
|
|
8
|
+
export * from './workload-server';
|
|
7
9
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAoB,MAAM,OAAO,CAAC;AAoBrE,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,yCAEhE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,6BAIxE;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,WAAW,qBAItD;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,qBAIjE;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,qBAIhE;AAGD,cAAc,iBAAiB,CAAC;AAEhC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session management for tracking user sessions and enabling backchannel logout.
|
|
3
|
+
*
|
|
4
|
+
* Session stores are optional - the package works with JWT cookies alone.
|
|
5
|
+
* Sessions are only required for backchannel logout functionality.
|
|
6
|
+
*
|
|
7
|
+
* ## Session Validation Strategies
|
|
8
|
+
*
|
|
9
|
+
* When using a session store, you can configure when sessions are validated:
|
|
10
|
+
*
|
|
11
|
+
* ### 'always' (default)
|
|
12
|
+
* Validates session on every authenticated request.
|
|
13
|
+
* - **Security**: Maximum - immediate session revocation
|
|
14
|
+
* - **Performance**: InMemory ~0.00005ms, Redis ~1-2ms per request
|
|
15
|
+
* - **Backchannel Logout**: Takes effect immediately
|
|
16
|
+
* - **Use when**: Security is paramount, using InMemory or Redis backend
|
|
17
|
+
*
|
|
18
|
+
* ### 'refresh-only'
|
|
19
|
+
* Validates session only during token refresh (typically every 5-15 minutes).
|
|
20
|
+
* - **Security**: Good - 5-15 minute revocation window
|
|
21
|
+
* - **Performance**: 99% reduction in session lookups
|
|
22
|
+
* - **Backchannel Logout**: Takes effect within token TTL (5-15 min)
|
|
23
|
+
* - **Use when**: Performance is critical AND delayed revocation is acceptable
|
|
24
|
+
* - **WARNING**: Compromised sessions remain valid until next refresh
|
|
25
|
+
*
|
|
26
|
+
* ### 'disabled'
|
|
27
|
+
* Never validates sessions against the store.
|
|
28
|
+
* - **Security**: None - backchannel logout doesn't work
|
|
29
|
+
* - **Performance**: No overhead
|
|
30
|
+
* - **Use when**: Cookie-only mode without session store
|
|
31
|
+
* - **WARNING**: Do not use with session_store configured
|
|
32
|
+
*
|
|
33
|
+
* ## Performance Characteristics
|
|
34
|
+
*
|
|
35
|
+
* | Backend | Lookup Time | Impact on Request | Recommendation |
|
|
36
|
+
* |--------------|-------------|-------------------|------------------------|
|
|
37
|
+
* | InMemory | <0.00005ms | Negligible | Use 'always' |
|
|
38
|
+
* | Redis | 1-2ms | 2-4% increase | Use 'always' or test |
|
|
39
|
+
* | Database | 5-20ms | 10-40% increase | Use Redis cache layer |
|
|
40
|
+
*
|
|
41
|
+
* ## Example Usage
|
|
42
|
+
*
|
|
43
|
+
* ```typescript
|
|
44
|
+
* import { sso, InMemorySessionStore } from '@enterprisestandard/react/server';
|
|
45
|
+
*
|
|
46
|
+
* // Maximum security (default)
|
|
47
|
+
* const secure = sso({
|
|
48
|
+
* // ... other config
|
|
49
|
+
* session_store: new InMemorySessionStore(),
|
|
50
|
+
* session_validation: 'always', // Immediate revocation
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // High performance
|
|
54
|
+
* const fast = sso({
|
|
55
|
+
* // ... other config
|
|
56
|
+
* session_store: new InMemorySessionStore(),
|
|
57
|
+
* session_validation: {
|
|
58
|
+
* strategy: 'refresh-only' // 5-15 min revocation delay
|
|
59
|
+
* }
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Core session data tracked for each authenticated user session.
|
|
65
|
+
*
|
|
66
|
+
* @template TExtended - Type-safe custom data that consumers can add to sessions
|
|
67
|
+
*/
|
|
68
|
+
export type Session<TExtended = {}> = {
|
|
69
|
+
/**
|
|
70
|
+
* Session ID from the Identity Provider (from `sid` claim in ID token).
|
|
71
|
+
* This is the unique identifier for the session.
|
|
72
|
+
*/
|
|
73
|
+
sid: string;
|
|
74
|
+
/**
|
|
75
|
+
* Subject identifier (user ID) from the Identity Provider.
|
|
76
|
+
* From the `sub` claim in the ID token.
|
|
77
|
+
*/
|
|
78
|
+
sub: string;
|
|
79
|
+
/**
|
|
80
|
+
* Timestamp when the session was created.
|
|
81
|
+
*/
|
|
82
|
+
createdAt: Date;
|
|
83
|
+
/**
|
|
84
|
+
* Timestamp of the last activity in this session.
|
|
85
|
+
* Can be updated to track session activity.
|
|
86
|
+
*/
|
|
87
|
+
lastActivityAt: Date;
|
|
88
|
+
/**
|
|
89
|
+
* Allow consumers to add runtime data to sessions.
|
|
90
|
+
*/
|
|
91
|
+
[key: string]: unknown;
|
|
92
|
+
} & TExtended;
|
|
93
|
+
/**
|
|
94
|
+
* Abstract interface for session storage backends.
|
|
95
|
+
*
|
|
96
|
+
* Consumers can implement this interface to use different storage backends:
|
|
97
|
+
* - Redis
|
|
98
|
+
* - Database (PostgreSQL, MySQL, etc.)
|
|
99
|
+
* - Distributed cache
|
|
100
|
+
* - Custom solutions
|
|
101
|
+
*
|
|
102
|
+
* @template TExtended - Type-safe custom data that consumers can add to sessions
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* // Custom session data
|
|
107
|
+
* type MySessionData = {
|
|
108
|
+
* ipAddress: string;
|
|
109
|
+
* userAgent: string;
|
|
110
|
+
* };
|
|
111
|
+
*
|
|
112
|
+
* // Implement custom store
|
|
113
|
+
* class RedisSessionStore implements SessionStore<MySessionData> {
|
|
114
|
+
* async create(session: Session<MySessionData>): Promise<void> {
|
|
115
|
+
* await redis.set(`session:${session.sid}`, JSON.stringify(session));
|
|
116
|
+
* }
|
|
117
|
+
* // ... other methods
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export interface SessionStore<TExtended = {}> {
|
|
122
|
+
/**
|
|
123
|
+
* Create a new session in the store.
|
|
124
|
+
*
|
|
125
|
+
* @param session - The session data to store
|
|
126
|
+
* @throws Error if session with same sid already exists
|
|
127
|
+
*/
|
|
128
|
+
create(session: Session<TExtended>): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Retrieve a session by its IdP session ID (sid).
|
|
131
|
+
*
|
|
132
|
+
* @param sid - The session.sid from the Identity Provider
|
|
133
|
+
* @returns The session if found, null otherwise
|
|
134
|
+
*/
|
|
135
|
+
get(sid: string): Promise<Session<TExtended> | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Update an existing session with partial data.
|
|
138
|
+
*
|
|
139
|
+
* Commonly used to update lastActivityAt or add custom fields.
|
|
140
|
+
*
|
|
141
|
+
* @param sid - The session.sid to update
|
|
142
|
+
* @param data - Partial session data to merge
|
|
143
|
+
* @throws Error if session not found
|
|
144
|
+
*/
|
|
145
|
+
update(sid: string, data: Partial<Session<TExtended>>): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Delete a session by its IdP session ID (sid).
|
|
148
|
+
*
|
|
149
|
+
* Used for both normal logout and backchannel logout flows.
|
|
150
|
+
*
|
|
151
|
+
* @param sid - The session.sid to delete
|
|
152
|
+
*/
|
|
153
|
+
delete(sid: string): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* In-memory session store implementation using Maps.
|
|
157
|
+
*
|
|
158
|
+
* Suitable for:
|
|
159
|
+
* - Development and testing
|
|
160
|
+
* - Single-server deployments
|
|
161
|
+
* - Applications without high availability requirements
|
|
162
|
+
*
|
|
163
|
+
* NOT suitable for:
|
|
164
|
+
* - Multi-server deployments (sessions not shared)
|
|
165
|
+
* - High availability scenarios (sessions lost on restart)
|
|
166
|
+
* - Production applications with distributed architecture
|
|
167
|
+
*
|
|
168
|
+
* For production, implement SessionStore with Redis or a database.
|
|
169
|
+
*
|
|
170
|
+
* @template TExtended - Type-safe custom data that consumers can add to sessions
|
|
171
|
+
*/
|
|
172
|
+
export declare class InMemorySessionStore<TExtended = {}> implements SessionStore<TExtended> {
|
|
173
|
+
private sessions;
|
|
174
|
+
create(session: Session<TExtended>): Promise<void>;
|
|
175
|
+
get(sid: string): Promise<Session<TExtended> | null>;
|
|
176
|
+
update(sid: string, data: Partial<Session<TExtended>>): Promise<void>;
|
|
177
|
+
delete(sid: string): Promise<void>;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,SAAS,GAAG,EAAE,IAAI;IACpC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;OAGG;IACH,cAAc,EAAE,IAAI,CAAC;IAErB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,GAAG,SAAS,CAAC;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,YAAY,CAAC,SAAS,GAAG,EAAE;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;IAErD;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,oBAAoB,CAAC,SAAS,GAAG,EAAE,CAAE,YAAW,YAAY,CAAC,SAAS,CAAC;IAClF,OAAO,CAAC,QAAQ,CAAyC;IAEnD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAIpD,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWrE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
package/dist/sso.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { EnterpriseStandard
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { EnterpriseStandard } from '.';
|
|
2
|
+
import type { SessionStore } from './session-store';
|
|
3
|
+
import type { IdTokenClaims, OidcCallbackParams, TokenResponse } from './types/oidc-schema';
|
|
4
|
+
import type { StandardSchemaV1 } from './types/standard-schema';
|
|
5
|
+
import type { User } from './types/user';
|
|
6
|
+
import type { UserStore } from './user-store';
|
|
7
|
+
export type SSOConfig<TSessionData = {}, TUserData = {}> = {
|
|
8
|
+
authority?: string;
|
|
9
|
+
token_url?: string;
|
|
10
|
+
authorization_url?: string;
|
|
11
|
+
client_id?: string;
|
|
12
|
+
client_secret?: string;
|
|
13
|
+
redirect_uri?: string;
|
|
14
|
+
response_type?: 'code';
|
|
15
|
+
scope?: string;
|
|
10
16
|
silent_redirect_uri?: string;
|
|
11
17
|
jwks_uri?: string;
|
|
12
18
|
cookies_prefix?: string;
|
|
@@ -14,6 +20,52 @@ export type SSOConfig = {
|
|
|
14
20
|
cookies_secure?: boolean;
|
|
15
21
|
cookies_same_site?: 'Strict' | 'Lax';
|
|
16
22
|
end_session_endpoint?: string;
|
|
23
|
+
revocation_endpoint?: string;
|
|
24
|
+
session_store?: SessionStore<TSessionData>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional handler defaults. These are merged with per-call overrides in
|
|
27
|
+
* `sso.handler`, with per-call values taking precedence.
|
|
28
|
+
*/
|
|
29
|
+
loginUrl?: string;
|
|
30
|
+
userUrl?: string;
|
|
31
|
+
errorUrl?: string;
|
|
32
|
+
landingUrl?: string;
|
|
33
|
+
tokenUrl?: string;
|
|
34
|
+
refreshUrl?: string;
|
|
35
|
+
jwksUrl?: string;
|
|
36
|
+
logoutUrl?: string;
|
|
37
|
+
logoutBackChannelUrl?: string;
|
|
38
|
+
validation?: {
|
|
39
|
+
callbackParams?: StandardSchemaV1<unknown, OidcCallbackParams>;
|
|
40
|
+
idTokenClaims?: StandardSchemaV1<unknown, IdTokenClaims>;
|
|
41
|
+
tokenResponse?: StandardSchemaV1<unknown, TokenResponse>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Optional user store for persisting user profiles from SSO authentication.
|
|
45
|
+
* When configured, users are automatically stored/updated on each login.
|
|
46
|
+
*/
|
|
47
|
+
user_store?: UserStore<TUserData>;
|
|
48
|
+
/**
|
|
49
|
+
* Enable Just-In-Time (JIT) user provisioning.
|
|
50
|
+
* When enabled, new users are automatically created in the user_store on their first login.
|
|
51
|
+
* When disabled (default), only existing users in the user_store are updated on login.
|
|
52
|
+
* Requires user_store to be configured.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
enable_jit_user_provisioning?: boolean;
|
|
56
|
+
};
|
|
57
|
+
type SSOConfigWithDefaults<TSessionData = {}, TUserData = {}> = SSOConfig<TSessionData, TUserData> & {
|
|
58
|
+
authority: string;
|
|
59
|
+
token_url: string;
|
|
60
|
+
authorization_url: string;
|
|
61
|
+
client_id: string;
|
|
62
|
+
redirect_uri: string;
|
|
63
|
+
response_type: 'code';
|
|
64
|
+
scope: string;
|
|
65
|
+
cookies_secure: boolean;
|
|
66
|
+
cookies_same_site: string;
|
|
67
|
+
cookies_prefix: string;
|
|
68
|
+
cookies_path: string;
|
|
17
69
|
};
|
|
18
70
|
export type ESConfig = {
|
|
19
71
|
es?: EnterpriseStandard;
|
|
@@ -31,16 +83,22 @@ export type SSOHandlerConfig = {
|
|
|
31
83
|
refreshUrl?: string;
|
|
32
84
|
jwksUrl?: string;
|
|
33
85
|
logoutUrl?: string;
|
|
34
|
-
|
|
86
|
+
logoutBackChannelUrl?: string;
|
|
87
|
+
validation?: {
|
|
88
|
+
callbackParams?: StandardSchemaV1<unknown, OidcCallbackParams>;
|
|
89
|
+
idTokenClaims?: StandardSchemaV1<unknown, IdTokenClaims>;
|
|
90
|
+
tokenResponse?: StandardSchemaV1<unknown, TokenResponse>;
|
|
91
|
+
};
|
|
35
92
|
} & ESConfig;
|
|
36
|
-
export type SSO = {
|
|
37
|
-
getUser: (request: Request) => Promise<
|
|
38
|
-
getRequiredUser: (request: Request) => Promise<
|
|
93
|
+
export type SSO<TSessionData = {}, TUserData = {}> = SSOConfigWithDefaults<TSessionData, TUserData> & {
|
|
94
|
+
getUser: (request: Request) => Promise<User | undefined>;
|
|
95
|
+
getRequiredUser: (request: Request) => Promise<User>;
|
|
39
96
|
getJwt: (request: Request) => Promise<string | undefined>;
|
|
40
|
-
initiateLogin: (config: LoginConfig) => Promise<Response>;
|
|
97
|
+
initiateLogin: (config: LoginConfig, requestUrl?: string) => Promise<Response>;
|
|
41
98
|
logout: (request: Request, config?: LoginConfig) => Promise<Response>;
|
|
42
99
|
callbackHandler: (request: Request) => Promise<Response>;
|
|
43
|
-
handler: (request: Request
|
|
100
|
+
handler: (request: Request) => Promise<Response>;
|
|
44
101
|
};
|
|
45
|
-
export declare function sso(config
|
|
102
|
+
export declare function sso<TSessionData = {}, TUserData = {}>(config?: SSOConfig<TSessionData, TUserData>): SSO<TSessionData, TUserData>;
|
|
103
|
+
export {};
|
|
46
104
|
//# sourceMappingURL=sso.d.ts.map
|
package/dist/sso.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../src/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../src/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAC5C,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,MAAM,SAAS,CAAC,YAAY,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,IAAI;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAA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AAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1D,aAAa,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/E,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtE,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzD,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClD,CAAC;AAIJ,wBAAgB,GAAG,CAAC,YAAY,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EACnD,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,GAC1C,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CA27B9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side helper functions for tenant management.
|
|
3
|
+
* These functions provide a convenient way to parse tenant requests
|
|
4
|
+
* and send webhook updates.
|
|
5
|
+
*/
|
|
6
|
+
export type { CreateTenantRequest, CreateTenantResponse, EnvironmentType, TenantStatus, TenantWebhookPayload, } from './tenant';
|
|
7
|
+
export { parseTenantRequest, sendTenantWebhook, TenantRequestError } from './tenant';
|
|
8
|
+
//# sourceMappingURL=tenant-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-server.d.ts","sourceRoot":"","sources":["../src/tenant-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/tenant.d.ts
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant Management SDK
|
|
3
|
+
*
|
|
4
|
+
* Provides helper functions for applications to implement tenant creation endpoints
|
|
5
|
+
* that ESVS can test. Supports both synchronous (201) and asynchronous (202)
|
|
6
|
+
* tenant creation with webhook-based status updates.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Environment type for tenant creation
|
|
10
|
+
*/
|
|
11
|
+
export type EnvironmentType = 'POC' | 'DEV' | 'QA' | 'PROD';
|
|
12
|
+
/**
|
|
13
|
+
* Status of tenant creation process
|
|
14
|
+
*/
|
|
15
|
+
export type TenantStatus = 'pending' | 'processing' | 'completed' | 'failed';
|
|
16
|
+
/**
|
|
17
|
+
* Request payload from ESVS for creating a tenant
|
|
18
|
+
*/
|
|
19
|
+
export interface CreateTenantRequest {
|
|
20
|
+
/**
|
|
21
|
+
* Required app identifier to use when initializing EnterpriseStandard for this tenant.
|
|
22
|
+
* This is the primary identifier for tenant management. A company can have multiple
|
|
23
|
+
* applications (e.g., one instance on the east coast, one on the west coast).
|
|
24
|
+
*/
|
|
25
|
+
appId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Company ID (used for reporting purposes only, not for tenant identification)
|
|
28
|
+
*/
|
|
29
|
+
companyId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Company Name
|
|
32
|
+
*/
|
|
33
|
+
companyName: string;
|
|
34
|
+
/**
|
|
35
|
+
* Environment Type (POC, DEV, QA, PROD)
|
|
36
|
+
*/
|
|
37
|
+
environmentType: EnvironmentType;
|
|
38
|
+
/**
|
|
39
|
+
* Email (The email or distribution list used to communicate to the team)
|
|
40
|
+
*/
|
|
41
|
+
email: string;
|
|
42
|
+
/**
|
|
43
|
+
* Webhook URL where the application can send updates around the creation of the tenant
|
|
44
|
+
*/
|
|
45
|
+
webhookUrl: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Response payload for tenant creation
|
|
49
|
+
*/
|
|
50
|
+
export interface CreateTenantResponse {
|
|
51
|
+
/**
|
|
52
|
+
* URL that the tenant will be available at
|
|
53
|
+
*/
|
|
54
|
+
tenantUrl: string;
|
|
55
|
+
/**
|
|
56
|
+
* Current status of tenant creation
|
|
57
|
+
*/
|
|
58
|
+
status: TenantStatus;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Payload sent to webhook URL for status updates
|
|
62
|
+
*/
|
|
63
|
+
export interface TenantWebhookPayload {
|
|
64
|
+
/**
|
|
65
|
+
* Company ID
|
|
66
|
+
*/
|
|
67
|
+
companyId: string;
|
|
68
|
+
/**
|
|
69
|
+
* Current status of tenant creation
|
|
70
|
+
*/
|
|
71
|
+
status: TenantStatus;
|
|
72
|
+
/**
|
|
73
|
+
* URL that the tenant will be available at (provided once creation completes)
|
|
74
|
+
*/
|
|
75
|
+
tenantUrl?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Error message (only present if status is "failed")
|
|
78
|
+
*/
|
|
79
|
+
error?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Error thrown when tenant request validation fails
|
|
83
|
+
*/
|
|
84
|
+
export declare class TenantRequestError extends Error {
|
|
85
|
+
constructor(message: string);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Serializes an ESConfig or EnterpriseStandard instance to a JSON-serializable format
|
|
89
|
+
* by removing non-serializable properties like stores, validators, and functions.
|
|
90
|
+
*
|
|
91
|
+
* Since EnterpriseStandard now extends ESConfig, the config (including handler URLs)
|
|
92
|
+
* is accessible directly from the instance.
|
|
93
|
+
*
|
|
94
|
+
* @param configOrES - The ESConfig object or EnterpriseStandard instance to serialize
|
|
95
|
+
* @returns A JSON-serializable version of the config
|
|
96
|
+
*/
|
|
97
|
+
export declare function serializeESConfig(configOrES: any): any;
|
|
98
|
+
/**
|
|
99
|
+
* Parse and validate a tenant creation request from an HTTP request.
|
|
100
|
+
*
|
|
101
|
+
* @param request - The HTTP request containing the tenant creation data
|
|
102
|
+
* @returns The validated tenant creation request
|
|
103
|
+
* @throws {TenantRequestError} If the request is invalid or missing required fields
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* app.post('/api/tenant', async (c) => {
|
|
108
|
+
* try {
|
|
109
|
+
* const tenantRequest = await parseTenantRequest(c.req.raw);
|
|
110
|
+
* // Create tenant...
|
|
111
|
+
* } catch (error) {
|
|
112
|
+
* if (error instanceof TenantRequestError) {
|
|
113
|
+
* return c.json({ error: error.message }, 400);
|
|
114
|
+
* }
|
|
115
|
+
* throw error;
|
|
116
|
+
* }
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function parseTenantRequest(request: Request): Promise<CreateTenantRequest>;
|
|
121
|
+
/**
|
|
122
|
+
* Send a webhook update to ESVS with tenant creation status.
|
|
123
|
+
*
|
|
124
|
+
* @param webhookUrl - The webhook URL provided in the tenant creation request
|
|
125
|
+
* @param payload - The webhook payload with status and tenant information
|
|
126
|
+
* @throws Never throws - errors are logged but not propagated to avoid breaking tenant creation
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* // Send initial status
|
|
131
|
+
* await sendTenantWebhook(tenantRequest.webhookUrl, {
|
|
132
|
+
* companyId: tenantRequest.companyId,
|
|
133
|
+
* status: 'processing',
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* // Send completion status
|
|
137
|
+
* await sendTenantWebhook(tenantRequest.webhookUrl, {
|
|
138
|
+
* companyId: tenantRequest.companyId,
|
|
139
|
+
* status: 'completed',
|
|
140
|
+
* tenantUrl: 'https://app.example.com/tenants/tenant-123',
|
|
141
|
+
* });
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function sendTenantWebhook(webhookUrl: string, payload: TenantWebhookPayload): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Stored tenant data with required appId and tracking metadata.
|
|
147
|
+
*
|
|
148
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
149
|
+
*/
|
|
150
|
+
export type StoredTenant<TExtended = {}> = {
|
|
151
|
+
/**
|
|
152
|
+
* Required app identifier used to initialize EnterpriseStandard for this tenant.
|
|
153
|
+
* This is the primary key for tenant storage. A company can have multiple
|
|
154
|
+
* applications (e.g., one instance on the east coast, one on the west coast).
|
|
155
|
+
*/
|
|
156
|
+
appId: string;
|
|
157
|
+
/**
|
|
158
|
+
* Company ID (used for reporting purposes only, not for tenant identification)
|
|
159
|
+
*/
|
|
160
|
+
companyId: string;
|
|
161
|
+
/**
|
|
162
|
+
* Company Name
|
|
163
|
+
*/
|
|
164
|
+
companyName: string;
|
|
165
|
+
/**
|
|
166
|
+
* Environment Type (POC, DEV, QA, PROD)
|
|
167
|
+
*/
|
|
168
|
+
environmentType: EnvironmentType;
|
|
169
|
+
/**
|
|
170
|
+
* Email (The email or distribution list used to communicate to the team)
|
|
171
|
+
*/
|
|
172
|
+
email: string;
|
|
173
|
+
/**
|
|
174
|
+
* Webhook URL where the application can send updates around the creation of the tenant
|
|
175
|
+
*/
|
|
176
|
+
webhookUrl: string;
|
|
177
|
+
/**
|
|
178
|
+
* URL that the tenant will be available at
|
|
179
|
+
*/
|
|
180
|
+
tenantUrl?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Current status of tenant creation
|
|
183
|
+
*/
|
|
184
|
+
status: TenantStatus;
|
|
185
|
+
/**
|
|
186
|
+
* Error message (only present if status is "failed")
|
|
187
|
+
*/
|
|
188
|
+
error?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Timestamp when the tenant was first stored.
|
|
191
|
+
*/
|
|
192
|
+
createdAt: Date;
|
|
193
|
+
/**
|
|
194
|
+
* Timestamp when the tenant was last updated.
|
|
195
|
+
*/
|
|
196
|
+
updatedAt: Date;
|
|
197
|
+
/**
|
|
198
|
+
* Serialized Enterprise Standard configuration.
|
|
199
|
+
* This is a JSON-serializable version of the ESConfig with non-serializable items excluded.
|
|
200
|
+
*/
|
|
201
|
+
config?: any;
|
|
202
|
+
} & TExtended;
|
|
203
|
+
/**
|
|
204
|
+
* Abstract interface for tenant storage backends.
|
|
205
|
+
*
|
|
206
|
+
* Consumers can implement this interface to use different storage backends:
|
|
207
|
+
* - In-memory (for development/testing)
|
|
208
|
+
* - Redis (for production with fast lookups)
|
|
209
|
+
* - Database (PostgreSQL, MySQL, etc.)
|
|
210
|
+
*
|
|
211
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
212
|
+
*/
|
|
213
|
+
export interface TenantStore<TExtended = {}> {
|
|
214
|
+
/**
|
|
215
|
+
* Retrieve a tenant by its app identifier.
|
|
216
|
+
*
|
|
217
|
+
* @param appId - The tenant's app identifier (primary key)
|
|
218
|
+
* @returns The tenant if found, null otherwise
|
|
219
|
+
*/
|
|
220
|
+
get(appId: string): Promise<StoredTenant<TExtended> | null>;
|
|
221
|
+
/**
|
|
222
|
+
* Retrieve all tenants for a company ID.
|
|
223
|
+
* Since a company can have multiple applications, this returns an array.
|
|
224
|
+
*
|
|
225
|
+
* @param companyId - The company ID (used for reporting, not primary identification)
|
|
226
|
+
* @returns Array of tenants for the company, empty array if none found
|
|
227
|
+
*/
|
|
228
|
+
getByCompanyId(companyId: string): Promise<StoredTenant<TExtended>[]>;
|
|
229
|
+
/**
|
|
230
|
+
* List all tenants in the store.
|
|
231
|
+
*
|
|
232
|
+
* @returns Array of all stored tenants
|
|
233
|
+
*/
|
|
234
|
+
list(): Promise<StoredTenant<TExtended>[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Create or update a tenant in the store.
|
|
237
|
+
*
|
|
238
|
+
* If a tenant with the same `appId` exists, it will be updated.
|
|
239
|
+
* Otherwise, a new tenant will be created.
|
|
240
|
+
*
|
|
241
|
+
* @param tenant - The tenant data to store
|
|
242
|
+
* @returns The stored tenant
|
|
243
|
+
*/
|
|
244
|
+
upsert(tenant: StoredTenant<TExtended>): Promise<StoredTenant<TExtended>>;
|
|
245
|
+
/**
|
|
246
|
+
* Delete a tenant by its app identifier.
|
|
247
|
+
*
|
|
248
|
+
* @param appId - The tenant's app identifier to delete
|
|
249
|
+
*/
|
|
250
|
+
delete(appId: string): Promise<void>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* In-memory tenant store implementation using Maps.
|
|
254
|
+
*
|
|
255
|
+
* Suitable for:
|
|
256
|
+
* - Development and testing
|
|
257
|
+
* - Single-server deployments
|
|
258
|
+
* - Applications without high availability requirements
|
|
259
|
+
*
|
|
260
|
+
* NOT suitable for:
|
|
261
|
+
* - Multi-server deployments (tenants not shared)
|
|
262
|
+
* - High availability scenarios (tenants lost on restart)
|
|
263
|
+
* - Production applications with distributed architecture
|
|
264
|
+
*
|
|
265
|
+
* For production, implement TenantStore with Redis or a database.
|
|
266
|
+
*
|
|
267
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
268
|
+
*/
|
|
269
|
+
export declare class InMemoryTenantStore<TExtended = {}> implements TenantStore<TExtended> {
|
|
270
|
+
/** Primary storage: appId -> tenant */
|
|
271
|
+
private tenants;
|
|
272
|
+
/** Secondary index: companyId -> Set of appIds (since one company can have multiple apps) */
|
|
273
|
+
private companyIdIndex;
|
|
274
|
+
get(appId: string): Promise<StoredTenant<TExtended> | null>;
|
|
275
|
+
getByCompanyId(companyId: string): Promise<StoredTenant<TExtended>[]>;
|
|
276
|
+
list(): Promise<StoredTenant<TExtended>[]>;
|
|
277
|
+
upsert(tenant: StoredTenant<TExtended>): Promise<StoredTenant<TExtended>>;
|
|
278
|
+
delete(appId: string): Promise<void>;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -0,0 +1 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G,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1E;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,mBAAmB,CAAC,SAAS,GAAG,EAAE,CAAE,YAAW,WAAW,CAAC,SAAS,CAAC;IAChF,uCAAuC;IACvC,OAAO,CAAC,OAAO,CAA8C;IAE7D,6FAA6F;IAC7F,OAAO,CAAC,cAAc,CAAkC;IAElD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAI3D,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAcrE,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAI1C,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IA4BzE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAc3C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base user with simple, developer-friendly attributes.
|
|
3
|
+
* Extended by User (SSO) and EnterpriseUser (SCIM).
|
|
4
|
+
*/
|
|
5
|
+
export interface BaseUser {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the user
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* REQUIRED. Unique identifier for login
|
|
12
|
+
*/
|
|
13
|
+
userName: string;
|
|
14
|
+
/**
|
|
15
|
+
* REQUIRED. Simple display name
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* REQUIRED. Primary email address
|
|
20
|
+
*/
|
|
21
|
+
email: string;
|
|
22
|
+
/**
|
|
23
|
+
* URL to user's avatar/profile picture
|
|
24
|
+
*/
|
|
25
|
+
avatarUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=base-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-user.d.ts","sourceRoot":"","sources":["../../src/types/base-user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|