@dreadkn1ght123/auth-types 0.2.0
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/README.md +24 -0
- package/dist/index.d.ts +249 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @dreadkn1ght123/auth-types
|
|
2
|
+
|
|
3
|
+
Shared, runtime-free VVP authentication contracts. The package defines VVP
|
|
4
|
+
claims, actors, roles, validated configuration, route and transaction outcomes,
|
|
5
|
+
typed diagnostic stages/reasons, allowlisted safe error fields, the safe logger,
|
|
6
|
+
and pluggable server-side session-store contracts.
|
|
7
|
+
|
|
8
|
+
Requires Node.js 20 or newer. Tokens belong only in `ServerSession`; expose a
|
|
9
|
+
`PublicSession` to browser code. `AuthConfigInput.clientSecret` is mandatory:
|
|
10
|
+
the SDK supports confidential server-side OIDC clients only.
|
|
11
|
+
|
|
12
|
+
The default OIDC scopes include `openid`, `profile`, `email`, and
|
|
13
|
+
`vvp-identity`; custom scope lists must include both `openid` and
|
|
14
|
+
`vvp-identity`.
|
|
15
|
+
|
|
16
|
+
Diagnostic types deliberately cannot carry arbitrary response bodies, headers,
|
|
17
|
+
URLs, tokens, claims, or provider descriptions. Treat `SafeAuthErrorFields` and
|
|
18
|
+
`SafeLogFields` as an allowlist, not as a place to cast untrusted objects.
|
|
19
|
+
|
|
20
|
+
Version `0.2.0` is the compatible minor line for all auth packages. Keep
|
|
21
|
+
`@dreadkn1ght123/auth-types`, `@dreadkn1ght123/auth-core`,
|
|
22
|
+
`@dreadkn1ght123/auth-express`, and `@dreadkn1ght123/auth-react` on the same
|
|
23
|
+
minor line; see the workspace
|
|
24
|
+
[`UPGRADE.md`](../../UPGRADE.md).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
export declare const ACTOR_TYPES: readonly ["employee", "contractor", "external_customer", "external_vendor", "service"];
|
|
2
|
+
export type KnownActorType = (typeof ACTOR_TYPES)[number];
|
|
3
|
+
/** Providers may introduce actor types independently of an SDK release. */
|
|
4
|
+
export type ActorType = string;
|
|
5
|
+
export declare const VVP_REALM_ROLES: readonly ["platform_admin", "employee", "external_customer", "external_vendor"];
|
|
6
|
+
export type VvpRealmRole = (typeof VVP_REALM_ROLES)[number];
|
|
7
|
+
export type Role = string;
|
|
8
|
+
export interface RealmAccess {
|
|
9
|
+
roles?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ClientAccess {
|
|
12
|
+
roles: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
export interface VvpClaims {
|
|
15
|
+
sub: string;
|
|
16
|
+
vvp_actor_id?: string;
|
|
17
|
+
actor_type?: ActorType;
|
|
18
|
+
organization_id?: string;
|
|
19
|
+
employee_id?: string;
|
|
20
|
+
department_id?: string;
|
|
21
|
+
preferred_username?: string;
|
|
22
|
+
email?: string;
|
|
23
|
+
email_verified?: boolean;
|
|
24
|
+
name?: string;
|
|
25
|
+
given_name?: string;
|
|
26
|
+
family_name?: string;
|
|
27
|
+
realm_access?: RealmAccess;
|
|
28
|
+
resource_access?: Readonly<Record<string, ClientAccess>>;
|
|
29
|
+
[claim: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface Actor {
|
|
32
|
+
/** IdP-internal identifier; never use this as a business foreign key. */
|
|
33
|
+
sub: string;
|
|
34
|
+
/** Immutable business identifier when assigned. */
|
|
35
|
+
vvpActorId?: string;
|
|
36
|
+
actorType?: ActorType;
|
|
37
|
+
organizationId?: string;
|
|
38
|
+
employeeId?: string;
|
|
39
|
+
departmentId?: string;
|
|
40
|
+
email?: string;
|
|
41
|
+
emailVerified?: boolean;
|
|
42
|
+
username?: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
givenName?: string;
|
|
45
|
+
familyName?: string;
|
|
46
|
+
realmRoles: readonly Role[];
|
|
47
|
+
clientRoles: Readonly<Record<string, readonly Role[]>>;
|
|
48
|
+
}
|
|
49
|
+
export type RuntimeEnvironment = "development" | "test" | "production";
|
|
50
|
+
export type AuthStage = "configuration" | "discovery" | "authorization" | "transaction" | "callback" | "token_exchange" | "id_token_validation" | "access_token_validation" | "claims" | "session" | "token_refresh" | "logout";
|
|
51
|
+
export type CallbackAuthStage = "transaction_validation" | "authorization_response_validation" | "token_exchange" | "id_token_validation" | "access_token_validation" | "actor_claims_mapping" | "session_persistence" | "callback_redirect";
|
|
52
|
+
/**
|
|
53
|
+
* Stable, non-sensitive failure classification. These values are suitable for
|
|
54
|
+
* metrics and user-facing error selection; provider error text is not.
|
|
55
|
+
*/
|
|
56
|
+
export type AuthFailureReason = "config_invalid" | "provider_unavailable" | "provider_metadata_invalid" | "provider_rejected" | "invalid_request" | "transaction_not_found" | "transaction_expired" | "transaction_state_mismatch" | "transaction_already_consumed" | "transaction_consume_ambiguous" | "authorization_code_invalid" | "nonce_mismatch" | "token_endpoint_rejected" | "token_missing" | "token_malformed" | "token_expired" | "token_not_active" | "token_signature_invalid" | "token_issuer_invalid" | "token_audience_invalid" | "token_authorized_party_invalid" | "token_claims_invalid" | "subject_mismatch" | "claims_invalid" | "session_not_found" | "session_persistence_failed" | "store_unsafe" | "return_to_invalid" | "post_logout_redirect_invalid" | "local_session_deleted" | "provider_logout_redirect_created" | "provider_logout_rejected" | "unknown";
|
|
57
|
+
export type CallbackFailureReason = "transaction_cookie_missing" | "transaction_cookie_malformed" | "state_missing" | "transaction_not_found" | "transaction_expired" | "state_mismatch" | "transaction_already_consumed" | "authorization_denied" | "invalid_client" | "token_endpoint_rejected" | "pkce_validation_failed" | "nonce_mismatch" | "id_token_missing" | "id_token_invalid" | "access_token_missing" | "access_token_not_jwt" | "access_token_signature_invalid" | "issuer_mismatch" | "audience_mismatch" | "authorized_party_mismatch" | "required_claim_missing" | "token_expired" | "token_subject_mismatch" | "claims_invalid" | "session_store_failed" | "provider_unavailable" | "callback_failed_unknown";
|
|
58
|
+
export type AuthDiagnosticStage = AuthStage | CallbackAuthStage;
|
|
59
|
+
export type AuthDiagnosticReason = AuthFailureReason | CallbackFailureReason;
|
|
60
|
+
/** Strict allowlist of diagnostic values that may cross a logging boundary. */
|
|
61
|
+
export interface SafeAuthErrorDetails {
|
|
62
|
+
library?: "openid-client" | "oauth4webapi" | "jose";
|
|
63
|
+
libraryCode?: string;
|
|
64
|
+
httpStatus?: number;
|
|
65
|
+
claim?: "aud" | "azp" | "exp" | "iat" | "iss" | "nbf" | "nonce" | "sub";
|
|
66
|
+
causeName?: string;
|
|
67
|
+
causeCode?: string;
|
|
68
|
+
providerError?: "access_denied" | "invalid_client" | "invalid_grant" | "interaction_required" | "login_required" | "server_error" | "temporarily_unavailable";
|
|
69
|
+
providerStatus?: number;
|
|
70
|
+
failedClaim?: "aud" | "azp" | "exp" | "iat" | "iss" | "nbf" | "nonce" | "sub";
|
|
71
|
+
claimFailureReason?: "check_failed" | "missing" | "invalid";
|
|
72
|
+
}
|
|
73
|
+
export interface SafeAuthErrorFields extends SafeAuthErrorDetails {
|
|
74
|
+
authErrorCode?: AuthErrorCode;
|
|
75
|
+
stage?: AuthDiagnosticStage;
|
|
76
|
+
reason?: AuthDiagnosticReason;
|
|
77
|
+
correlationId?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface AuthDiagnostic {
|
|
80
|
+
authErrorCode: AuthErrorCode;
|
|
81
|
+
/** @deprecated Use authErrorCode. */
|
|
82
|
+
code?: AuthErrorCode;
|
|
83
|
+
stage: AuthDiagnosticStage;
|
|
84
|
+
reason: AuthDiagnosticReason;
|
|
85
|
+
correlationId?: string;
|
|
86
|
+
details?: Readonly<SafeAuthErrorDetails>;
|
|
87
|
+
}
|
|
88
|
+
export interface AuthRouteSettingsInput {
|
|
89
|
+
/** Root under which relative route names are resolved. Defaults to /auth. */
|
|
90
|
+
basePath?: string;
|
|
91
|
+
startPath?: string;
|
|
92
|
+
loginPath?: string;
|
|
93
|
+
callbackPath?: string;
|
|
94
|
+
logoutPath?: string;
|
|
95
|
+
signedOutPath?: string;
|
|
96
|
+
errorPath?: string;
|
|
97
|
+
sessionPath?: string;
|
|
98
|
+
/** Must contain callbackPath. Defaults to basePath. */
|
|
99
|
+
cookiePath?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface AuthRouteSettings {
|
|
102
|
+
basePath: string;
|
|
103
|
+
startPath: string;
|
|
104
|
+
loginPath: string;
|
|
105
|
+
callbackPath: string;
|
|
106
|
+
logoutPath: string;
|
|
107
|
+
signedOutPath: string;
|
|
108
|
+
errorPath: string;
|
|
109
|
+
sessionPath: string;
|
|
110
|
+
cookiePath: string;
|
|
111
|
+
}
|
|
112
|
+
export type AuthRoutesInput = AuthRouteSettingsInput;
|
|
113
|
+
export type AuthRoutes = AuthRouteSettings;
|
|
114
|
+
/** Shape accepted by adapters which expose `routes` next to `config`. */
|
|
115
|
+
export interface AuthRoutesOption {
|
|
116
|
+
routes?: AuthRouteSettingsInput;
|
|
117
|
+
}
|
|
118
|
+
export type ClientAuthenticationMethod = "client_secret_basic";
|
|
119
|
+
export type AuthUiLocale = "ru" | "en";
|
|
120
|
+
/**
|
|
121
|
+
* Text is rendered as plain text by adapters. Implementations must escape it
|
|
122
|
+
* and must never interpret these values as HTML.
|
|
123
|
+
*/
|
|
124
|
+
export interface AuthUiConfigInput {
|
|
125
|
+
locale?: AuthUiLocale;
|
|
126
|
+
productName?: string;
|
|
127
|
+
/** Absolute local path only; remote and data URLs are not accepted. */
|
|
128
|
+
logoUrl?: string;
|
|
129
|
+
supportText?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface AuthUiConfig {
|
|
132
|
+
locale: AuthUiLocale;
|
|
133
|
+
productName: string;
|
|
134
|
+
logoUrl?: string;
|
|
135
|
+
supportText: string;
|
|
136
|
+
}
|
|
137
|
+
export interface AuthConfigInput {
|
|
138
|
+
issuer: string;
|
|
139
|
+
clientId: string;
|
|
140
|
+
clientSecret: string;
|
|
141
|
+
/**
|
|
142
|
+
* Public application origin. Optional for source compatibility, but required
|
|
143
|
+
* at runtime in production.
|
|
144
|
+
*/
|
|
145
|
+
publicOrigin?: string;
|
|
146
|
+
/** Defaults to publicOrigin + routes.callbackPath. */
|
|
147
|
+
redirectUri?: string;
|
|
148
|
+
/** Defaults to publicOrigin + routes.signedOutPath. */
|
|
149
|
+
postLogoutRedirectUri?: string;
|
|
150
|
+
scopes?: readonly string[];
|
|
151
|
+
environment?: RuntimeEnvironment;
|
|
152
|
+
sessionTtlSeconds?: number;
|
|
153
|
+
allowedReturnToOrigins?: readonly string[];
|
|
154
|
+
/** Accepted access-token audiences. Omit to rely on authorized-party policy. */
|
|
155
|
+
accessTokenAudiences?: readonly string[];
|
|
156
|
+
/** Accepted Keycloak azp values. Defaults to clientId. */
|
|
157
|
+
accessTokenAuthorizedParties?: readonly string[];
|
|
158
|
+
routes?: AuthRouteSettingsInput;
|
|
159
|
+
ui?: AuthUiConfigInput;
|
|
160
|
+
clientAuthenticationMethod?: ClientAuthenticationMethod;
|
|
161
|
+
}
|
|
162
|
+
export interface AuthConfig {
|
|
163
|
+
issuer: URL;
|
|
164
|
+
clientId: string;
|
|
165
|
+
/** Required for confidential server-side clients. Never expose to a browser. */
|
|
166
|
+
clientSecret: string;
|
|
167
|
+
publicOrigin?: URL;
|
|
168
|
+
redirectUri: URL;
|
|
169
|
+
postLogoutRedirectUri?: URL;
|
|
170
|
+
scopes: readonly string[];
|
|
171
|
+
environment: RuntimeEnvironment;
|
|
172
|
+
sessionTtlSeconds: number;
|
|
173
|
+
allowedReturnToOrigins: readonly string[];
|
|
174
|
+
accessTokenAudiences: readonly string[];
|
|
175
|
+
accessTokenAuthorizedParties: readonly string[];
|
|
176
|
+
routes: AuthRouteSettings;
|
|
177
|
+
ui: AuthUiConfig;
|
|
178
|
+
clientAuthenticationMethod: ClientAuthenticationMethod;
|
|
179
|
+
}
|
|
180
|
+
export type AuthErrorCode = "CONFIG_INVALID" | "CLAIMS_INVALID" | "OIDC_DISCOVERY_FAILED" | "AUTHORIZATION_FAILED" | "ACCESS_TOKEN_INVALID" | "TOKEN_REFRESH_FAILED" | "SESSION_NOT_FOUND" | "SESSION_STORE_UNSAFE" | "RETURN_TO_INVALID" | "TRANSACTION_INVALID" | "SESSION_PERSISTENCE_FAILED" | "LOGOUT_FAILED";
|
|
181
|
+
export type TransactionConsumeOutcome<T> = {
|
|
182
|
+
status: "ok";
|
|
183
|
+
transaction: T;
|
|
184
|
+
} | {
|
|
185
|
+
status: "not_found";
|
|
186
|
+
} | {
|
|
187
|
+
status: "expired";
|
|
188
|
+
} | {
|
|
189
|
+
status: "state_mismatch";
|
|
190
|
+
} | {
|
|
191
|
+
status: "already_consumed";
|
|
192
|
+
} | {
|
|
193
|
+
status: "ambiguous";
|
|
194
|
+
};
|
|
195
|
+
export type ConsumeTransactionResult<T> = TransactionConsumeOutcome<T>;
|
|
196
|
+
/** Atomic stores must return one explicit outcome and never return secrets on failure. */
|
|
197
|
+
export interface AtomicTransactionStore<T> {
|
|
198
|
+
readonly capabilities?: AuthStoreCapabilities;
|
|
199
|
+
set(transaction: T, ttlSeconds: number): Promise<void>;
|
|
200
|
+
consume(id: string, expectedState: string): Promise<TransactionConsumeOutcome<T>>;
|
|
201
|
+
}
|
|
202
|
+
/** Values passed to loggers must be operational metadata, never token/secret data. */
|
|
203
|
+
export type SafeLogValue = string | number | boolean | null | undefined | readonly string[] | readonly number[] | readonly boolean[];
|
|
204
|
+
export type SafeLogFields = Readonly<Record<string, SafeLogValue>>;
|
|
205
|
+
export interface AuthLogger {
|
|
206
|
+
debug(message: string, fields?: SafeLogFields): void;
|
|
207
|
+
info(message: string, fields?: SafeLogFields): void;
|
|
208
|
+
warn(message: string, fields?: SafeLogFields): void;
|
|
209
|
+
error(message: string, fields?: SafeLogFields): void;
|
|
210
|
+
}
|
|
211
|
+
export interface ServerTokens {
|
|
212
|
+
accessToken: string;
|
|
213
|
+
refreshToken?: string;
|
|
214
|
+
idToken?: string;
|
|
215
|
+
expiresAt?: number;
|
|
216
|
+
tokenType?: string;
|
|
217
|
+
scope?: string;
|
|
218
|
+
}
|
|
219
|
+
/** Internal server record. Never serialize this object to a browser response. */
|
|
220
|
+
export interface ServerSession {
|
|
221
|
+
id: string;
|
|
222
|
+
actor: Actor;
|
|
223
|
+
tokens: ServerTokens;
|
|
224
|
+
createdAt: number;
|
|
225
|
+
updatedAt: number;
|
|
226
|
+
}
|
|
227
|
+
/** Token-free projection safe to expose to application frontends. */
|
|
228
|
+
export interface PublicSession {
|
|
229
|
+
actor: Actor;
|
|
230
|
+
expiresAt?: number;
|
|
231
|
+
}
|
|
232
|
+
export interface SessionStore {
|
|
233
|
+
/**
|
|
234
|
+
* Required in production. This attests that records survive restarts and
|
|
235
|
+
* are shared by every instance that can receive the same cookie.
|
|
236
|
+
*/
|
|
237
|
+
readonly capabilities?: AuthStoreCapabilities;
|
|
238
|
+
get(id: string): Promise<ServerSession | null>;
|
|
239
|
+
set(session: ServerSession, ttlSeconds: number): Promise<void>;
|
|
240
|
+
delete(id: string): Promise<void>;
|
|
241
|
+
touch?(id: string, ttlSeconds: number): Promise<void>;
|
|
242
|
+
}
|
|
243
|
+
export interface AuthStoreCapabilities {
|
|
244
|
+
readonly persistence: "memory" | "persistent";
|
|
245
|
+
readonly shared: boolean;
|
|
246
|
+
/** Required for production authorization-transaction stores. */
|
|
247
|
+
readonly atomicConsume?: boolean;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,wFAMd,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,eAAO,MAAM,eAAe,iFAKlB,C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,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAC9C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC/C,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const ACTOR_TYPES = [
|
|
2
|
+
"employee",
|
|
3
|
+
"contractor",
|
|
4
|
+
"external_customer",
|
|
5
|
+
"external_vendor",
|
|
6
|
+
"service",
|
|
7
|
+
];
|
|
8
|
+
export const VVP_REALM_ROLES = [
|
|
9
|
+
"platform_admin",
|
|
10
|
+
"employee",
|
|
11
|
+
"external_customer",
|
|
12
|
+
"external_vendor",
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,iBAAiB;IACjB,SAAS;CACD,CAAC;AAMX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,gBAAgB;IAChB,UAAU;IACV,mBAAmB;IACnB,iBAAiB;CACT,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dreadkn1ght123/auth-types",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Shared VVP authentication contracts and types",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"provenance": true
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -b",
|
|
27
|
+
"typecheck": "tsc -b --pretty false",
|
|
28
|
+
"test": "vitest run"
|
|
29
|
+
}
|
|
30
|
+
}
|