@enterprisestandard/react 0.0.5 → 0.0.7-beta.20260123.2
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/index.d.ts +43 -29
- package/dist/index.js +1 -1366
- package/package.json +17 -39
- package/dist/enterprise-user.d.ts +0 -126
- package/dist/enterprise-user.d.ts.map +0 -1
- package/dist/iam.d.ts +0 -6
- package/dist/iam.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/oidc-schema.d.ts +0 -86
- package/dist/oidc-schema.d.ts.map +0 -1
- package/dist/scim-schema.d.ts +0 -356
- package/dist/scim-schema.d.ts.map +0 -1
- package/dist/server.d.ts +0 -7
- package/dist/server.d.ts.map +0 -1
- package/dist/session-store.d.ts +0 -179
- package/dist/session-store.d.ts.map +0 -1
- package/dist/sso.d.ts +0 -56
- package/dist/sso.d.ts.map +0 -1
- package/dist/standard-schema.d.ts +0 -56
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/ui/sign-in-loading.d.ts +0 -5
- package/dist/ui/sign-in-loading.d.ts.map +0 -1
- package/dist/ui/signed-in.d.ts +0 -3
- package/dist/ui/signed-in.d.ts.map +0 -1
- package/dist/ui/signed-out.d.ts +0 -3
- package/dist/ui/signed-out.d.ts.map +0 -1
- package/dist/ui/sso-provider.d.ts +0 -35
- package/dist/ui/sso-provider.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -9
- package/dist/utils.d.ts.map +0 -1
- package/dist/vault.d.ts +0 -18
- package/dist/vault.d.ts.map +0 -1
package/dist/session-store.d.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
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 = Record<string, never>> = {
|
|
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 = Record<string, never>> {
|
|
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 = Record<string, never>> 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
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;IACvD;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;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AAC;IAWrE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
package/dist/sso.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { EnterpriseStandard, EnterpriseUser } from '.';
|
|
2
|
-
import type { IdTokenClaims, OidcCallbackParams, TokenResponse } from './oidc-schema';
|
|
3
|
-
import type { StandardSchemaV1 } from './standard-schema';
|
|
4
|
-
import type { SessionStore } from './session-store';
|
|
5
|
-
export type SSOConfig<TSessionData = Record<string, never>> = {
|
|
6
|
-
authority?: string;
|
|
7
|
-
token_url?: string;
|
|
8
|
-
authorization_url?: string;
|
|
9
|
-
client_id?: string;
|
|
10
|
-
redirect_uri?: string;
|
|
11
|
-
response_type?: 'code';
|
|
12
|
-
scope?: string;
|
|
13
|
-
silent_redirect_uri?: string;
|
|
14
|
-
jwks_uri?: string;
|
|
15
|
-
cookies_prefix?: string;
|
|
16
|
-
cookies_path?: string;
|
|
17
|
-
cookies_secure?: boolean;
|
|
18
|
-
cookies_same_site?: 'Strict' | 'Lax';
|
|
19
|
-
end_session_endpoint?: string;
|
|
20
|
-
revocation_endpoint?: string;
|
|
21
|
-
session_store?: SessionStore<TSessionData>;
|
|
22
|
-
};
|
|
23
|
-
export type ESConfig = {
|
|
24
|
-
es?: EnterpriseStandard;
|
|
25
|
-
};
|
|
26
|
-
export type LoginConfig = {
|
|
27
|
-
landingUrl: string;
|
|
28
|
-
errorUrl?: string;
|
|
29
|
-
} & ESConfig;
|
|
30
|
-
export type SSOHandlerConfig = {
|
|
31
|
-
loginUrl?: string;
|
|
32
|
-
userUrl?: string;
|
|
33
|
-
errorUrl?: string;
|
|
34
|
-
landingUrl?: string;
|
|
35
|
-
tokenUrl?: string;
|
|
36
|
-
refreshUrl?: string;
|
|
37
|
-
jwksUrl?: string;
|
|
38
|
-
logoutUrl?: string;
|
|
39
|
-
logoutBackChannelUrl?: string;
|
|
40
|
-
validation?: {
|
|
41
|
-
callbackParams?: StandardSchemaV1<unknown, OidcCallbackParams>;
|
|
42
|
-
idTokenClaims?: StandardSchemaV1<unknown, IdTokenClaims>;
|
|
43
|
-
tokenResponse?: StandardSchemaV1<unknown, TokenResponse>;
|
|
44
|
-
};
|
|
45
|
-
} & ESConfig;
|
|
46
|
-
export type SSO<_TSessionData = Record<string, never>> = {
|
|
47
|
-
getUser: (request: Request) => Promise<EnterpriseUser | undefined>;
|
|
48
|
-
getRequiredUser: (request: Request) => Promise<EnterpriseUser>;
|
|
49
|
-
getJwt: (request: Request) => Promise<string | undefined>;
|
|
50
|
-
initiateLogin: (config: LoginConfig) => Promise<Response>;
|
|
51
|
-
logout: (request: Request, config?: LoginConfig) => Promise<Response>;
|
|
52
|
-
callbackHandler: (request: Request) => Promise<Response>;
|
|
53
|
-
handler: (request: Request, handlerConfig?: SSOHandlerConfig) => Promise<Response>;
|
|
54
|
-
};
|
|
55
|
-
export declare function sso<TSessionData = Record<string, never>>(config: SSOConfig<TSessionData>): SSO<TSessionData>;
|
|
56
|
-
//# sourceMappingURL=sso.d.ts.map
|
package/dist/sso.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../src/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG7D,MAAM,MAAM,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAA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a,CAAC,EAAE,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACzD,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KAC1D,CAAC;CACH,GAAG,QAAQ,CAAC;AAEb,MAAM,MAAM,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;IACvD,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IACnE,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1D,aAAa,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1D,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,EAAE,aAAa,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CACpF,CAAC;AAIF,wBAAgB,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,CA2wB5G"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/** The Standard Schema interface. @see https://standardschema.dev/ */
|
|
2
|
-
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
3
|
-
/** The Standard Schema properties. */
|
|
4
|
-
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
5
|
-
}
|
|
6
|
-
export declare namespace StandardSchemaV1 {
|
|
7
|
-
/** The Standard Schema properties interface. */
|
|
8
|
-
interface Props<Input = unknown, Output = Input> {
|
|
9
|
-
/** The version number of the standard. */
|
|
10
|
-
readonly version: 1;
|
|
11
|
-
/** The vendor name of the schema library. */
|
|
12
|
-
readonly vendor: string;
|
|
13
|
-
/** Validates unknown input values. */
|
|
14
|
-
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
15
|
-
/** Inferred types associated with the schema. */
|
|
16
|
-
readonly types?: Types<Input, Output> | undefined;
|
|
17
|
-
}
|
|
18
|
-
/** The result interface of the validate function. */
|
|
19
|
-
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
20
|
-
/** The result interface if validation succeeds. */
|
|
21
|
-
interface SuccessResult<Output> {
|
|
22
|
-
/** The typed output value. */
|
|
23
|
-
readonly value: Output;
|
|
24
|
-
/** The non-existent issues. */
|
|
25
|
-
readonly issues?: undefined;
|
|
26
|
-
}
|
|
27
|
-
/** The result interface if validation fails. */
|
|
28
|
-
interface FailureResult {
|
|
29
|
-
/** The issues of failed validation. */
|
|
30
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
31
|
-
}
|
|
32
|
-
/** The issue interface of the failure output. */
|
|
33
|
-
interface Issue {
|
|
34
|
-
/** The error message of the issue. */
|
|
35
|
-
readonly message: string;
|
|
36
|
-
/** The path of the issue, if any. */
|
|
37
|
-
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
38
|
-
}
|
|
39
|
-
/** The path segment interface of the issue. */
|
|
40
|
-
interface PathSegment {
|
|
41
|
-
/** The key representing a path segment. */
|
|
42
|
-
readonly key: PropertyKey;
|
|
43
|
-
}
|
|
44
|
-
/** The Standard Schema types interface. */
|
|
45
|
-
interface Types<Input = unknown, Output = Input> {
|
|
46
|
-
/** The input type of the schema. */
|
|
47
|
-
readonly input: Input;
|
|
48
|
-
/** The output type of the schema. */
|
|
49
|
-
readonly output: Output;
|
|
50
|
-
}
|
|
51
|
-
/** Infers the input type of a Standard Schema. */
|
|
52
|
-
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
53
|
-
/** Infers the output type of a Standard Schema. */
|
|
54
|
-
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=standard-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standard-schema.d.ts","sourceRoot":"","sources":["../src/standard-schema.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;IAC/D,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC7D;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,gDAAgD;IAChD,UAAiB,KAAK,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;QACpD,0CAA0C;QAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACpB,6CAA6C;QAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,sCAAsC;QACtC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAChF,iDAAiD;QACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;KACnD;IAED,qDAAqD;IACrD,KAAY,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;IAEnE,mDAAmD;IAC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BAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,wBAAgB,aAAa,CAAC,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,iBAAiB,kDAKvG"}
|
package/dist/ui/signed-in.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signed-in.d.ts","sourceRoot":"","sources":["../../src/ui/signed-in.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,kDAKvD"}
|
package/dist/ui/signed-out.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signed-out.d.ts","sourceRoot":"","sources":["../../src/ui/signed-out.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,kDAKxD"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { EnterpriseUser } from '../enterprise-user';
|
|
3
|
-
type StorageType = 'local' | 'session' | 'memory';
|
|
4
|
-
interface SSOProviderProps {
|
|
5
|
-
tenantId?: string;
|
|
6
|
-
storage?: StorageType;
|
|
7
|
-
storageKey?: string;
|
|
8
|
-
userUrl?: string;
|
|
9
|
-
tokenUrl?: string;
|
|
10
|
-
refreshUrl?: string;
|
|
11
|
-
disableListener?: boolean;
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
interface SSOContext {
|
|
15
|
-
user: EnterpriseUser | null;
|
|
16
|
-
setUser: (user: EnterpriseUser | null) => void;
|
|
17
|
-
isLoading: boolean;
|
|
18
|
-
tokenUrl?: string;
|
|
19
|
-
refreshUrl?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare function SSOProvider({ tenantId, storage, storageKey, userUrl, tokenUrl, refreshUrl, disableListener, children, }: SSOProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare function useUser(): SSOContext;
|
|
23
|
-
interface UseTokenReturn {
|
|
24
|
-
token: string | null;
|
|
25
|
-
isLoading: boolean;
|
|
26
|
-
error: Error | null;
|
|
27
|
-
refresh: () => Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
export declare function useToken(): UseTokenReturn;
|
|
30
|
-
export declare function logout(logoutUrl: string): Promise<{
|
|
31
|
-
success: boolean;
|
|
32
|
-
error?: string;
|
|
33
|
-
}>;
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=sso-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sso-provider.d.ts","sourceRoot":"","sources":["../../src/ui/sso-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAgD,MAAM,OAAO,CAAC;AACpG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,KAAK,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAWD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAkB,EAClB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,eAAuB,EACvB,QAAQ,GACT,EAAE,gBAAgB,2CA8JlB;AAED,wBAAgB,OAAO,IAAI,UAAU,CAMpC;AAOD,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,QAAQ,IAAI,cAAc,CAiGzC;AAED,wBAAsB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6C7F"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EnterpriseStandard } from '.';
|
|
2
|
-
export declare function must<T>(value: T | undefined | null, message?: string): T;
|
|
3
|
-
export declare function setDefaultInstance(es: EnterpriseStandard): void;
|
|
4
|
-
export declare function getDefaultInstance(): EnterpriseStandard | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* If an es is defined, then return it, otherwise return the defaultEnterpriseStandard
|
|
7
|
-
*/
|
|
8
|
-
export declare function getES(es?: EnterpriseStandard): EnterpriseStandard;
|
|
9
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAI5C,wBAAgB,IAAI,CAAC,CAAC,EACpB,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,EAC3B,OAAO,SAA2D,GACjE,CAAC,CAKH;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,QAExD;AAED,wBAAgB,kBAAkB,mCAEjC;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,CAAC,EAAE,kBAAkB,sBAI5C"}
|
package/dist/vault.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type Secret<T> = {
|
|
2
|
-
data: T;
|
|
3
|
-
metadata: MetaData;
|
|
4
|
-
};
|
|
5
|
-
type MetaData = {
|
|
6
|
-
created_time: string;
|
|
7
|
-
deletion_time: string;
|
|
8
|
-
destroyed: boolean;
|
|
9
|
-
version: number;
|
|
10
|
-
};
|
|
11
|
-
export type Vault = {
|
|
12
|
-
url: string;
|
|
13
|
-
getFullSecret: <T>(path: string, token: string) => Promise<Secret<T>>;
|
|
14
|
-
getSecret: <T>(path: string, token: string) => Promise<T>;
|
|
15
|
-
};
|
|
16
|
-
export declare function vault(url: string): Vault;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=vault.d.ts.map
|
package/dist/vault.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../src/vault.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,CAAC,CAAC,IAAI;IACf,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,SAAS,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAqBxC"}
|