@effect-auth/core 0.1.0-alpha.10 → 0.1.0-alpha.13
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 +65 -4
- package/dist/AuditLog.d.ts +60 -0
- package/dist/AuditLog.d.ts.map +1 -1
- package/dist/AuditLog.js +105 -0
- package/dist/AuditLog.js.map +1 -1
- package/dist/AuthKernel.d.ts +1 -1
- package/dist/Client.d.ts +72 -1
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +218 -1
- package/dist/Client.js.map +1 -1
- package/dist/DomainVerification.d.ts +200 -0
- package/dist/DomainVerification.d.ts.map +1 -0
- package/dist/DomainVerification.js +304 -0
- package/dist/DomainVerification.js.map +1 -0
- package/dist/EffectQbSqliteStorage.d.ts +389 -4
- package/dist/EffectQbSqliteStorage.d.ts.map +1 -1
- package/dist/EffectQbSqliteStorage.js +1191 -4
- package/dist/EffectQbSqliteStorage.js.map +1 -1
- package/dist/EmailOtp.d.ts +2 -2
- package/dist/HttpApi/Api.d.ts +477 -23
- package/dist/HttpApi/Api.d.ts.map +1 -1
- package/dist/HttpApi/Api.js +705 -4
- package/dist/HttpApi/Api.js.map +1 -1
- package/dist/HttpApi/Endpoints.d.ts +133 -5
- package/dist/HttpApi/Endpoints.d.ts.map +1 -1
- package/dist/HttpApi/Endpoints.js +57 -2
- package/dist/HttpApi/Endpoints.js.map +1 -1
- package/dist/HttpApi/Errors.d.ts +32 -0
- package/dist/HttpApi/Errors.d.ts.map +1 -1
- package/dist/HttpApi/Errors.js +46 -0
- package/dist/HttpApi/Errors.js.map +1 -1
- package/dist/HttpApi/Schemas.d.ts +149 -8
- package/dist/HttpApi/Schemas.d.ts.map +1 -1
- package/dist/HttpApi/Schemas.js +128 -0
- package/dist/HttpApi/Schemas.js.map +1 -1
- package/dist/Identifiers.d.ts +3 -0
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js +2 -0
- package/dist/Identifiers.js.map +1 -1
- package/dist/IncidentAction.d.ts +80 -0
- package/dist/IncidentAction.d.ts.map +1 -0
- package/dist/IncidentAction.js +158 -0
- package/dist/IncidentAction.js.map +1 -0
- package/dist/Jwt.d.ts +10 -0
- package/dist/Jwt.d.ts.map +1 -1
- package/dist/Jwt.js +209 -0
- package/dist/Jwt.js.map +1 -1
- package/dist/LoginNotification.d.ts +1 -1
- package/dist/LoginRisk.d.ts +272 -1
- package/dist/LoginRisk.d.ts.map +1 -1
- package/dist/LoginRisk.js +427 -0
- package/dist/LoginRisk.js.map +1 -1
- package/dist/MachineAuth.d.ts +73 -0
- package/dist/MachineAuth.d.ts.map +1 -0
- package/dist/MachineAuth.js +147 -0
- package/dist/MachineAuth.js.map +1 -0
- package/dist/MagicLink.d.ts +2 -2
- package/dist/OAuth.d.ts +957 -1
- package/dist/OAuth.d.ts.map +1 -1
- package/dist/OAuth.js +1403 -1
- package/dist/OAuth.js.map +1 -1
- package/dist/Password.d.ts +2 -2
- package/dist/Retention.d.ts +98 -0
- package/dist/Retention.d.ts.map +1 -0
- package/dist/Retention.js +204 -0
- package/dist/Retention.js.map +1 -0
- package/dist/SecurityTimeline.d.ts +8 -2
- package/dist/SecurityTimeline.d.ts.map +1 -1
- package/dist/SecurityTimeline.js +75 -0
- package/dist/SecurityTimeline.js.map +1 -1
- package/dist/StorageMigrations.d.ts +11 -1
- package/dist/StorageMigrations.d.ts.map +1 -1
- package/dist/StorageMigrations.js +206 -0
- package/dist/StorageMigrations.js.map +1 -1
- package/dist/Webhook.d.ts +310 -2
- package/dist/Webhook.d.ts.map +1 -1
- package/dist/Webhook.js +511 -1
- package/dist/Webhook.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/migrations/0014_auth_webhook_outbox.sql +16 -0
- package/migrations/0015_auth_webhook_replay.sql +7 -0
- package/migrations/0016_auth_login_risk_history.sql +23 -0
- package/migrations/0017_auth_audit_log.sql +17 -0
- package/migrations/0018_auth_domain_verification.sql +18 -0
- package/migrations/0019_auth_oauth_authorization_code.sql +17 -0
- package/migrations/0020_auth_oauth_provider_mode_token.sql +24 -0
- package/migrations/0021_auth_oauth_client_secret.sql +14 -0
- package/migrations/0022_auth_oauth_client.sql +15 -0
- package/migrations/0023_auth_oauth_consent.sql +15 -0
- package/package.json +17 -1
package/dist/OAuth.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Challenge } from "./Challenge.js";
|
|
|
4
4
|
import type { ChallengeService } from "./Challenge.js";
|
|
5
5
|
import { Crypto } from "./Crypto.js";
|
|
6
6
|
import type { CryptoService } from "./Crypto.js";
|
|
7
|
-
import { ChallengeId, Email, OAuthAccountId, OAuthProviderId, UnixMillis, UserId } from "./Identifiers.js";
|
|
7
|
+
import { ChallengeId, Email, OAuthAccountId, OAuthClientId, OAuthProviderId, UnixMillis, UserId } from "./Identifiers.js";
|
|
8
8
|
import { JwtError, JwtVerifier, type JwksDocument, type JwtAudience, type JwtAlgorithm, type JwtClaims, type JwtHeader, type JwtKeyInfo, type JwtKeysService, type JwtVerifierService, type JwtVerificationFailureReason } from "./Jwt.js";
|
|
9
9
|
export type OAuthStateToken = Brand.Branded<string, "auth/OAuthStateToken">;
|
|
10
10
|
export declare const OAuthStateToken: Brand.Constructor<OAuthStateToken>;
|
|
@@ -27,8 +27,14 @@ export declare const defaultOAuthLinkConfirmationTtl: Duration.Duration;
|
|
|
27
27
|
export declare const defaultOAuthJwksCacheTtl: Duration.Duration;
|
|
28
28
|
export declare const defaultOAuthStateSecretBytes = 32;
|
|
29
29
|
export declare const defaultOAuthCodeVerifierBytes = 32;
|
|
30
|
+
export declare const defaultOAuthAuthorizationCodeBytes = 32;
|
|
31
|
+
export declare const defaultOAuthAuthorizationCodeTtl: Duration.Duration;
|
|
30
32
|
export declare const defaultOAuthLinkConfirmationSecretBytes = 32;
|
|
31
33
|
export declare const defaultOAuthNonceBytes = 16;
|
|
34
|
+
export declare const defaultOAuthProviderModeAccessTokenBytes = 32;
|
|
35
|
+
export declare const defaultOAuthProviderModeRefreshTokenBytes = 32;
|
|
36
|
+
export declare const defaultOAuthProviderModeAccessTokenTtl: Duration.Duration;
|
|
37
|
+
export declare const defaultOAuthProviderModeRefreshTokenTtl: Duration.Duration;
|
|
32
38
|
export declare const appleSignInProviderId: OAuthProviderId;
|
|
33
39
|
export declare const appleSignInIssuer = "https://appleid.apple.com";
|
|
34
40
|
export declare const appleSignInAuthorizationEndpoint = "https://appleid.apple.com/auth/authorize";
|
|
@@ -169,6 +175,799 @@ export declare class OAuthProviderError extends OAuthProviderError_base<{
|
|
|
169
175
|
export interface OAuthProvidersService {
|
|
170
176
|
readonly get: (id: OAuthProviderId) => Effect.Effect<OptionTypes.Option<OAuthProviderConfig>, OAuthProviderError>;
|
|
171
177
|
}
|
|
178
|
+
export type OAuthClientType = "public" | "confidential";
|
|
179
|
+
export type OAuthClientStatus = "active" | "disabled";
|
|
180
|
+
export type OAuthClientGrantType = "authorization_code" | "refresh_token" | "client_credentials";
|
|
181
|
+
export type OAuthClientResponseType = "code";
|
|
182
|
+
export type OAuthClientSecretAuthenticationMethod = "client_secret_basic" | "client_secret_post";
|
|
183
|
+
export type OAuthClientSecretPrefix = Brand.Branded<string, "auth/OAuthClientSecretPrefix">;
|
|
184
|
+
export declare const OAuthClientSecretPrefix: Brand.Constructor<OAuthClientSecretPrefix>;
|
|
185
|
+
export type OAuthClientSecret = Brand.Branded<string, "auth/OAuthClientSecret">;
|
|
186
|
+
export declare const OAuthClientSecret: Brand.Constructor<OAuthClientSecret>;
|
|
187
|
+
export type OAuthClientSecretHash = Brand.Branded<string, "auth/OAuthClientSecretHash">;
|
|
188
|
+
export declare const OAuthClientSecretHash: Brand.Constructor<OAuthClientSecretHash>;
|
|
189
|
+
export declare const defaultOAuthClientSecretPrefixBytes = 8;
|
|
190
|
+
export declare const defaultOAuthClientSecretBytes = 32;
|
|
191
|
+
export interface OAuthClientRecord {
|
|
192
|
+
readonly id: OAuthClientId;
|
|
193
|
+
readonly type: OAuthClientType;
|
|
194
|
+
readonly status: OAuthClientStatus;
|
|
195
|
+
readonly name?: string;
|
|
196
|
+
readonly redirectUris: readonly string[];
|
|
197
|
+
readonly allowedGrantTypes: readonly OAuthClientGrantType[];
|
|
198
|
+
readonly allowedResponseTypes: readonly OAuthClientResponseType[];
|
|
199
|
+
readonly allowedScopes?: readonly string[];
|
|
200
|
+
readonly createdAt?: UnixMillis;
|
|
201
|
+
readonly updatedAt?: UnixMillis;
|
|
202
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
203
|
+
}
|
|
204
|
+
export interface OAuthClientLookupInput {
|
|
205
|
+
readonly clientId: OAuthClientId;
|
|
206
|
+
}
|
|
207
|
+
export interface OAuthClientRedirectUriValidationInput extends OAuthClientLookupInput {
|
|
208
|
+
readonly redirectUri: string;
|
|
209
|
+
readonly responseType?: OAuthClientResponseType;
|
|
210
|
+
readonly grantType?: OAuthClientGrantType;
|
|
211
|
+
}
|
|
212
|
+
export type OAuthClientRedirectUriValidationFailureReason = "unknown_client" | "disabled_client" | "unsupported_response_type" | "unsupported_grant_type" | "redirect_uri_mismatch";
|
|
213
|
+
export type OAuthClientRedirectUriValidationResult = {
|
|
214
|
+
readonly valid: true;
|
|
215
|
+
readonly client: OAuthClientRecord;
|
|
216
|
+
} | {
|
|
217
|
+
readonly valid: false;
|
|
218
|
+
readonly reason: OAuthClientRedirectUriValidationFailureReason;
|
|
219
|
+
};
|
|
220
|
+
export type OAuthClientRegistryOperation = "find" | "validate-redirect-uri";
|
|
221
|
+
declare const OAuthClientRegistryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
222
|
+
readonly _tag: "OAuthClientRegistryError";
|
|
223
|
+
} & Readonly<A>;
|
|
224
|
+
export declare class OAuthClientRegistryError extends OAuthClientRegistryError_base<{
|
|
225
|
+
readonly operation: OAuthClientRegistryOperation;
|
|
226
|
+
readonly message: string;
|
|
227
|
+
readonly cause?: unknown;
|
|
228
|
+
}> {
|
|
229
|
+
}
|
|
230
|
+
export interface OAuthClientRegistryService {
|
|
231
|
+
readonly find: (input: OAuthClientLookupInput) => Effect.Effect<OptionTypes.Option<OAuthClientRecord>, OAuthClientRegistryError>;
|
|
232
|
+
readonly validateRedirectUri: (input: OAuthClientRedirectUriValidationInput) => Effect.Effect<OAuthClientRedirectUriValidationResult, OAuthClientRegistryError>;
|
|
233
|
+
}
|
|
234
|
+
declare const OAuthClientRegistry_base: Context.ServiceClass<OAuthClientRegistry, "auth/OAuthClientRegistry", OAuthClientRegistryService>;
|
|
235
|
+
export declare class OAuthClientRegistry extends OAuthClientRegistry_base {
|
|
236
|
+
}
|
|
237
|
+
export declare namespace OAuthClientRegistry {
|
|
238
|
+
const make: (service: OAuthClientRegistryService) => OAuthClientRegistryService;
|
|
239
|
+
}
|
|
240
|
+
export interface OAuthClientStoreListInput {
|
|
241
|
+
readonly includeDisabled?: boolean;
|
|
242
|
+
}
|
|
243
|
+
export type OAuthClientStoreOperation = "upsert" | "find" | "list" | "validate-redirect-uri";
|
|
244
|
+
declare const OAuthClientStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
245
|
+
readonly _tag: "OAuthClientStoreError";
|
|
246
|
+
} & Readonly<A>;
|
|
247
|
+
export declare class OAuthClientStoreError extends OAuthClientStoreError_base<{
|
|
248
|
+
readonly operation: OAuthClientStoreOperation;
|
|
249
|
+
readonly message: string;
|
|
250
|
+
readonly cause?: unknown;
|
|
251
|
+
}> {
|
|
252
|
+
}
|
|
253
|
+
export interface OAuthClientStoreService {
|
|
254
|
+
readonly upsert: (record: OAuthClientRecord) => Effect.Effect<void, OAuthClientStoreError>;
|
|
255
|
+
readonly find: (input: OAuthClientLookupInput) => Effect.Effect<OptionTypes.Option<OAuthClientRecord>, OAuthClientStoreError>;
|
|
256
|
+
readonly list: (input?: OAuthClientStoreListInput) => Effect.Effect<readonly OAuthClientRecord[], OAuthClientStoreError>;
|
|
257
|
+
readonly validateRedirectUri: (input: OAuthClientRedirectUriValidationInput) => Effect.Effect<OAuthClientRedirectUriValidationResult, OAuthClientStoreError>;
|
|
258
|
+
}
|
|
259
|
+
declare const OAuthClientStore_base: Context.ServiceClass<OAuthClientStore, "auth/OAuthClientStore", OAuthClientStoreService>;
|
|
260
|
+
export declare class OAuthClientStore extends OAuthClientStore_base {
|
|
261
|
+
}
|
|
262
|
+
export declare namespace OAuthClientStore {
|
|
263
|
+
const make: (service: OAuthClientStoreService) => OAuthClientStoreService;
|
|
264
|
+
}
|
|
265
|
+
export interface OAuthConsentRecord {
|
|
266
|
+
readonly userId: UserId;
|
|
267
|
+
readonly clientId: OAuthClientId;
|
|
268
|
+
readonly scopes: readonly string[];
|
|
269
|
+
readonly grantedAt: UnixMillis;
|
|
270
|
+
readonly expiresAt?: UnixMillis;
|
|
271
|
+
readonly revokedAt?: UnixMillis;
|
|
272
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
273
|
+
}
|
|
274
|
+
export interface OAuthConsentFindActiveInput {
|
|
275
|
+
readonly userId: UserId;
|
|
276
|
+
readonly clientId: OAuthClientId;
|
|
277
|
+
readonly scopes?: readonly string[];
|
|
278
|
+
readonly now: UnixMillis;
|
|
279
|
+
}
|
|
280
|
+
export interface OAuthConsentListForUserInput {
|
|
281
|
+
readonly userId: UserId;
|
|
282
|
+
readonly now: UnixMillis;
|
|
283
|
+
readonly includeInactive?: boolean;
|
|
284
|
+
}
|
|
285
|
+
export interface OAuthConsentRevokeInput {
|
|
286
|
+
readonly userId: UserId;
|
|
287
|
+
readonly clientId: OAuthClientId;
|
|
288
|
+
readonly revokedAt: UnixMillis;
|
|
289
|
+
readonly reason?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface OAuthConsentStoreDeleteInactiveCutoffs {
|
|
292
|
+
readonly beforeExpiresAt?: UnixMillis;
|
|
293
|
+
readonly beforeRevokedAt?: UnixMillis;
|
|
294
|
+
}
|
|
295
|
+
export type OAuthConsentStoreDeleteInactiveInput = (OAuthConsentStoreDeleteInactiveCutoffs & {
|
|
296
|
+
readonly beforeExpiresAt: UnixMillis;
|
|
297
|
+
}) | (OAuthConsentStoreDeleteInactiveCutoffs & {
|
|
298
|
+
readonly beforeRevokedAt: UnixMillis;
|
|
299
|
+
});
|
|
300
|
+
export type OAuthConsentStoreOperation = "upsert" | "find-active" | "list-for-user" | "revoke" | "deleteInactive";
|
|
301
|
+
declare const OAuthConsentStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
302
|
+
readonly _tag: "OAuthConsentStoreError";
|
|
303
|
+
} & Readonly<A>;
|
|
304
|
+
export declare class OAuthConsentStoreError extends OAuthConsentStoreError_base<{
|
|
305
|
+
readonly operation: OAuthConsentStoreOperation;
|
|
306
|
+
readonly message: string;
|
|
307
|
+
readonly cause?: unknown;
|
|
308
|
+
}> {
|
|
309
|
+
}
|
|
310
|
+
export interface OAuthConsentStoreService {
|
|
311
|
+
readonly upsert: (record: OAuthConsentRecord) => Effect.Effect<void, OAuthConsentStoreError>;
|
|
312
|
+
readonly findActive: (input: OAuthConsentFindActiveInput) => Effect.Effect<OptionTypes.Option<OAuthConsentRecord>, OAuthConsentStoreError>;
|
|
313
|
+
readonly listForUser: (input: OAuthConsentListForUserInput) => Effect.Effect<readonly OAuthConsentRecord[], OAuthConsentStoreError>;
|
|
314
|
+
readonly revoke: (input: OAuthConsentRevokeInput) => Effect.Effect<OptionTypes.Option<OAuthConsentRecord>, OAuthConsentStoreError>;
|
|
315
|
+
readonly deleteInactive: (input: OAuthConsentStoreDeleteInactiveInput) => Effect.Effect<number, OAuthConsentStoreError>;
|
|
316
|
+
}
|
|
317
|
+
declare const OAuthConsentStore_base: Context.ServiceClass<OAuthConsentStore, "auth/OAuthConsentStore", OAuthConsentStoreService>;
|
|
318
|
+
export declare class OAuthConsentStore extends OAuthConsentStore_base {
|
|
319
|
+
}
|
|
320
|
+
export declare namespace OAuthConsentStore {
|
|
321
|
+
const make: (service: OAuthConsentStoreService) => OAuthConsentStoreService;
|
|
322
|
+
}
|
|
323
|
+
export type OAuthClientSecretOperation = "generate" | "parse" | "hash" | "verify";
|
|
324
|
+
declare const OAuthClientSecretError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
325
|
+
readonly _tag: "OAuthClientSecretError";
|
|
326
|
+
} & Readonly<A>;
|
|
327
|
+
export declare class OAuthClientSecretError extends OAuthClientSecretError_base<{
|
|
328
|
+
readonly operation: OAuthClientSecretOperation;
|
|
329
|
+
readonly message: string;
|
|
330
|
+
readonly cause?: unknown;
|
|
331
|
+
}> {
|
|
332
|
+
}
|
|
333
|
+
export interface OAuthClientSecretGenerateInput {
|
|
334
|
+
readonly prefixBytes?: number;
|
|
335
|
+
readonly secretBytes?: number;
|
|
336
|
+
}
|
|
337
|
+
export interface GeneratedOAuthClientSecret {
|
|
338
|
+
readonly prefix: OAuthClientSecretPrefix;
|
|
339
|
+
readonly secret: Redacted.Redacted<OAuthClientSecret>;
|
|
340
|
+
}
|
|
341
|
+
export interface OAuthClientSecretHashInput {
|
|
342
|
+
readonly secret: Redacted.Redacted<string>;
|
|
343
|
+
}
|
|
344
|
+
export interface OAuthClientSecretVerifyInput extends OAuthClientSecretHashInput {
|
|
345
|
+
readonly hash: OAuthClientSecretHash;
|
|
346
|
+
}
|
|
347
|
+
export interface OAuthClientSecretsService {
|
|
348
|
+
readonly generate: (input?: OAuthClientSecretGenerateInput) => Effect.Effect<GeneratedOAuthClientSecret, OAuthClientSecretError>;
|
|
349
|
+
readonly parse: (secret: Redacted.Redacted<string>) => Effect.Effect<OAuthClientSecretPrefix, OAuthClientSecretError>;
|
|
350
|
+
readonly hash: (input: OAuthClientSecretHashInput) => Effect.Effect<OAuthClientSecretHash, OAuthClientSecretError>;
|
|
351
|
+
readonly verify: (input: OAuthClientSecretVerifyInput) => Effect.Effect<boolean, OAuthClientSecretError>;
|
|
352
|
+
}
|
|
353
|
+
declare const OAuthClientSecrets_base: Context.ServiceClass<OAuthClientSecrets, "auth/OAuthClientSecrets", OAuthClientSecretsService>;
|
|
354
|
+
export declare class OAuthClientSecrets extends OAuthClientSecrets_base {
|
|
355
|
+
}
|
|
356
|
+
export declare namespace OAuthClientSecrets {
|
|
357
|
+
const make: (service: OAuthClientSecretsService) => OAuthClientSecretsService;
|
|
358
|
+
}
|
|
359
|
+
export interface OAuthClientSecretsDependencies {
|
|
360
|
+
readonly crypto: CryptoService;
|
|
361
|
+
}
|
|
362
|
+
export interface OAuthClientSecretRecord {
|
|
363
|
+
readonly clientId: OAuthClientId;
|
|
364
|
+
readonly prefix: OAuthClientSecretPrefix;
|
|
365
|
+
readonly secretHash: OAuthClientSecretHash;
|
|
366
|
+
readonly authenticationMethods: readonly OAuthClientSecretAuthenticationMethod[];
|
|
367
|
+
readonly createdAt: UnixMillis;
|
|
368
|
+
readonly expiresAt?: UnixMillis;
|
|
369
|
+
readonly lastUsedAt?: UnixMillis;
|
|
370
|
+
readonly revokedAt?: UnixMillis;
|
|
371
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
372
|
+
}
|
|
373
|
+
export interface OAuthClientSecretStoreLookupInput {
|
|
374
|
+
readonly clientId: OAuthClientId;
|
|
375
|
+
readonly prefix: OAuthClientSecretPrefix;
|
|
376
|
+
}
|
|
377
|
+
export interface OAuthClientSecretStoreMarkUsedInput extends OAuthClientSecretStoreLookupInput {
|
|
378
|
+
readonly lastUsedAt: UnixMillis;
|
|
379
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
380
|
+
}
|
|
381
|
+
export interface OAuthClientSecretStoreRevokeInput extends OAuthClientSecretStoreLookupInput {
|
|
382
|
+
readonly revokedAt: UnixMillis;
|
|
383
|
+
readonly reason?: string;
|
|
384
|
+
}
|
|
385
|
+
export type OAuthClientSecretStoreOperation = "upsert" | "find" | "mark-used" | "revoke";
|
|
386
|
+
declare const OAuthClientSecretStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
387
|
+
readonly _tag: "OAuthClientSecretStoreError";
|
|
388
|
+
} & Readonly<A>;
|
|
389
|
+
export declare class OAuthClientSecretStoreError extends OAuthClientSecretStoreError_base<{
|
|
390
|
+
readonly operation: OAuthClientSecretStoreOperation;
|
|
391
|
+
readonly message: string;
|
|
392
|
+
readonly cause?: unknown;
|
|
393
|
+
}> {
|
|
394
|
+
}
|
|
395
|
+
export interface OAuthClientSecretStoreService {
|
|
396
|
+
readonly upsert: (record: OAuthClientSecretRecord) => Effect.Effect<void, OAuthClientSecretStoreError>;
|
|
397
|
+
readonly findByClientIdAndPrefix: (input: OAuthClientSecretStoreLookupInput) => Effect.Effect<OptionTypes.Option<OAuthClientSecretRecord>, OAuthClientSecretStoreError>;
|
|
398
|
+
readonly markUsed: (input: OAuthClientSecretStoreMarkUsedInput) => Effect.Effect<OptionTypes.Option<OAuthClientSecretRecord>, OAuthClientSecretStoreError>;
|
|
399
|
+
readonly revoke: (input: OAuthClientSecretStoreRevokeInput) => Effect.Effect<OptionTypes.Option<OAuthClientSecretRecord>, OAuthClientSecretStoreError>;
|
|
400
|
+
}
|
|
401
|
+
declare const OAuthClientSecretStore_base: Context.ServiceClass<OAuthClientSecretStore, "auth/OAuthClientSecretStore", OAuthClientSecretStoreService>;
|
|
402
|
+
export declare class OAuthClientSecretStore extends OAuthClientSecretStore_base {
|
|
403
|
+
}
|
|
404
|
+
export declare namespace OAuthClientSecretStore {
|
|
405
|
+
const make: (service: OAuthClientSecretStoreService) => OAuthClientSecretStoreService;
|
|
406
|
+
}
|
|
407
|
+
export interface OAuthClientSecretAuthenticateClientInput {
|
|
408
|
+
readonly clientId: OAuthClientId;
|
|
409
|
+
readonly method: OAuthClientSecretAuthenticationMethod;
|
|
410
|
+
readonly clientSecret: Redacted.Redacted<string>;
|
|
411
|
+
readonly now?: UnixMillis;
|
|
412
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
413
|
+
}
|
|
414
|
+
export type OAuthClientSecretVerificationOperation = "authenticate-client";
|
|
415
|
+
declare const OAuthClientSecretVerificationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
416
|
+
readonly _tag: "OAuthClientSecretVerificationError";
|
|
417
|
+
} & Readonly<A>;
|
|
418
|
+
export declare class OAuthClientSecretVerificationError extends OAuthClientSecretVerificationError_base<{
|
|
419
|
+
readonly operation: OAuthClientSecretVerificationOperation;
|
|
420
|
+
readonly message: string;
|
|
421
|
+
readonly cause?: unknown;
|
|
422
|
+
}> {
|
|
423
|
+
}
|
|
424
|
+
export interface OAuthClientSecretVerificationService {
|
|
425
|
+
readonly authenticateClient: (input: OAuthClientSecretAuthenticateClientInput) => Effect.Effect<boolean, OAuthClientSecretVerificationError>;
|
|
426
|
+
}
|
|
427
|
+
declare const OAuthClientSecretVerification_base: Context.ServiceClass<OAuthClientSecretVerification, "auth/OAuthClientSecretVerification", OAuthClientSecretVerificationService>;
|
|
428
|
+
export declare class OAuthClientSecretVerification extends OAuthClientSecretVerification_base {
|
|
429
|
+
}
|
|
430
|
+
export declare namespace OAuthClientSecretVerification {
|
|
431
|
+
const make: (service: OAuthClientSecretVerificationService) => OAuthClientSecretVerificationService;
|
|
432
|
+
}
|
|
433
|
+
export interface OAuthClientSecretVerificationDependencies {
|
|
434
|
+
readonly clientSecrets: OAuthClientSecretsService;
|
|
435
|
+
readonly secretStore: OAuthClientSecretStoreService;
|
|
436
|
+
}
|
|
437
|
+
export interface OAuthAuthorizationCodeRecord {
|
|
438
|
+
readonly codeHash: string;
|
|
439
|
+
readonly clientId: OAuthClientId;
|
|
440
|
+
readonly subject: string;
|
|
441
|
+
readonly redirectUri: string;
|
|
442
|
+
readonly scopes: readonly string[];
|
|
443
|
+
readonly codeChallenge?: OAuthCodeChallenge;
|
|
444
|
+
readonly codeChallengeMethod?: "S256";
|
|
445
|
+
readonly issuedAt: UnixMillis;
|
|
446
|
+
readonly expiresAt: UnixMillis;
|
|
447
|
+
readonly consumedAt?: UnixMillis;
|
|
448
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
449
|
+
}
|
|
450
|
+
export interface OAuthIssuedAuthorizationCode {
|
|
451
|
+
readonly code: Redacted.Redacted<OAuthAuthorizationCode>;
|
|
452
|
+
readonly clientId: OAuthClientId;
|
|
453
|
+
readonly subject: string;
|
|
454
|
+
readonly redirectUri: string;
|
|
455
|
+
readonly scopes: readonly string[];
|
|
456
|
+
readonly codeChallenge?: OAuthCodeChallenge;
|
|
457
|
+
readonly codeChallengeMethod?: "S256";
|
|
458
|
+
readonly issuedAt: UnixMillis;
|
|
459
|
+
readonly expiresAt: UnixMillis;
|
|
460
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
461
|
+
}
|
|
462
|
+
export interface OAuthConsumedAuthorizationCode {
|
|
463
|
+
readonly clientId: OAuthClientId;
|
|
464
|
+
readonly subject: string;
|
|
465
|
+
readonly redirectUri: string;
|
|
466
|
+
readonly scopes: readonly string[];
|
|
467
|
+
readonly codeChallenge?: OAuthCodeChallenge;
|
|
468
|
+
readonly codeChallengeMethod?: "S256";
|
|
469
|
+
readonly issuedAt: UnixMillis;
|
|
470
|
+
readonly expiresAt: UnixMillis;
|
|
471
|
+
readonly consumedAt: UnixMillis;
|
|
472
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
473
|
+
}
|
|
474
|
+
export interface OAuthAuthorizationCodeIssueInput {
|
|
475
|
+
readonly clientId: OAuthClientId;
|
|
476
|
+
readonly subject: string;
|
|
477
|
+
readonly redirectUri: string;
|
|
478
|
+
readonly scopes?: readonly string[];
|
|
479
|
+
readonly codeChallenge?: OAuthCodeChallenge | string;
|
|
480
|
+
readonly codeChallengeMethod?: "S256";
|
|
481
|
+
readonly code?: Redacted.Redacted<OAuthAuthorizationCode | string>;
|
|
482
|
+
readonly issuedAt?: UnixMillis;
|
|
483
|
+
readonly expiresAt?: UnixMillis;
|
|
484
|
+
readonly expiresIn?: Duration.Duration;
|
|
485
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
486
|
+
}
|
|
487
|
+
export interface OAuthAuthorizationCodeConsumeInput {
|
|
488
|
+
readonly code: Redacted.Redacted<OAuthAuthorizationCode | string>;
|
|
489
|
+
readonly clientId: OAuthClientId;
|
|
490
|
+
readonly redirectUri: string;
|
|
491
|
+
readonly codeVerifier?: Redacted.Redacted<OAuthCodeVerifier | string>;
|
|
492
|
+
readonly now?: UnixMillis;
|
|
493
|
+
}
|
|
494
|
+
export type OAuthAuthorizationCodeConsumeFailureReason = "unknown_code" | "already_consumed" | "expired" | "client_mismatch" | "redirect_uri_mismatch" | "pkce_required" | "pkce_mismatch";
|
|
495
|
+
export type OAuthAuthorizationCodeConsumeResult = {
|
|
496
|
+
readonly valid: true;
|
|
497
|
+
readonly code: OAuthConsumedAuthorizationCode;
|
|
498
|
+
} | {
|
|
499
|
+
readonly valid: false;
|
|
500
|
+
readonly reason: OAuthAuthorizationCodeConsumeFailureReason;
|
|
501
|
+
};
|
|
502
|
+
export interface OAuthAuthorizationCodeStoreLookupInput {
|
|
503
|
+
readonly codeHash: string;
|
|
504
|
+
}
|
|
505
|
+
export interface OAuthAuthorizationCodeStoreMarkConsumedInput extends OAuthAuthorizationCodeStoreLookupInput {
|
|
506
|
+
readonly consumedAt: UnixMillis;
|
|
507
|
+
}
|
|
508
|
+
export type OAuthAuthorizationCodeStoreMarkConsumedResult = {
|
|
509
|
+
readonly status: "missing";
|
|
510
|
+
} | {
|
|
511
|
+
readonly status: "already_consumed";
|
|
512
|
+
readonly record: OAuthAuthorizationCodeRecord;
|
|
513
|
+
} | {
|
|
514
|
+
readonly status: "consumed";
|
|
515
|
+
readonly record: OAuthAuthorizationCodeRecord;
|
|
516
|
+
};
|
|
517
|
+
export type OAuthAuthorizationCodeStoreOperation = "upsert" | "find" | "mark-consumed";
|
|
518
|
+
declare const OAuthAuthorizationCodeStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
519
|
+
readonly _tag: "OAuthAuthorizationCodeStoreError";
|
|
520
|
+
} & Readonly<A>;
|
|
521
|
+
export declare class OAuthAuthorizationCodeStoreError extends OAuthAuthorizationCodeStoreError_base<{
|
|
522
|
+
readonly operation: OAuthAuthorizationCodeStoreOperation;
|
|
523
|
+
readonly message: string;
|
|
524
|
+
readonly cause?: unknown;
|
|
525
|
+
}> {
|
|
526
|
+
}
|
|
527
|
+
export interface OAuthAuthorizationCodeStoreService {
|
|
528
|
+
readonly upsert: (record: OAuthAuthorizationCodeRecord) => Effect.Effect<void, OAuthAuthorizationCodeStoreError>;
|
|
529
|
+
readonly findByHash: (input: OAuthAuthorizationCodeStoreLookupInput) => Effect.Effect<OptionTypes.Option<OAuthAuthorizationCodeRecord>, OAuthAuthorizationCodeStoreError>;
|
|
530
|
+
readonly markConsumed: (input: OAuthAuthorizationCodeStoreMarkConsumedInput) => Effect.Effect<OAuthAuthorizationCodeStoreMarkConsumedResult, OAuthAuthorizationCodeStoreError>;
|
|
531
|
+
}
|
|
532
|
+
declare const OAuthAuthorizationCodeStore_base: Context.ServiceClass<OAuthAuthorizationCodeStore, "auth/OAuthAuthorizationCodeStore", OAuthAuthorizationCodeStoreService>;
|
|
533
|
+
export declare class OAuthAuthorizationCodeStore extends OAuthAuthorizationCodeStore_base {
|
|
534
|
+
}
|
|
535
|
+
export declare namespace OAuthAuthorizationCodeStore {
|
|
536
|
+
const make: (service: OAuthAuthorizationCodeStoreService) => OAuthAuthorizationCodeStoreService;
|
|
537
|
+
}
|
|
538
|
+
export type OAuthAuthorizationCodeGrantOperation = "issue" | "consume";
|
|
539
|
+
declare const OAuthAuthorizationCodeGrantError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
540
|
+
readonly _tag: "OAuthAuthorizationCodeGrantError";
|
|
541
|
+
} & Readonly<A>;
|
|
542
|
+
export declare class OAuthAuthorizationCodeGrantError extends OAuthAuthorizationCodeGrantError_base<{
|
|
543
|
+
readonly operation: OAuthAuthorizationCodeGrantOperation;
|
|
544
|
+
readonly message: string;
|
|
545
|
+
readonly cause?: unknown;
|
|
546
|
+
}> {
|
|
547
|
+
}
|
|
548
|
+
export interface OAuthAuthorizationCodeGrantService {
|
|
549
|
+
readonly issue: (input: OAuthAuthorizationCodeIssueInput) => Effect.Effect<OAuthIssuedAuthorizationCode, OAuthAuthorizationCodeGrantError>;
|
|
550
|
+
readonly consume: (input: OAuthAuthorizationCodeConsumeInput) => Effect.Effect<OAuthAuthorizationCodeConsumeResult, OAuthAuthorizationCodeGrantError>;
|
|
551
|
+
}
|
|
552
|
+
declare const OAuthAuthorizationCodeGrant_base: Context.ServiceClass<OAuthAuthorizationCodeGrant, "auth/OAuthAuthorizationCodeGrant", OAuthAuthorizationCodeGrantService>;
|
|
553
|
+
export declare class OAuthAuthorizationCodeGrant extends OAuthAuthorizationCodeGrant_base {
|
|
554
|
+
}
|
|
555
|
+
export declare namespace OAuthAuthorizationCodeGrant {
|
|
556
|
+
const make: (service: OAuthAuthorizationCodeGrantService) => OAuthAuthorizationCodeGrantService;
|
|
557
|
+
}
|
|
558
|
+
export interface OAuthAuthorizationCodeTokenIssueInput {
|
|
559
|
+
readonly client: OAuthClientRecord;
|
|
560
|
+
readonly code: OAuthConsumedAuthorizationCode;
|
|
561
|
+
readonly now: UnixMillis;
|
|
562
|
+
}
|
|
563
|
+
export type OAuthAuthorizationCodeTokenIssuerOperation = "issue";
|
|
564
|
+
declare const OAuthAuthorizationCodeTokenIssuerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
565
|
+
readonly _tag: "OAuthAuthorizationCodeTokenIssuerError";
|
|
566
|
+
} & Readonly<A>;
|
|
567
|
+
export declare class OAuthAuthorizationCodeTokenIssuerError extends OAuthAuthorizationCodeTokenIssuerError_base<{
|
|
568
|
+
readonly operation: OAuthAuthorizationCodeTokenIssuerOperation;
|
|
569
|
+
readonly message: string;
|
|
570
|
+
readonly cause?: unknown;
|
|
571
|
+
}> {
|
|
572
|
+
}
|
|
573
|
+
export interface OAuthAuthorizationCodeTokenIssuerService {
|
|
574
|
+
readonly issue: (input: OAuthAuthorizationCodeTokenIssueInput) => Effect.Effect<OAuthTokenResponse, OAuthAuthorizationCodeTokenIssuerError>;
|
|
575
|
+
}
|
|
576
|
+
declare const OAuthAuthorizationCodeTokenIssuer_base: Context.ServiceClass<OAuthAuthorizationCodeTokenIssuer, "auth/OAuthAuthorizationCodeTokenIssuer", OAuthAuthorizationCodeTokenIssuerService>;
|
|
577
|
+
export declare class OAuthAuthorizationCodeTokenIssuer extends OAuthAuthorizationCodeTokenIssuer_base {
|
|
578
|
+
}
|
|
579
|
+
export declare namespace OAuthAuthorizationCodeTokenIssuer {
|
|
580
|
+
const make: (service: OAuthAuthorizationCodeTokenIssuerService) => OAuthAuthorizationCodeTokenIssuerService;
|
|
581
|
+
}
|
|
582
|
+
export interface OAuthAuthorizationCodeTokenGrantInput {
|
|
583
|
+
readonly grantType: string;
|
|
584
|
+
readonly code?: Redacted.Redacted<OAuthAuthorizationCode | string>;
|
|
585
|
+
readonly clientId?: OAuthClientId | string;
|
|
586
|
+
readonly redirectUri?: string;
|
|
587
|
+
readonly codeVerifier?: Redacted.Redacted<OAuthCodeVerifier | string>;
|
|
588
|
+
readonly clientAuthenticated?: boolean;
|
|
589
|
+
readonly now?: UnixMillis;
|
|
590
|
+
}
|
|
591
|
+
export type OAuthAuthorizationCodeTokenGrantFailureReason = "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type";
|
|
592
|
+
export type OAuthAuthorizationCodeTokenGrantResult = {
|
|
593
|
+
readonly valid: true;
|
|
594
|
+
readonly client: OAuthClientRecord;
|
|
595
|
+
readonly code: OAuthConsumedAuthorizationCode;
|
|
596
|
+
readonly tokens: OAuthTokenResponse;
|
|
597
|
+
} | {
|
|
598
|
+
readonly valid: false;
|
|
599
|
+
readonly reason: OAuthAuthorizationCodeTokenGrantFailureReason;
|
|
600
|
+
};
|
|
601
|
+
export type OAuthAuthorizationCodeTokenGrantOperation = "exchange";
|
|
602
|
+
declare const OAuthAuthorizationCodeTokenGrantError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
603
|
+
readonly _tag: "OAuthAuthorizationCodeTokenGrantError";
|
|
604
|
+
} & Readonly<A>;
|
|
605
|
+
export declare class OAuthAuthorizationCodeTokenGrantError extends OAuthAuthorizationCodeTokenGrantError_base<{
|
|
606
|
+
readonly operation: OAuthAuthorizationCodeTokenGrantOperation;
|
|
607
|
+
readonly message: string;
|
|
608
|
+
readonly cause?: unknown;
|
|
609
|
+
}> {
|
|
610
|
+
}
|
|
611
|
+
export interface OAuthAuthorizationCodeTokenGrantService {
|
|
612
|
+
readonly exchange: (input: OAuthAuthorizationCodeTokenGrantInput) => Effect.Effect<OAuthAuthorizationCodeTokenGrantResult, OAuthAuthorizationCodeTokenGrantError>;
|
|
613
|
+
}
|
|
614
|
+
declare const OAuthAuthorizationCodeTokenGrant_base: Context.ServiceClass<OAuthAuthorizationCodeTokenGrant, "auth/OAuthAuthorizationCodeTokenGrant", OAuthAuthorizationCodeTokenGrantService>;
|
|
615
|
+
export declare class OAuthAuthorizationCodeTokenGrant extends OAuthAuthorizationCodeTokenGrant_base {
|
|
616
|
+
}
|
|
617
|
+
export declare namespace OAuthAuthorizationCodeTokenGrant {
|
|
618
|
+
const make: (service: OAuthAuthorizationCodeTokenGrantService) => OAuthAuthorizationCodeTokenGrantService;
|
|
619
|
+
}
|
|
620
|
+
export interface OAuthRefreshTokenIssueInput {
|
|
621
|
+
readonly client: OAuthClientRecord;
|
|
622
|
+
readonly refreshToken: Redacted.Redacted<OAuthRefreshToken | string>;
|
|
623
|
+
readonly scopes?: readonly string[];
|
|
624
|
+
readonly now: UnixMillis;
|
|
625
|
+
}
|
|
626
|
+
export type OAuthRefreshTokenIssueFailureReason = "invalid_grant" | "invalid_scope";
|
|
627
|
+
export type OAuthRefreshTokenIssueResult = {
|
|
628
|
+
readonly valid: true;
|
|
629
|
+
readonly tokens: OAuthTokenResponse;
|
|
630
|
+
} | {
|
|
631
|
+
readonly valid: false;
|
|
632
|
+
readonly reason: OAuthRefreshTokenIssueFailureReason;
|
|
633
|
+
};
|
|
634
|
+
export type OAuthRefreshTokenIssuerOperation = "issue";
|
|
635
|
+
declare const OAuthRefreshTokenIssuerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
636
|
+
readonly _tag: "OAuthRefreshTokenIssuerError";
|
|
637
|
+
} & Readonly<A>;
|
|
638
|
+
export declare class OAuthRefreshTokenIssuerError extends OAuthRefreshTokenIssuerError_base<{
|
|
639
|
+
readonly operation: OAuthRefreshTokenIssuerOperation;
|
|
640
|
+
readonly message: string;
|
|
641
|
+
readonly cause?: unknown;
|
|
642
|
+
}> {
|
|
643
|
+
}
|
|
644
|
+
export interface OAuthRefreshTokenIssuerService {
|
|
645
|
+
readonly issue: (input: OAuthRefreshTokenIssueInput) => Effect.Effect<OAuthRefreshTokenIssueResult, OAuthRefreshTokenIssuerError>;
|
|
646
|
+
}
|
|
647
|
+
declare const OAuthRefreshTokenIssuer_base: Context.ServiceClass<OAuthRefreshTokenIssuer, "auth/OAuthRefreshTokenIssuer", OAuthRefreshTokenIssuerService>;
|
|
648
|
+
export declare class OAuthRefreshTokenIssuer extends OAuthRefreshTokenIssuer_base {
|
|
649
|
+
}
|
|
650
|
+
export declare namespace OAuthRefreshTokenIssuer {
|
|
651
|
+
const make: (service: OAuthRefreshTokenIssuerService) => OAuthRefreshTokenIssuerService;
|
|
652
|
+
}
|
|
653
|
+
export interface OAuthRefreshTokenGrantInput {
|
|
654
|
+
readonly grantType: string;
|
|
655
|
+
readonly refreshToken?: Redacted.Redacted<OAuthRefreshToken | string>;
|
|
656
|
+
readonly clientId?: OAuthClientId | string;
|
|
657
|
+
readonly scopes?: readonly string[] | string;
|
|
658
|
+
readonly clientAuthenticated?: boolean;
|
|
659
|
+
readonly now?: UnixMillis;
|
|
660
|
+
}
|
|
661
|
+
export type OAuthRefreshTokenGrantFailureReason = "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope";
|
|
662
|
+
export type OAuthRefreshTokenGrantResult = {
|
|
663
|
+
readonly valid: true;
|
|
664
|
+
readonly client: OAuthClientRecord;
|
|
665
|
+
readonly tokens: OAuthTokenResponse;
|
|
666
|
+
} | {
|
|
667
|
+
readonly valid: false;
|
|
668
|
+
readonly reason: OAuthRefreshTokenGrantFailureReason;
|
|
669
|
+
};
|
|
670
|
+
export type OAuthRefreshTokenGrantOperation = "exchange";
|
|
671
|
+
declare const OAuthRefreshTokenGrantError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
672
|
+
readonly _tag: "OAuthRefreshTokenGrantError";
|
|
673
|
+
} & Readonly<A>;
|
|
674
|
+
export declare class OAuthRefreshTokenGrantError extends OAuthRefreshTokenGrantError_base<{
|
|
675
|
+
readonly operation: OAuthRefreshTokenGrantOperation;
|
|
676
|
+
readonly message: string;
|
|
677
|
+
readonly cause?: unknown;
|
|
678
|
+
}> {
|
|
679
|
+
}
|
|
680
|
+
export interface OAuthRefreshTokenGrantService {
|
|
681
|
+
readonly exchange: (input: OAuthRefreshTokenGrantInput) => Effect.Effect<OAuthRefreshTokenGrantResult, OAuthRefreshTokenGrantError>;
|
|
682
|
+
}
|
|
683
|
+
declare const OAuthRefreshTokenGrant_base: Context.ServiceClass<OAuthRefreshTokenGrant, "auth/OAuthRefreshTokenGrant", OAuthRefreshTokenGrantService>;
|
|
684
|
+
export declare class OAuthRefreshTokenGrant extends OAuthRefreshTokenGrant_base {
|
|
685
|
+
}
|
|
686
|
+
export declare namespace OAuthRefreshTokenGrant {
|
|
687
|
+
const make: (service: OAuthRefreshTokenGrantService) => OAuthRefreshTokenGrantService;
|
|
688
|
+
}
|
|
689
|
+
export interface OAuthClientCredentialsTokenIssueInput {
|
|
690
|
+
readonly client: OAuthClientRecord;
|
|
691
|
+
readonly scopes?: readonly string[];
|
|
692
|
+
readonly now: UnixMillis;
|
|
693
|
+
}
|
|
694
|
+
export type OAuthClientCredentialsTokenIssueFailureReason = "invalid_scope";
|
|
695
|
+
export type OAuthClientCredentialsTokenIssueResult = {
|
|
696
|
+
readonly valid: true;
|
|
697
|
+
readonly tokens: OAuthTokenResponse;
|
|
698
|
+
} | {
|
|
699
|
+
readonly valid: false;
|
|
700
|
+
readonly reason: OAuthClientCredentialsTokenIssueFailureReason;
|
|
701
|
+
};
|
|
702
|
+
export type OAuthClientCredentialsTokenIssuerOperation = "issue";
|
|
703
|
+
declare const OAuthClientCredentialsTokenIssuerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
704
|
+
readonly _tag: "OAuthClientCredentialsTokenIssuerError";
|
|
705
|
+
} & Readonly<A>;
|
|
706
|
+
export declare class OAuthClientCredentialsTokenIssuerError extends OAuthClientCredentialsTokenIssuerError_base<{
|
|
707
|
+
readonly operation: OAuthClientCredentialsTokenIssuerOperation;
|
|
708
|
+
readonly message: string;
|
|
709
|
+
readonly cause?: unknown;
|
|
710
|
+
}> {
|
|
711
|
+
}
|
|
712
|
+
export interface OAuthClientCredentialsTokenIssuerService {
|
|
713
|
+
readonly issue: (input: OAuthClientCredentialsTokenIssueInput) => Effect.Effect<OAuthClientCredentialsTokenIssueResult, OAuthClientCredentialsTokenIssuerError>;
|
|
714
|
+
}
|
|
715
|
+
declare const OAuthClientCredentialsTokenIssuer_base: Context.ServiceClass<OAuthClientCredentialsTokenIssuer, "auth/OAuthClientCredentialsTokenIssuer", OAuthClientCredentialsTokenIssuerService>;
|
|
716
|
+
export declare class OAuthClientCredentialsTokenIssuer extends OAuthClientCredentialsTokenIssuer_base {
|
|
717
|
+
}
|
|
718
|
+
export declare namespace OAuthClientCredentialsTokenIssuer {
|
|
719
|
+
const make: (service: OAuthClientCredentialsTokenIssuerService) => OAuthClientCredentialsTokenIssuerService;
|
|
720
|
+
}
|
|
721
|
+
export interface OAuthClientCredentialsGrantInput {
|
|
722
|
+
readonly grantType: string;
|
|
723
|
+
readonly clientId?: OAuthClientId | string;
|
|
724
|
+
readonly scopes?: readonly string[] | string;
|
|
725
|
+
readonly clientAuthenticated?: boolean;
|
|
726
|
+
readonly now?: UnixMillis;
|
|
727
|
+
}
|
|
728
|
+
export type OAuthClientCredentialsGrantFailureReason = "invalid_request" | "invalid_client" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope";
|
|
729
|
+
export type OAuthClientCredentialsGrantResult = {
|
|
730
|
+
readonly valid: true;
|
|
731
|
+
readonly client: OAuthClientRecord;
|
|
732
|
+
readonly tokens: OAuthTokenResponse;
|
|
733
|
+
} | {
|
|
734
|
+
readonly valid: false;
|
|
735
|
+
readonly reason: OAuthClientCredentialsGrantFailureReason;
|
|
736
|
+
};
|
|
737
|
+
export type OAuthClientCredentialsGrantOperation = "exchange";
|
|
738
|
+
declare const OAuthClientCredentialsGrantError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
739
|
+
readonly _tag: "OAuthClientCredentialsGrantError";
|
|
740
|
+
} & Readonly<A>;
|
|
741
|
+
export declare class OAuthClientCredentialsGrantError extends OAuthClientCredentialsGrantError_base<{
|
|
742
|
+
readonly operation: OAuthClientCredentialsGrantOperation;
|
|
743
|
+
readonly message: string;
|
|
744
|
+
readonly cause?: unknown;
|
|
745
|
+
}> {
|
|
746
|
+
}
|
|
747
|
+
export interface OAuthClientCredentialsGrantService {
|
|
748
|
+
readonly exchange: (input: OAuthClientCredentialsGrantInput) => Effect.Effect<OAuthClientCredentialsGrantResult, OAuthClientCredentialsGrantError>;
|
|
749
|
+
}
|
|
750
|
+
declare const OAuthClientCredentialsGrant_base: Context.ServiceClass<OAuthClientCredentialsGrant, "auth/OAuthClientCredentialsGrant", OAuthClientCredentialsGrantService>;
|
|
751
|
+
export declare class OAuthClientCredentialsGrant extends OAuthClientCredentialsGrant_base {
|
|
752
|
+
}
|
|
753
|
+
export declare namespace OAuthClientCredentialsGrant {
|
|
754
|
+
const make: (service: OAuthClientCredentialsGrantService) => OAuthClientCredentialsGrantService;
|
|
755
|
+
}
|
|
756
|
+
export interface OAuthTokenRevokeInput {
|
|
757
|
+
readonly client: OAuthClientRecord;
|
|
758
|
+
readonly token: Redacted.Redacted<OAuthAccessToken | OAuthRefreshToken | string>;
|
|
759
|
+
readonly tokenTypeHint?: OAuthTokenRevocationHint;
|
|
760
|
+
readonly now: UnixMillis;
|
|
761
|
+
}
|
|
762
|
+
export type OAuthTokenRevokerOperation = "revoke";
|
|
763
|
+
declare const OAuthTokenRevokerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
764
|
+
readonly _tag: "OAuthTokenRevokerError";
|
|
765
|
+
} & Readonly<A>;
|
|
766
|
+
export declare class OAuthTokenRevokerError extends OAuthTokenRevokerError_base<{
|
|
767
|
+
readonly operation: OAuthTokenRevokerOperation;
|
|
768
|
+
readonly message: string;
|
|
769
|
+
readonly cause?: unknown;
|
|
770
|
+
}> {
|
|
771
|
+
}
|
|
772
|
+
export interface OAuthTokenRevokerService {
|
|
773
|
+
readonly revoke: (input: OAuthTokenRevokeInput) => Effect.Effect<void, OAuthTokenRevokerError>;
|
|
774
|
+
}
|
|
775
|
+
declare const OAuthTokenRevoker_base: Context.ServiceClass<OAuthTokenRevoker, "auth/OAuthTokenRevoker", OAuthTokenRevokerService>;
|
|
776
|
+
export declare class OAuthTokenRevoker extends OAuthTokenRevoker_base {
|
|
777
|
+
}
|
|
778
|
+
export declare namespace OAuthTokenRevoker {
|
|
779
|
+
const make: (service: OAuthTokenRevokerService) => OAuthTokenRevokerService;
|
|
780
|
+
}
|
|
781
|
+
export interface OAuthTokenRevocationRequestInput {
|
|
782
|
+
readonly token?: Redacted.Redacted<OAuthAccessToken | OAuthRefreshToken | string>;
|
|
783
|
+
readonly tokenTypeHint?: OAuthTokenRevocationHint | string;
|
|
784
|
+
readonly clientId?: OAuthClientId | string;
|
|
785
|
+
readonly clientAuthenticated?: boolean;
|
|
786
|
+
readonly now?: UnixMillis;
|
|
787
|
+
}
|
|
788
|
+
export type OAuthTokenRevocationFailureReason = "invalid_request" | "invalid_client" | "unsupported_token_type";
|
|
789
|
+
export type OAuthTokenRevocationResult = {
|
|
790
|
+
readonly valid: true;
|
|
791
|
+
readonly client: OAuthClientRecord;
|
|
792
|
+
} | {
|
|
793
|
+
readonly valid: false;
|
|
794
|
+
readonly reason: OAuthTokenRevocationFailureReason;
|
|
795
|
+
};
|
|
796
|
+
export type OAuthTokenRevocationOperation = "revoke";
|
|
797
|
+
declare const OAuthTokenRevocationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
798
|
+
readonly _tag: "OAuthTokenRevocationError";
|
|
799
|
+
} & Readonly<A>;
|
|
800
|
+
export declare class OAuthTokenRevocationError extends OAuthTokenRevocationError_base<{
|
|
801
|
+
readonly operation: OAuthTokenRevocationOperation;
|
|
802
|
+
readonly message: string;
|
|
803
|
+
readonly cause?: unknown;
|
|
804
|
+
}> {
|
|
805
|
+
}
|
|
806
|
+
export interface OAuthTokenRevocationService {
|
|
807
|
+
readonly revoke: (input: OAuthTokenRevocationRequestInput) => Effect.Effect<OAuthTokenRevocationResult, OAuthTokenRevocationError>;
|
|
808
|
+
}
|
|
809
|
+
declare const OAuthTokenRevocation_base: Context.ServiceClass<OAuthTokenRevocation, "auth/OAuthTokenRevocation", OAuthTokenRevocationService>;
|
|
810
|
+
export declare class OAuthTokenRevocation extends OAuthTokenRevocation_base {
|
|
811
|
+
}
|
|
812
|
+
export declare namespace OAuthTokenRevocation {
|
|
813
|
+
const make: (service: OAuthTokenRevocationService) => OAuthTokenRevocationService;
|
|
814
|
+
}
|
|
815
|
+
export interface OAuthTokenIntrospectInput {
|
|
816
|
+
readonly client: OAuthClientRecord;
|
|
817
|
+
readonly token: Redacted.Redacted<OAuthAccessToken | OAuthRefreshToken | string>;
|
|
818
|
+
readonly tokenTypeHint?: string;
|
|
819
|
+
readonly now: UnixMillis;
|
|
820
|
+
}
|
|
821
|
+
export type OAuthTokenIntrospectionResponse = {
|
|
822
|
+
readonly active: false;
|
|
823
|
+
} | {
|
|
824
|
+
readonly active: true;
|
|
825
|
+
readonly scopes?: readonly string[];
|
|
826
|
+
readonly clientId?: OAuthClientId | string;
|
|
827
|
+
readonly username?: string;
|
|
828
|
+
readonly tokenType?: string;
|
|
829
|
+
readonly expiresAt?: UnixMillis;
|
|
830
|
+
readonly issuedAt?: UnixMillis;
|
|
831
|
+
readonly notBefore?: UnixMillis;
|
|
832
|
+
readonly subject?: string;
|
|
833
|
+
readonly audience?: string | readonly string[];
|
|
834
|
+
readonly issuer?: string;
|
|
835
|
+
readonly jwtId?: string;
|
|
836
|
+
readonly extra?: Readonly<Record<string, unknown>>;
|
|
837
|
+
};
|
|
838
|
+
export type OAuthTokenIntrospectorOperation = "introspect";
|
|
839
|
+
declare const OAuthTokenIntrospectorError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
840
|
+
readonly _tag: "OAuthTokenIntrospectorError";
|
|
841
|
+
} & Readonly<A>;
|
|
842
|
+
export declare class OAuthTokenIntrospectorError extends OAuthTokenIntrospectorError_base<{
|
|
843
|
+
readonly operation: OAuthTokenIntrospectorOperation;
|
|
844
|
+
readonly message: string;
|
|
845
|
+
readonly cause?: unknown;
|
|
846
|
+
}> {
|
|
847
|
+
}
|
|
848
|
+
export interface OAuthTokenIntrospectorService {
|
|
849
|
+
readonly introspect: (input: OAuthTokenIntrospectInput) => Effect.Effect<OAuthTokenIntrospectionResponse, OAuthTokenIntrospectorError>;
|
|
850
|
+
}
|
|
851
|
+
declare const OAuthTokenIntrospector_base: Context.ServiceClass<OAuthTokenIntrospector, "auth/OAuthTokenIntrospector", OAuthTokenIntrospectorService>;
|
|
852
|
+
export declare class OAuthTokenIntrospector extends OAuthTokenIntrospector_base {
|
|
853
|
+
}
|
|
854
|
+
export declare namespace OAuthTokenIntrospector {
|
|
855
|
+
const make: (service: OAuthTokenIntrospectorService) => OAuthTokenIntrospectorService;
|
|
856
|
+
}
|
|
857
|
+
export interface OAuthTokenIntrospectionRequestInput {
|
|
858
|
+
readonly token?: Redacted.Redacted<OAuthAccessToken | OAuthRefreshToken | string>;
|
|
859
|
+
readonly tokenTypeHint?: string;
|
|
860
|
+
readonly clientId?: OAuthClientId | string;
|
|
861
|
+
readonly clientAuthenticated?: boolean;
|
|
862
|
+
readonly now?: UnixMillis;
|
|
863
|
+
}
|
|
864
|
+
export type OAuthTokenIntrospectionFailureReason = "invalid_request" | "invalid_client";
|
|
865
|
+
export type OAuthTokenIntrospectionResult = {
|
|
866
|
+
readonly valid: true;
|
|
867
|
+
readonly client: OAuthClientRecord;
|
|
868
|
+
readonly introspection: OAuthTokenIntrospectionResponse;
|
|
869
|
+
} | {
|
|
870
|
+
readonly valid: false;
|
|
871
|
+
readonly reason: OAuthTokenIntrospectionFailureReason;
|
|
872
|
+
};
|
|
873
|
+
export type OAuthTokenIntrospectionOperation = "introspect";
|
|
874
|
+
declare const OAuthTokenIntrospectionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
875
|
+
readonly _tag: "OAuthTokenIntrospectionError";
|
|
876
|
+
} & Readonly<A>;
|
|
877
|
+
export declare class OAuthTokenIntrospectionError extends OAuthTokenIntrospectionError_base<{
|
|
878
|
+
readonly operation: OAuthTokenIntrospectionOperation;
|
|
879
|
+
readonly message: string;
|
|
880
|
+
readonly cause?: unknown;
|
|
881
|
+
}> {
|
|
882
|
+
}
|
|
883
|
+
export interface OAuthTokenIntrospectionService {
|
|
884
|
+
readonly introspect: (input: OAuthTokenIntrospectionRequestInput) => Effect.Effect<OAuthTokenIntrospectionResult, OAuthTokenIntrospectionError>;
|
|
885
|
+
}
|
|
886
|
+
declare const OAuthTokenIntrospection_base: Context.ServiceClass<OAuthTokenIntrospection, "auth/OAuthTokenIntrospection", OAuthTokenIntrospectionService>;
|
|
887
|
+
export declare class OAuthTokenIntrospection extends OAuthTokenIntrospection_base {
|
|
888
|
+
}
|
|
889
|
+
export declare namespace OAuthTokenIntrospection {
|
|
890
|
+
const make: (service: OAuthTokenIntrospectionService) => OAuthTokenIntrospectionService;
|
|
891
|
+
}
|
|
892
|
+
export interface OAuthProviderAuthorizationInput {
|
|
893
|
+
readonly responseType: string;
|
|
894
|
+
readonly clientId?: OAuthClientId | string;
|
|
895
|
+
readonly redirectUri?: string;
|
|
896
|
+
readonly scopes?: readonly string[] | string;
|
|
897
|
+
readonly state?: string;
|
|
898
|
+
readonly codeChallenge?: OAuthCodeChallenge | string;
|
|
899
|
+
readonly codeChallengeMethod?: string;
|
|
900
|
+
readonly now?: UnixMillis;
|
|
901
|
+
}
|
|
902
|
+
export type OAuthProviderAuthorizationFailureReason = "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "login_required" | "consent_required";
|
|
903
|
+
export interface OAuthProviderAuthorizationPolicyInput {
|
|
904
|
+
readonly client: OAuthClientRecord;
|
|
905
|
+
readonly requestedScopes: readonly string[];
|
|
906
|
+
readonly state?: string;
|
|
907
|
+
readonly request: OAuthProviderAuthorizationInput;
|
|
908
|
+
}
|
|
909
|
+
export type OAuthProviderAuthorizationDecision = {
|
|
910
|
+
readonly type: "allow";
|
|
911
|
+
readonly subject: string;
|
|
912
|
+
readonly scopes?: readonly string[];
|
|
913
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
914
|
+
} | {
|
|
915
|
+
readonly type: "deny";
|
|
916
|
+
readonly reason: OAuthProviderAuthorizationFailureReason;
|
|
917
|
+
readonly errorDescription?: string;
|
|
918
|
+
};
|
|
919
|
+
export type OAuthProviderAuthorizationPolicyOperation = "decide";
|
|
920
|
+
declare const OAuthProviderAuthorizationPolicyError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
921
|
+
readonly _tag: "OAuthProviderAuthorizationPolicyError";
|
|
922
|
+
} & Readonly<A>;
|
|
923
|
+
export declare class OAuthProviderAuthorizationPolicyError extends OAuthProviderAuthorizationPolicyError_base<{
|
|
924
|
+
readonly operation: OAuthProviderAuthorizationPolicyOperation;
|
|
925
|
+
readonly message: string;
|
|
926
|
+
readonly cause?: unknown;
|
|
927
|
+
}> {
|
|
928
|
+
}
|
|
929
|
+
export interface OAuthProviderAuthorizationPolicyService {
|
|
930
|
+
readonly decide: (input: OAuthProviderAuthorizationPolicyInput) => Effect.Effect<OAuthProviderAuthorizationDecision, OAuthProviderAuthorizationPolicyError>;
|
|
931
|
+
}
|
|
932
|
+
declare const OAuthProviderAuthorizationPolicy_base: Context.ServiceClass<OAuthProviderAuthorizationPolicy, "auth/OAuthProviderAuthorizationPolicy", OAuthProviderAuthorizationPolicyService>;
|
|
933
|
+
export declare class OAuthProviderAuthorizationPolicy extends OAuthProviderAuthorizationPolicy_base {
|
|
934
|
+
}
|
|
935
|
+
export declare namespace OAuthProviderAuthorizationPolicy {
|
|
936
|
+
const make: (service: OAuthProviderAuthorizationPolicyService) => OAuthProviderAuthorizationPolicyService;
|
|
937
|
+
}
|
|
938
|
+
export type OAuthProviderAuthorizationResult = {
|
|
939
|
+
readonly valid: true;
|
|
940
|
+
readonly client: OAuthClientRecord;
|
|
941
|
+
readonly redirectUri: string;
|
|
942
|
+
readonly state?: string;
|
|
943
|
+
readonly code: OAuthIssuedAuthorizationCode;
|
|
944
|
+
} | {
|
|
945
|
+
readonly valid: false;
|
|
946
|
+
readonly reason: OAuthProviderAuthorizationFailureReason;
|
|
947
|
+
readonly redirectUri?: string;
|
|
948
|
+
readonly state?: string;
|
|
949
|
+
readonly client?: OAuthClientRecord;
|
|
950
|
+
readonly errorDescription?: string;
|
|
951
|
+
};
|
|
952
|
+
export type OAuthProviderAuthorizationOperation = "authorize";
|
|
953
|
+
declare const OAuthProviderAuthorizationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
954
|
+
readonly _tag: "OAuthProviderAuthorizationError";
|
|
955
|
+
} & Readonly<A>;
|
|
956
|
+
export declare class OAuthProviderAuthorizationError extends OAuthProviderAuthorizationError_base<{
|
|
957
|
+
readonly operation: OAuthProviderAuthorizationOperation;
|
|
958
|
+
readonly message: string;
|
|
959
|
+
readonly cause?: unknown;
|
|
960
|
+
}> {
|
|
961
|
+
}
|
|
962
|
+
export interface OAuthProviderAuthorizationService {
|
|
963
|
+
readonly authorize: (input: OAuthProviderAuthorizationInput) => Effect.Effect<OAuthProviderAuthorizationResult, OAuthProviderAuthorizationError>;
|
|
964
|
+
}
|
|
965
|
+
declare const OAuthProviderAuthorization_base: Context.ServiceClass<OAuthProviderAuthorization, "auth/OAuthProviderAuthorization", OAuthProviderAuthorizationService>;
|
|
966
|
+
export declare class OAuthProviderAuthorization extends OAuthProviderAuthorization_base {
|
|
967
|
+
}
|
|
968
|
+
export declare namespace OAuthProviderAuthorization {
|
|
969
|
+
const make: (service: OAuthProviderAuthorizationService) => OAuthProviderAuthorizationService;
|
|
970
|
+
}
|
|
172
971
|
export type OAuthClientAuthentication = {
|
|
173
972
|
readonly method: "none";
|
|
174
973
|
} | {
|
|
@@ -238,6 +1037,71 @@ export interface OAuthTokenResponse {
|
|
|
238
1037
|
readonly scopes?: readonly string[];
|
|
239
1038
|
readonly extra?: Readonly<Record<string, unknown>>;
|
|
240
1039
|
}
|
|
1040
|
+
export type OAuthProviderModeTokenType = "access_token" | "refresh_token";
|
|
1041
|
+
export interface OAuthProviderModeTokenRecord {
|
|
1042
|
+
readonly tokenHash: string;
|
|
1043
|
+
readonly tokenType: OAuthProviderModeTokenType;
|
|
1044
|
+
readonly clientId: OAuthClientId;
|
|
1045
|
+
readonly subject: string;
|
|
1046
|
+
readonly scopes: readonly string[];
|
|
1047
|
+
readonly issuedAt: UnixMillis;
|
|
1048
|
+
readonly expiresAt: UnixMillis;
|
|
1049
|
+
readonly issuer?: string;
|
|
1050
|
+
readonly audience?: string | readonly string[];
|
|
1051
|
+
readonly jwtId?: string;
|
|
1052
|
+
readonly revokedAt?: UnixMillis;
|
|
1053
|
+
readonly revocationReason?: string;
|
|
1054
|
+
readonly rotatedAt?: UnixMillis;
|
|
1055
|
+
readonly replacedByTokenHash?: string;
|
|
1056
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1057
|
+
}
|
|
1058
|
+
export interface OAuthProviderModeTokenStoreLookupInput {
|
|
1059
|
+
readonly tokenHash: string;
|
|
1060
|
+
}
|
|
1061
|
+
export interface OAuthProviderModeTokenStoreRevokeInput extends OAuthProviderModeTokenStoreLookupInput {
|
|
1062
|
+
readonly tokenTypeHint?: OAuthProviderModeTokenType;
|
|
1063
|
+
readonly revokedAt: UnixMillis;
|
|
1064
|
+
readonly reason?: string;
|
|
1065
|
+
}
|
|
1066
|
+
export interface OAuthProviderModeTokenStoreRotateInput extends OAuthProviderModeTokenStoreLookupInput {
|
|
1067
|
+
readonly replacedByTokenHash: string;
|
|
1068
|
+
readonly rotatedAt: UnixMillis;
|
|
1069
|
+
}
|
|
1070
|
+
export interface OAuthProviderModeTokenStoreDeleteRetiredCutoffs {
|
|
1071
|
+
readonly beforeExpiresAt?: UnixMillis;
|
|
1072
|
+
readonly beforeRevokedAt?: UnixMillis;
|
|
1073
|
+
readonly beforeRotatedAt?: UnixMillis;
|
|
1074
|
+
}
|
|
1075
|
+
export type OAuthProviderModeTokenStoreDeleteRetiredInput = (OAuthProviderModeTokenStoreDeleteRetiredCutoffs & {
|
|
1076
|
+
readonly beforeExpiresAt: UnixMillis;
|
|
1077
|
+
}) | (OAuthProviderModeTokenStoreDeleteRetiredCutoffs & {
|
|
1078
|
+
readonly beforeRevokedAt: UnixMillis;
|
|
1079
|
+
}) | (OAuthProviderModeTokenStoreDeleteRetiredCutoffs & {
|
|
1080
|
+
readonly beforeRotatedAt: UnixMillis;
|
|
1081
|
+
});
|
|
1082
|
+
export type OAuthProviderModeTokenStoreOperation = "upsert" | "find" | "revoke" | "rotate" | "deleteRetired";
|
|
1083
|
+
declare const OAuthProviderModeTokenStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1084
|
+
readonly _tag: "OAuthProviderModeTokenStoreError";
|
|
1085
|
+
} & Readonly<A>;
|
|
1086
|
+
export declare class OAuthProviderModeTokenStoreError extends OAuthProviderModeTokenStoreError_base<{
|
|
1087
|
+
readonly operation: OAuthProviderModeTokenStoreOperation;
|
|
1088
|
+
readonly message: string;
|
|
1089
|
+
readonly cause?: unknown;
|
|
1090
|
+
}> {
|
|
1091
|
+
}
|
|
1092
|
+
export interface OAuthProviderModeTokenStoreService {
|
|
1093
|
+
readonly upsert: (record: OAuthProviderModeTokenRecord) => Effect.Effect<void, OAuthProviderModeTokenStoreError>;
|
|
1094
|
+
readonly findByHash: (input: OAuthProviderModeTokenStoreLookupInput) => Effect.Effect<OptionTypes.Option<OAuthProviderModeTokenRecord>, OAuthProviderModeTokenStoreError>;
|
|
1095
|
+
readonly revokeByHash: (input: OAuthProviderModeTokenStoreRevokeInput) => Effect.Effect<OptionTypes.Option<OAuthProviderModeTokenRecord>, OAuthProviderModeTokenStoreError>;
|
|
1096
|
+
readonly rotateRefreshToken: (input: OAuthProviderModeTokenStoreRotateInput) => Effect.Effect<OptionTypes.Option<OAuthProviderModeTokenRecord>, OAuthProviderModeTokenStoreError>;
|
|
1097
|
+
readonly deleteRetired: (input: OAuthProviderModeTokenStoreDeleteRetiredInput) => Effect.Effect<number, OAuthProviderModeTokenStoreError>;
|
|
1098
|
+
}
|
|
1099
|
+
declare const OAuthProviderModeTokenStore_base: Context.ServiceClass<OAuthProviderModeTokenStore, "auth/OAuthProviderModeTokenStore", OAuthProviderModeTokenStoreService>;
|
|
1100
|
+
export declare class OAuthProviderModeTokenStore extends OAuthProviderModeTokenStore_base {
|
|
1101
|
+
}
|
|
1102
|
+
export declare namespace OAuthProviderModeTokenStore {
|
|
1103
|
+
const make: (service: OAuthProviderModeTokenStoreService) => OAuthProviderModeTokenStoreService;
|
|
1104
|
+
}
|
|
241
1105
|
export interface OAuthProviderTokenVaultRecord {
|
|
242
1106
|
readonly accountId: OAuthAccountId;
|
|
243
1107
|
readonly userId: UserId;
|
|
@@ -861,6 +1725,57 @@ export interface OAuthStateDependencies {
|
|
|
861
1725
|
readonly codeVerifierBytes?: number;
|
|
862
1726
|
readonly nonceBytes?: number;
|
|
863
1727
|
}
|
|
1728
|
+
export interface OAuthAuthorizationCodeGrantDependencies {
|
|
1729
|
+
readonly crypto: CryptoService;
|
|
1730
|
+
readonly store: OAuthAuthorizationCodeStoreService;
|
|
1731
|
+
readonly codeBytes?: number;
|
|
1732
|
+
readonly codeTtl?: Duration.Duration;
|
|
1733
|
+
}
|
|
1734
|
+
export interface OAuthAuthorizationCodeTokenGrantDependencies {
|
|
1735
|
+
readonly clients: OAuthClientRegistryService;
|
|
1736
|
+
readonly authorizationCodes: OAuthAuthorizationCodeGrantService;
|
|
1737
|
+
readonly issuer: OAuthAuthorizationCodeTokenIssuerService;
|
|
1738
|
+
}
|
|
1739
|
+
export interface OAuthRefreshTokenGrantDependencies {
|
|
1740
|
+
readonly clients: OAuthClientRegistryService;
|
|
1741
|
+
readonly issuer: OAuthRefreshTokenIssuerService;
|
|
1742
|
+
}
|
|
1743
|
+
export interface OAuthClientCredentialsGrantDependencies {
|
|
1744
|
+
readonly clients: OAuthClientRegistryService;
|
|
1745
|
+
readonly issuer: OAuthClientCredentialsTokenIssuerService;
|
|
1746
|
+
}
|
|
1747
|
+
export interface OAuthProviderModeOpaqueTokenIssuerDependencies {
|
|
1748
|
+
readonly crypto: CryptoService;
|
|
1749
|
+
readonly tokenStore: OAuthProviderModeTokenStoreService;
|
|
1750
|
+
readonly accessTokenBytes?: number;
|
|
1751
|
+
readonly refreshTokenBytes?: number;
|
|
1752
|
+
readonly accessTokenTtl?: Duration.Duration;
|
|
1753
|
+
readonly refreshTokenTtl?: Duration.Duration;
|
|
1754
|
+
readonly issuer?: string;
|
|
1755
|
+
readonly audience?: string | readonly string[];
|
|
1756
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
1757
|
+
readonly clientCredentialsSubject?: (input: OAuthClientCredentialsTokenIssueInput) => string;
|
|
1758
|
+
}
|
|
1759
|
+
export interface OAuthProviderModeOpaqueTokenIssuerServices {
|
|
1760
|
+
readonly authorizationCode: OAuthAuthorizationCodeTokenIssuerService;
|
|
1761
|
+
readonly refreshToken: OAuthRefreshTokenIssuerService;
|
|
1762
|
+
readonly clientCredentials: OAuthClientCredentialsTokenIssuerService;
|
|
1763
|
+
}
|
|
1764
|
+
export type OAuthProviderModeOpaqueTokenIssuerLiveOptions = Omit<OAuthProviderModeOpaqueTokenIssuerDependencies, "crypto" | "tokenStore">;
|
|
1765
|
+
export interface OAuthTokenRevocationDependencies {
|
|
1766
|
+
readonly clients: OAuthClientRegistryService;
|
|
1767
|
+
readonly revoker: OAuthTokenRevokerService;
|
|
1768
|
+
}
|
|
1769
|
+
export interface OAuthTokenIntrospectionDependencies {
|
|
1770
|
+
readonly clients: OAuthClientRegistryService;
|
|
1771
|
+
readonly introspector: OAuthTokenIntrospectorService;
|
|
1772
|
+
}
|
|
1773
|
+
export interface OAuthProviderAuthorizationDependencies {
|
|
1774
|
+
readonly clients: OAuthClientRegistryService;
|
|
1775
|
+
readonly authorizationCodes: OAuthAuthorizationCodeGrantService;
|
|
1776
|
+
readonly policy: OAuthProviderAuthorizationPolicyService;
|
|
1777
|
+
}
|
|
1778
|
+
export declare const makeOAuthClientSecrets: (dependencies: OAuthClientSecretsDependencies) => OAuthClientSecretsService;
|
|
864
1779
|
export declare const makeAppleSignInProvider: (input: AppleSignInProviderOptions) => OAuthProviderConfig;
|
|
865
1780
|
export declare const makeGithubOAuthProvider: (input: GithubOAuthProviderOptions) => OAuthProviderConfig;
|
|
866
1781
|
export declare const makeGoogleOidcProvider: (input: GoogleOidcProviderOptions) => OAuthProviderConfig;
|
|
@@ -916,11 +1831,52 @@ export declare const makeOAuthLinkConfirmation: (dependencies: OAuthLinkConfirma
|
|
|
916
1831
|
export declare const startOAuthLinkConfirmation: (input: OAuthLinkConfirmationStartInput) => Effect.Effect<StartedOAuthLinkConfirmation, OAuthLinkConfirmationError, OAuthLinkConfirmation>;
|
|
917
1832
|
export declare const inspectOAuthLinkConfirmation: (input: OAuthLinkConfirmationInspectInput) => Effect.Effect<PendingOAuthLinkConfirmation, OAuthLinkConfirmationError, OAuthLinkConfirmation>;
|
|
918
1833
|
export declare const confirmOAuthLinkConfirmation: (input: OAuthLinkConfirmationConfirmInput) => Effect.Effect<ConfirmedOAuthLinkConfirmation, OAuthLinkConfirmationError, OAuthLinkConfirmation>;
|
|
1834
|
+
export declare const makeOAuthAuthorizationCodeGrant: (dependencies: OAuthAuthorizationCodeGrantDependencies) => OAuthAuthorizationCodeGrantService;
|
|
1835
|
+
export declare const makeOAuthAuthorizationCodeTokenGrant: (dependencies: OAuthAuthorizationCodeTokenGrantDependencies) => OAuthAuthorizationCodeTokenGrantService;
|
|
1836
|
+
export declare const makeOAuthRefreshTokenGrant: (dependencies: OAuthRefreshTokenGrantDependencies) => OAuthRefreshTokenGrantService;
|
|
1837
|
+
export declare const makeOAuthClientCredentialsGrant: (dependencies: OAuthClientCredentialsGrantDependencies) => OAuthClientCredentialsGrantService;
|
|
1838
|
+
export declare const makeOAuthProviderModeOpaqueTokenIssuer: (dependencies: OAuthProviderModeOpaqueTokenIssuerDependencies) => OAuthProviderModeOpaqueTokenIssuerServices;
|
|
1839
|
+
export declare const makeOAuthClientSecretVerification: (dependencies: OAuthClientSecretVerificationDependencies) => OAuthClientSecretVerificationService;
|
|
1840
|
+
export declare const makeOAuthTokenRevocation: (dependencies: OAuthTokenRevocationDependencies) => OAuthTokenRevocationService;
|
|
1841
|
+
export declare const makeOAuthTokenIntrospection: (dependencies: OAuthTokenIntrospectionDependencies) => OAuthTokenIntrospectionService;
|
|
1842
|
+
export declare const makeOAuthProviderAuthorization: (dependencies: OAuthProviderAuthorizationDependencies) => OAuthProviderAuthorizationService;
|
|
1843
|
+
export declare const issueOAuthAuthorizationCode: (input: OAuthAuthorizationCodeIssueInput) => Effect.Effect<OAuthIssuedAuthorizationCode, OAuthAuthorizationCodeGrantError, OAuthAuthorizationCodeGrant>;
|
|
1844
|
+
export declare const consumeOAuthAuthorizationCode: (input: OAuthAuthorizationCodeConsumeInput) => Effect.Effect<OAuthAuthorizationCodeConsumeResult, OAuthAuthorizationCodeGrantError, OAuthAuthorizationCodeGrant>;
|
|
1845
|
+
export declare const exchangeOAuthAuthorizationCodeToken: (input: OAuthAuthorizationCodeTokenGrantInput) => Effect.Effect<OAuthAuthorizationCodeTokenGrantResult, OAuthAuthorizationCodeTokenGrantError, OAuthAuthorizationCodeTokenGrant>;
|
|
1846
|
+
export declare const exchangeOAuthRefreshToken: (input: OAuthRefreshTokenGrantInput) => Effect.Effect<OAuthRefreshTokenGrantResult, OAuthRefreshTokenGrantError, OAuthRefreshTokenGrant>;
|
|
1847
|
+
export declare const exchangeOAuthClientCredentialsToken: (input: OAuthClientCredentialsGrantInput) => Effect.Effect<OAuthClientCredentialsGrantResult, OAuthClientCredentialsGrantError, OAuthClientCredentialsGrant>;
|
|
1848
|
+
export declare const revokeOAuthToken: (input: OAuthTokenRevocationRequestInput) => Effect.Effect<OAuthTokenRevocationResult, OAuthTokenRevocationError, OAuthTokenRevocation>;
|
|
1849
|
+
export declare const introspectOAuthToken: (input: OAuthTokenIntrospectionRequestInput) => Effect.Effect<OAuthTokenIntrospectionResult, OAuthTokenIntrospectionError, OAuthTokenIntrospection>;
|
|
1850
|
+
export declare const authorizeOAuthProviderAuthorization: (input: OAuthProviderAuthorizationInput) => Effect.Effect<OAuthProviderAuthorizationResult, OAuthProviderAuthorizationError, OAuthProviderAuthorization>;
|
|
919
1851
|
export declare const makeOAuthPkce: (input?: OAuthPkceInput) => Effect.Effect<OAuthPkce, OAuthStateError, Crypto>;
|
|
920
1852
|
export declare const makeOAuthState: (dependencies: OAuthStateDependencies) => OAuthStateService;
|
|
921
1853
|
export declare const OAuthStateLive: Layer.Layer<OAuthState, never, Crypto | Challenge>;
|
|
1854
|
+
export declare const OAuthAuthorizationCodeGrantLive: Layer.Layer<OAuthAuthorizationCodeGrant, never, Crypto | OAuthAuthorizationCodeStore>;
|
|
1855
|
+
export declare const OAuthAuthorizationCodeTokenGrantLive: Layer.Layer<OAuthAuthorizationCodeTokenGrant, never, OAuthClientRegistry | OAuthAuthorizationCodeGrant | OAuthAuthorizationCodeTokenIssuer>;
|
|
1856
|
+
export declare const OAuthRefreshTokenGrantLive: Layer.Layer<OAuthRefreshTokenGrant, never, OAuthClientRegistry | OAuthRefreshTokenIssuer>;
|
|
1857
|
+
export declare const OAuthClientCredentialsGrantLive: Layer.Layer<OAuthClientCredentialsGrant, never, OAuthClientRegistry | OAuthClientCredentialsTokenIssuer>;
|
|
1858
|
+
export declare const OAuthProviderModeOpaqueTokenIssuerLive: (options?: OAuthProviderModeOpaqueTokenIssuerLiveOptions) => Layer.Layer<OAuthAuthorizationCodeTokenIssuer | OAuthRefreshTokenIssuer | OAuthClientCredentialsTokenIssuer, never, Crypto | OAuthProviderModeTokenStore>;
|
|
1859
|
+
export declare const OAuthTokenRevocationLive: Layer.Layer<OAuthTokenRevocation, never, OAuthClientRegistry | OAuthTokenRevoker>;
|
|
1860
|
+
export declare const OAuthTokenIntrospectionLive: Layer.Layer<OAuthTokenIntrospection, never, OAuthClientRegistry | OAuthTokenIntrospector>;
|
|
1861
|
+
export declare const OAuthProviderAuthorizationLive: Layer.Layer<OAuthProviderAuthorization, never, OAuthClientRegistry | OAuthAuthorizationCodeGrant | OAuthProviderAuthorizationPolicy>;
|
|
922
1862
|
export declare const makeOAuthProviders: (providers: readonly OAuthProviderConfig[]) => OAuthProvidersService;
|
|
923
1863
|
export declare const OAuthProvidersLive: (providers: readonly OAuthProviderConfig[]) => Layer.Layer<OAuthProviders, never, never>;
|
|
1864
|
+
export declare const OAuthClientSecretsLive: Layer.Layer<OAuthClientSecrets, never, Crypto>;
|
|
1865
|
+
export declare const OAuthClientSecretVerificationLive: Layer.Layer<OAuthClientSecretVerification, never, OAuthClientSecrets | OAuthClientSecretStore>;
|
|
1866
|
+
export declare const makeOAuthClientRegistryFromStore: (store: OAuthClientStoreService) => OAuthClientRegistryService;
|
|
1867
|
+
export declare const OAuthClientRegistryFromStoreLive: Layer.Layer<OAuthClientRegistry, never, OAuthClientStore>;
|
|
1868
|
+
export declare const makeOAuthClientRegistryMemory: (clients?: readonly OAuthClientRecord[]) => OAuthClientRegistryService;
|
|
1869
|
+
export declare const OAuthClientRegistryMemoryLive: (clients?: readonly OAuthClientRecord[]) => Layer.Layer<OAuthClientRegistry, never, never>;
|
|
1870
|
+
export declare const makeOAuthClientStoreMemory: (clients?: readonly OAuthClientRecord[]) => OAuthClientStoreService;
|
|
1871
|
+
export declare const OAuthClientStoreMemoryLive: (clients?: readonly OAuthClientRecord[]) => Layer.Layer<OAuthClientStore, never, never>;
|
|
1872
|
+
export declare const makeOAuthConsentStoreMemory: (records?: readonly OAuthConsentRecord[]) => OAuthConsentStoreService;
|
|
1873
|
+
export declare const OAuthConsentStoreMemoryLive: (records?: readonly OAuthConsentRecord[]) => Layer.Layer<OAuthConsentStore, never, never>;
|
|
1874
|
+
export declare const makeOAuthClientSecretStoreMemory: () => OAuthClientSecretStoreService;
|
|
1875
|
+
export declare const OAuthClientSecretStoreMemoryLive: Layer.Layer<OAuthClientSecretStore, never, never>;
|
|
1876
|
+
export declare const makeOAuthAuthorizationCodeStoreMemory: () => OAuthAuthorizationCodeStoreService;
|
|
1877
|
+
export declare const OAuthAuthorizationCodeStoreMemoryLive: Layer.Layer<OAuthAuthorizationCodeStore, never, never>;
|
|
1878
|
+
export declare const makeOAuthProviderModeTokenStoreMemory: () => OAuthProviderModeTokenStoreService;
|
|
1879
|
+
export declare const OAuthProviderModeTokenStoreMemoryLive: Layer.Layer<OAuthProviderModeTokenStore, never, never>;
|
|
924
1880
|
export declare const OidcIdTokenVerifierLive: Layer.Layer<OidcIdTokenVerifier, never, JwtVerifier>;
|
|
925
1881
|
export declare const OAuthOidcProfileNormalizerLive: Layer.Layer<OAuthProfileNormalizer, never, never>;
|
|
926
1882
|
export declare const OAuthAccountLinkingLive: Layer.Layer<OAuthAccountLinking, never, OAuthAccountStore>;
|