@absolutejs/auth 0.56.2 → 0.56.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/migrate.js.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +4 -4
- package/dist/oidc/index.js +5 -1
- package/dist/oidc/index.js.map +3 -3
- package/dist/server.js +15 -1
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
- package/dist/abuse/captcha.d.ts +0 -11
- package/dist/abuse/config.d.ts +0 -29
- package/dist/actions.d.ts +0 -27
- package/dist/agents/config.d.ts +0 -44
- package/dist/agents/context.d.ts +0 -46
- package/dist/agents/principal.d.ts +0 -4
- package/dist/agents/registration.d.ts +0 -162
- package/dist/agents/routes.d.ts +0 -321
- package/dist/agents/types.d.ts +0 -129
- package/dist/apikeys/config.d.ts +0 -64
- package/dist/apikeys/routes.d.ts +0 -83
- package/dist/apikeys/types.d.ts +0 -53
- package/dist/audit/config.d.ts +0 -9
- package/dist/audit/export.d.ts +0 -2
- package/dist/audit/inMemoryAuditStore.d.ts +0 -2
- package/dist/audit/integrity.d.ts +0 -19
- package/dist/audit/postgresAuditStore.d.ts +0 -116
- package/dist/audit/siem.d.ts +0 -11
- package/dist/audit/types.d.ts +0 -19
- package/dist/audit/wrap.d.ts +0 -9
- package/dist/authContext.d.ts +0 -193
- package/dist/authorization/config.d.ts +0 -19
- package/dist/authorization/protectPermission.d.ts +0 -52
- package/dist/compliance/cipher.d.ts +0 -11
- package/dist/compliance/config.d.ts +0 -18
- package/dist/compliance/redaction.d.ts +0 -8
- package/dist/compliance/routes.d.ts +0 -89
- package/dist/constants.d.ts +0 -10
- package/dist/credentials/backgroundOps.d.ts +0 -45
- package/dist/credentials/config.d.ts +0 -68
- package/dist/credentials/emailValidation.d.ts +0 -9
- package/dist/credentials/emailVerification.d.ts +0 -83
- package/dist/credentials/import.d.ts +0 -34
- package/dist/credentials/inMemoryCredentialStore.d.ts +0 -2
- package/dist/credentials/legacyHashers.d.ts +0 -3
- package/dist/credentials/login.d.ts +0 -76
- package/dist/credentials/passwordPolicy.d.ts +0 -15
- package/dist/credentials/passwordReset.d.ts +0 -87
- package/dist/credentials/postgresCredentialStore.d.ts +0 -235
- package/dist/credentials/register.d.ts +0 -54
- package/dist/credentials/routes.d.ts +0 -201
- package/dist/credentials/types.d.ts +0 -26
- package/dist/crypto.d.ts +0 -32
- package/dist/errors.d.ts +0 -12
- package/dist/federation/tokenStore.d.ts +0 -29
- package/dist/htmx/configuredRoutes.d.ts +0 -542
- package/dist/htmx/renderers.d.ts +0 -8
- package/dist/htmx/routes.d.ts +0 -514
- package/dist/htmx/types.d.ts +0 -129
- package/dist/linkedProviders/inMemoryStores.d.ts +0 -9
- package/dist/linkedProviders/neonStores.d.ts +0 -484
- package/dist/linkedProviders/oauthAccountResolver.d.ts +0 -28
- package/dist/linkedProviders/oauthResolver.d.ts +0 -9
- package/dist/linkedProviders/resolver.d.ts +0 -22
- package/dist/lockout/config.d.ts +0 -17
- package/dist/lockout/inMemoryLockoutStore.d.ts +0 -2
- package/dist/lockout/postgresLockoutStore.d.ts +0 -71
- package/dist/lockout/redisLockoutStore.d.ts +0 -3
- package/dist/lockout/types.d.ts +0 -12
- package/dist/mfa/backupCodes.d.ts +0 -5
- package/dist/mfa/challenge.d.ts +0 -70
- package/dist/mfa/config.d.ts +0 -50
- package/dist/mfa/gate.d.ts +0 -2
- package/dist/mfa/inMemoryMfaStore.d.ts +0 -2
- package/dist/mfa/management.d.ts +0 -106
- package/dist/mfa/postgresMfaStore.d.ts +0 -206
- package/dist/mfa/rotation.d.ts +0 -17
- package/dist/mfa/routes.d.ts +0 -234
- package/dist/mfa/secret.d.ts +0 -2
- package/dist/mfa/sms.d.ts +0 -105
- package/dist/mfa/totp.d.ts +0 -91
- package/dist/mfa/types.d.ts +0 -23
- package/dist/oidc/clientAuth.d.ts +0 -19
- package/dist/oidc/config.d.ts +0 -296
- package/dist/oidc/dpop.d.ts +0 -23
- package/dist/oidc/inMemoryVciStores.d.ts +0 -3
- package/dist/oidc/jar.d.ts +0 -14
- package/dist/oidc/keys.d.ts +0 -35
- package/dist/oidc/logout.d.ts +0 -38
- package/dist/oidc/mtls.d.ts +0 -11
- package/dist/oidc/par.d.ts +0 -28
- package/dist/oidc/registration.d.ts +0 -138
- package/dist/oidc/routes.d.ts +0 -569
- package/dist/oidc/types.d.ts +0 -145
- package/dist/oidc/userinfo.d.ts +0 -21
- package/dist/oidc/vci.d.ts +0 -159
- package/dist/oidc/vciRoutes.d.ts +0 -92
- package/dist/organizations/config.d.ts +0 -46
- package/dist/organizations/operations.d.ts +0 -39
- package/dist/organizations/routes.d.ts +0 -299
- package/dist/organizations/types.d.ts +0 -45
- package/dist/passwordless/config.d.ts +0 -43
- package/dist/passwordless/routes.d.ts +0 -163
- package/dist/passwordless/types.d.ts +0 -9
- package/dist/pluginIdentity.d.ts +0 -2
- package/dist/portal/config.d.ts +0 -34
- package/dist/portal/operations.d.ts +0 -10
- package/dist/portal/routes.d.ts +0 -160
- package/dist/portal/types.d.ts +0 -16
- package/dist/providers/clients.d.ts +0 -1818
- package/dist/providersFromEnv.d.ts +0 -19
- package/dist/roles/config.d.ts +0 -27
- package/dist/roles/operations.d.ts +0 -8
- package/dist/roles/routes.d.ts +0 -106
- package/dist/roles/types.d.ts +0 -14
- package/dist/routes/authorize.d.ts +0 -102
- package/dist/routes/callback.d.ts +0 -64
- package/dist/routes/profile.d.ts +0 -70
- package/dist/routes/protectRoute.d.ts +0 -51
- package/dist/routes/refresh.d.ts +0 -74
- package/dist/routes/revoke.d.ts +0 -73
- package/dist/routes/sessions.d.ts +0 -103
- package/dist/routes/signout.d.ts +0 -70
- package/dist/routes/stepUp.d.ts +0 -48
- package/dist/routes/userStatus.d.ts +0 -72
- package/dist/scim/config.d.ts +0 -57
- package/dist/scim/extensions.d.ts +0 -30
- package/dist/scim/inMemoryScimTokenStore.d.ts +0 -2
- package/dist/scim/routes.d.ts +0 -366
- package/dist/scim/serialize.d.ts +0 -83
- package/dist/scim/types.d.ts +0 -54
- package/dist/session/access.d.ts +0 -33
- package/dist/session/anonymous.d.ts +0 -12
- package/dist/session/cleanup.d.ts +0 -45
- package/dist/session/impersonation.d.ts +0 -34
- package/dist/session/inMemoryStore.d.ts +0 -7
- package/dist/session/multiSession.d.ts +0 -27
- package/dist/session/neonStore.d.ts +0 -513
- package/dist/session/promote.d.ts +0 -23
- package/dist/session/redisStore.d.ts +0 -6
- package/dist/session/sessionsConfig.d.ts +0 -9
- package/dist/session/state.d.ts +0 -33
- package/dist/session/types.d.ts +0 -21
- package/dist/session/userSessions.d.ts +0 -19
- package/dist/sso/config.d.ts +0 -149
- package/dist/sso/discoveryRoute.d.ts +0 -63
- package/dist/sso/oidcRoutes.d.ts +0 -98
- package/dist/sso/samlRoutes.d.ts +0 -179
- package/dist/sso/types.d.ts +0 -53
- package/dist/stores/postgres.d.ts +0 -5
- package/dist/stores/redis.d.ts +0 -5
- package/dist/telemetry/tracing.d.ts +0 -15
- package/dist/tenancy.d.ts +0 -9
- package/dist/typeGuards.d.ts +0 -6
- package/dist/typebox.d.ts +0 -4
- package/dist/types.d.ts +0 -421
- package/dist/utils.d.ts +0 -45
- package/dist/vault/config.d.ts +0 -20
- package/dist/vault/inMemoryVaultStore.d.ts +0 -2
- package/dist/vault/postgresVaultStore.d.ts +0 -86
- package/dist/vault/types.d.ts +0 -14
- package/dist/vc/inMemoryVpStores.d.ts +0 -2
- package/dist/vc/openid4vp.d.ts +0 -82
- package/dist/vc/postgresVcStores.d.ts +0 -300
- package/dist/vc/sdJwt.d.ts +0 -37
- package/dist/vc/statusList.d.ts +0 -29
- package/dist/vc/statusListRoutes.d.ts +0 -63
- package/dist/vc/vpRoutes.d.ts +0 -120
- package/dist/webauthn/adapter.d.ts +0 -59
- package/dist/webauthn/config.d.ts +0 -36
- package/dist/webauthn/routes.d.ts +0 -155
- package/dist/webauthn/types.d.ts +0 -17
- package/dist/webhooks/config.d.ts +0 -34
- package/dist/webhooks/dispatcher.d.ts +0 -3
- package/dist/webhooks/sign.d.ts +0 -11
- package/dist/webhooks/types.d.ts +0 -25
package/dist/agents/types.d.ts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
export type AgentRegistrationStatus = 'active' | 'revoked';
|
|
2
|
-
export type AgentDelegationStatus = 'active' | 'revoked';
|
|
3
|
-
/** A durable identity for an agent client. This is deliberately protocol-neutral:
|
|
4
|
-
* `clientId` can refer to an OAuth client, while adapters for other protocols can
|
|
5
|
-
* use `agentId` without manufacturing OAuth metadata. */
|
|
6
|
-
export type AgentRegistration = {
|
|
7
|
-
agentId: string;
|
|
8
|
-
allowedScopes: string[];
|
|
9
|
-
clientId?: string;
|
|
10
|
-
createdAt: number;
|
|
11
|
-
metadata?: Record<string, unknown>;
|
|
12
|
-
name: string;
|
|
13
|
-
status: AgentRegistrationStatus;
|
|
14
|
-
updatedAt: number;
|
|
15
|
-
};
|
|
16
|
-
export type AgentRegistrationStore = {
|
|
17
|
-
findByAgentId: (agentId: string) => Promise<AgentRegistration | undefined>;
|
|
18
|
-
findByClientId: (clientId: string) => Promise<AgentRegistration | undefined>;
|
|
19
|
-
listRegistrations: () => Promise<AgentRegistration[]>;
|
|
20
|
-
saveRegistration: (registration: AgentRegistration) => Promise<void>;
|
|
21
|
-
};
|
|
22
|
-
/** A user's explicit grant to an agent. Authorization details use RFC 9396's
|
|
23
|
-
* open object shape so applications can express transaction constraints without
|
|
24
|
-
* forcing them into coarse OAuth scope strings. */
|
|
25
|
-
export type AgentDelegation = {
|
|
26
|
-
agentId: string;
|
|
27
|
-
authorizationDetails?: Record<string, unknown>[];
|
|
28
|
-
createdAt: number;
|
|
29
|
-
delegationId: string;
|
|
30
|
-
expiresAt?: number;
|
|
31
|
-
organizationId?: string;
|
|
32
|
-
scopes: string[];
|
|
33
|
-
status: AgentDelegationStatus;
|
|
34
|
-
updatedAt: number;
|
|
35
|
-
userId: string;
|
|
36
|
-
};
|
|
37
|
-
export type AgentDelegationStore = {
|
|
38
|
-
findActiveDelegation: (query: {
|
|
39
|
-
agentId: string;
|
|
40
|
-
now?: number;
|
|
41
|
-
organizationId?: string;
|
|
42
|
-
userId: string;
|
|
43
|
-
}) => Promise<AgentDelegation | undefined>;
|
|
44
|
-
findByDelegationId: (delegationId: string) => Promise<AgentDelegation | undefined>;
|
|
45
|
-
listDelegations: (agentId?: string) => Promise<AgentDelegation[]>;
|
|
46
|
-
saveDelegation: (delegation: AgentDelegation) => Promise<void>;
|
|
47
|
-
};
|
|
48
|
-
/** The normalized result produced by a wire-protocol adapter. The core never
|
|
49
|
-
* handles raw provider assertions; it authorizes only this verified shape. */
|
|
50
|
-
export type VerifiedAgentCredential = {
|
|
51
|
-
agentId: string;
|
|
52
|
-
claims?: Record<string, unknown>;
|
|
53
|
-
expiresAt?: number;
|
|
54
|
-
organizationId?: string;
|
|
55
|
-
resource?: string;
|
|
56
|
-
scopes: string[];
|
|
57
|
-
userId?: string;
|
|
58
|
-
};
|
|
59
|
-
export type AgentCredentialVerifier = (request: Request) => Promise<VerifiedAgentCredential | undefined>;
|
|
60
|
-
export type AgentPrincipal = {
|
|
61
|
-
agentId: string;
|
|
62
|
-
authorizationDetails?: Record<string, unknown>[];
|
|
63
|
-
delegationId?: string;
|
|
64
|
-
kind: 'agent';
|
|
65
|
-
name: string;
|
|
66
|
-
organizationId?: string;
|
|
67
|
-
scopes: string[];
|
|
68
|
-
trust: 'delegated' | 'registered';
|
|
69
|
-
userId?: string;
|
|
70
|
-
};
|
|
71
|
-
export type AgentIdentityRegistrationKind = 'anonymous' | 'identity_assertion' | 'service_auth';
|
|
72
|
-
export type AgentIdentityRegistrationStatus = 'claimed' | 'pending' | 'revoked';
|
|
73
|
-
export type AgentClaimAttempt = {
|
|
74
|
-
attempts: number;
|
|
75
|
-
email: string;
|
|
76
|
-
expiresAt: number;
|
|
77
|
-
tokenHash: string;
|
|
78
|
-
userCodeHash: string;
|
|
79
|
-
};
|
|
80
|
-
/** Durable state for the open auth.md registration profile. Secrets are
|
|
81
|
-
* represented only by hashes; plaintext claim and attempt tokens are returned
|
|
82
|
-
* once to the agent and never persisted. `version` is used for compare-and-swap
|
|
83
|
-
* updates so claim completion is safe across multiple application instances. */
|
|
84
|
-
export type AgentIdentityRegistration = {
|
|
85
|
-
agentId: string;
|
|
86
|
-
claimAttempt?: AgentClaimAttempt;
|
|
87
|
-
claimExpiresAt: number;
|
|
88
|
-
claimTokenHash: string;
|
|
89
|
-
createdAt: number;
|
|
90
|
-
expiresAt: number;
|
|
91
|
-
kind: AgentIdentityRegistrationKind;
|
|
92
|
-
loginHint?: string;
|
|
93
|
-
lastPolledAt?: number;
|
|
94
|
-
registrationId: string;
|
|
95
|
-
status: AgentIdentityRegistrationStatus;
|
|
96
|
-
updatedAt: number;
|
|
97
|
-
upstream?: {
|
|
98
|
-
clientId: string;
|
|
99
|
-
issuer: string;
|
|
100
|
-
subject: string;
|
|
101
|
-
};
|
|
102
|
-
userId?: string;
|
|
103
|
-
version: number;
|
|
104
|
-
};
|
|
105
|
-
export type AgentIdentityRegistrationStore = {
|
|
106
|
-
create: (registration: AgentIdentityRegistration) => Promise<boolean>;
|
|
107
|
-
findByClaimTokenHash: (claimTokenHash: string) => Promise<AgentIdentityRegistration | undefined>;
|
|
108
|
-
findByAgentId: (agentId: string) => Promise<AgentIdentityRegistration | undefined>;
|
|
109
|
-
findByRegistrationId: (registrationId: string) => Promise<AgentIdentityRegistration | undefined>;
|
|
110
|
-
findByUpstreamIdentity: (query: {
|
|
111
|
-
clientId: string;
|
|
112
|
-
issuer: string;
|
|
113
|
-
subject: string;
|
|
114
|
-
}) => Promise<AgentIdentityRegistration | undefined>;
|
|
115
|
-
findByAttemptTokenHash: (attemptTokenHash: string) => Promise<AgentIdentityRegistration | undefined>;
|
|
116
|
-
/** Replaces a record only when its current version equals expectedVersion. */
|
|
117
|
-
replace: (registration: AgentIdentityRegistration, expectedVersion: number) => Promise<boolean>;
|
|
118
|
-
};
|
|
119
|
-
export type VerifiedAgentIdentityAssertion = {
|
|
120
|
-
authenticatedAt: number;
|
|
121
|
-
clientId: string;
|
|
122
|
-
email?: string;
|
|
123
|
-
emailVerified?: boolean;
|
|
124
|
-
issuer: string;
|
|
125
|
-
name?: string;
|
|
126
|
-
phoneNumber?: string;
|
|
127
|
-
phoneNumberVerified?: boolean;
|
|
128
|
-
subject: string;
|
|
129
|
-
};
|
package/dist/apikeys/config.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { RouteString } from '../types';
|
|
2
|
-
import type { AccessTokenStore, ApiClient, ApiClientStore, ApiKey, ApiKeyStore, ApiPrincipal } from './types';
|
|
3
|
-
export declare const DEFAULT_TOKEN_ROUTE: RouteString;
|
|
4
|
-
export type ApiKeysConfig = {
|
|
5
|
-
/** Where minted access tokens live — required (with `apiClientStore`) for the
|
|
6
|
-
* client_credentials grant to be mounted. */
|
|
7
|
-
accessTokenStore?: AccessTokenStore;
|
|
8
|
-
/** Lifetime of a minted access token (defaults to one hour). */
|
|
9
|
-
accessTokenTtlMs?: number;
|
|
10
|
-
/** Registered M2M clients — required (with `accessTokenStore`) for the
|
|
11
|
-
* client_credentials grant. */
|
|
12
|
-
apiClientStore?: ApiClientStore;
|
|
13
|
-
/** Static API keys. Used by the exported `verifyApiKey` / `resolveApiPrincipal`
|
|
14
|
-
* helpers; the consumer wires its own management + guard routes. */
|
|
15
|
-
apiKeyStore?: ApiKeyStore;
|
|
16
|
-
/** Path of the client_credentials token endpoint (defaults to `/oauth2/token`). */
|
|
17
|
-
tokenRoute?: RouteString;
|
|
18
|
-
};
|
|
19
|
-
export type ClientCredentialsResult = {
|
|
20
|
-
error: 'invalid_client' | 'invalid_scope';
|
|
21
|
-
ok: false;
|
|
22
|
-
} | {
|
|
23
|
-
accessToken: string;
|
|
24
|
-
expiresIn: number;
|
|
25
|
-
ok: true;
|
|
26
|
-
scopes: string[];
|
|
27
|
-
};
|
|
28
|
-
export declare const createApiClient: (apiClientStore: ApiClientStore, options: {
|
|
29
|
-
name: string;
|
|
30
|
-
ownerId?: string;
|
|
31
|
-
scopes?: string[];
|
|
32
|
-
}) => Promise<{
|
|
33
|
-
clientId: string;
|
|
34
|
-
clientSecret: string;
|
|
35
|
-
record: ApiClient;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const createApiKey: (apiKeyStore: ApiKeyStore, options: {
|
|
38
|
-
expiresAt?: number;
|
|
39
|
-
name: string;
|
|
40
|
-
ownerId?: string;
|
|
41
|
-
scopes?: string[];
|
|
42
|
-
}) => Promise<{
|
|
43
|
-
key: string;
|
|
44
|
-
record: ApiKey;
|
|
45
|
-
}>;
|
|
46
|
-
export declare const exchangeClientCredentials: ({ accessTokenStore, apiClientStore, clientId, clientSecret, now, requestedScopes, ttlMs }: {
|
|
47
|
-
accessTokenStore: AccessTokenStore;
|
|
48
|
-
apiClientStore: ApiClientStore;
|
|
49
|
-
clientId: string;
|
|
50
|
-
clientSecret: string;
|
|
51
|
-
now?: number;
|
|
52
|
-
requestedScopes?: string[];
|
|
53
|
-
ttlMs?: number;
|
|
54
|
-
}) => Promise<ClientCredentialsResult>;
|
|
55
|
-
export declare const hasScopes: (principal: ApiPrincipal | undefined, required: string[]) => boolean;
|
|
56
|
-
export declare const resolveApiPrincipal: ({ accessTokenStore, apiKey, apiKeyStore, authorization, now }: {
|
|
57
|
-
accessTokenStore?: AccessTokenStore;
|
|
58
|
-
apiKey?: string;
|
|
59
|
-
apiKeyStore?: ApiKeyStore;
|
|
60
|
-
authorization?: string;
|
|
61
|
-
now?: number;
|
|
62
|
-
}) => Promise<ApiPrincipal | undefined>;
|
|
63
|
-
export declare const verifyAccessToken: (accessTokenStore: AccessTokenStore, presented: string, now?: number) => Promise<import("./types").AccessToken | undefined>;
|
|
64
|
-
export declare const verifyApiKey: (apiKeyStore: ApiKeyStore, presented: string, now?: number) => Promise<ApiKey | undefined>;
|
package/dist/apikeys/routes.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Elysia } from 'elysia';
|
|
2
|
-
import { type ApiKeysConfig } from './config';
|
|
3
|
-
export declare const apiKeysRoutes: ({ accessTokenStore, accessTokenTtlMs, apiClientStore, tokenRoute }: ApiKeysConfig) => Elysia<"", {
|
|
4
|
-
decorator: {};
|
|
5
|
-
store: {};
|
|
6
|
-
derive: {};
|
|
7
|
-
resolve: {};
|
|
8
|
-
}, {
|
|
9
|
-
typebox: {};
|
|
10
|
-
error: {};
|
|
11
|
-
}, {
|
|
12
|
-
schema: {};
|
|
13
|
-
standaloneSchema: {};
|
|
14
|
-
macro: {};
|
|
15
|
-
macroFn: {};
|
|
16
|
-
parser: {};
|
|
17
|
-
response: {};
|
|
18
|
-
}, {}, {
|
|
19
|
-
derive: {};
|
|
20
|
-
resolve: {};
|
|
21
|
-
schema: {};
|
|
22
|
-
standaloneSchema: {};
|
|
23
|
-
response: {};
|
|
24
|
-
}, {
|
|
25
|
-
derive: {};
|
|
26
|
-
resolve: {};
|
|
27
|
-
schema: {};
|
|
28
|
-
standaloneSchema: {};
|
|
29
|
-
response: {};
|
|
30
|
-
}> | Elysia<"", {
|
|
31
|
-
decorator: {};
|
|
32
|
-
store: {};
|
|
33
|
-
derive: {};
|
|
34
|
-
resolve: {};
|
|
35
|
-
}, {
|
|
36
|
-
typebox: {};
|
|
37
|
-
error: {};
|
|
38
|
-
}, {
|
|
39
|
-
schema: {};
|
|
40
|
-
standaloneSchema: {};
|
|
41
|
-
macro: {};
|
|
42
|
-
macroFn: {};
|
|
43
|
-
parser: {};
|
|
44
|
-
response: {};
|
|
45
|
-
}, {
|
|
46
|
-
[x: string]: {
|
|
47
|
-
post: {
|
|
48
|
-
body: {
|
|
49
|
-
client_id?: string | undefined;
|
|
50
|
-
scope?: string | undefined;
|
|
51
|
-
grant_type?: string | undefined;
|
|
52
|
-
client_secret?: string | undefined;
|
|
53
|
-
};
|
|
54
|
-
params: {};
|
|
55
|
-
query: unknown;
|
|
56
|
-
headers: unknown;
|
|
57
|
-
response: {
|
|
58
|
-
200: Response;
|
|
59
|
-
422: {
|
|
60
|
-
type: "validation";
|
|
61
|
-
on: string;
|
|
62
|
-
summary?: string;
|
|
63
|
-
message?: string;
|
|
64
|
-
found?: unknown;
|
|
65
|
-
property?: string;
|
|
66
|
-
expected?: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}, {
|
|
72
|
-
derive: {};
|
|
73
|
-
resolve: {};
|
|
74
|
-
schema: {};
|
|
75
|
-
standaloneSchema: {};
|
|
76
|
-
response: {};
|
|
77
|
-
}, {
|
|
78
|
-
derive: {};
|
|
79
|
-
resolve: {};
|
|
80
|
-
schema: {};
|
|
81
|
-
standaloneSchema: {};
|
|
82
|
-
response: {};
|
|
83
|
-
}>;
|
package/dist/apikeys/types.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export type ApiKey = {
|
|
2
|
-
createdAt: number;
|
|
3
|
-
expiresAt?: number;
|
|
4
|
-
hashedKey: string;
|
|
5
|
-
keyId: string;
|
|
6
|
-
lastUsedAt?: number;
|
|
7
|
-
name: string;
|
|
8
|
-
ownerId?: string;
|
|
9
|
-
prefix: string;
|
|
10
|
-
scopes: string[];
|
|
11
|
-
};
|
|
12
|
-
export type ApiKeyStore = {
|
|
13
|
-
deleteKey: (keyId: string) => Promise<void>;
|
|
14
|
-
findByHashedKey: (hashedKey: string) => Promise<ApiKey | undefined>;
|
|
15
|
-
listKeys: (ownerId?: string) => Promise<ApiKey[]>;
|
|
16
|
-
saveKey: (key: ApiKey) => Promise<void>;
|
|
17
|
-
touchKey: (keyId: string, lastUsedAt: number) => Promise<void>;
|
|
18
|
-
};
|
|
19
|
-
export type ApiClient = {
|
|
20
|
-
clientId: string;
|
|
21
|
-
createdAt: number;
|
|
22
|
-
hashedSecret: string;
|
|
23
|
-
name: string;
|
|
24
|
-
ownerId?: string;
|
|
25
|
-
scopes: string[];
|
|
26
|
-
};
|
|
27
|
-
export type ApiClientStore = {
|
|
28
|
-
deleteClient: (clientId: string) => Promise<void>;
|
|
29
|
-
findClient: (clientId: string) => Promise<ApiClient | undefined>;
|
|
30
|
-
listClients: (ownerId?: string) => Promise<ApiClient[]>;
|
|
31
|
-
saveClient: (client: ApiClient) => Promise<void>;
|
|
32
|
-
};
|
|
33
|
-
export type AccessToken = {
|
|
34
|
-
clientId: string;
|
|
35
|
-
createdAt: number;
|
|
36
|
-
expiresAt: number;
|
|
37
|
-
hashedToken: string;
|
|
38
|
-
ownerId?: string;
|
|
39
|
-
scopes: string[];
|
|
40
|
-
tokenId: string;
|
|
41
|
-
};
|
|
42
|
-
export type AccessTokenStore = {
|
|
43
|
-
deleteExpired: (now: number) => Promise<void>;
|
|
44
|
-
deleteToken: (tokenId: string) => Promise<void>;
|
|
45
|
-
findByHashedToken: (hashedToken: string) => Promise<AccessToken | undefined>;
|
|
46
|
-
saveToken: (token: AccessToken) => Promise<void>;
|
|
47
|
-
};
|
|
48
|
-
export type ApiPrincipal = {
|
|
49
|
-
id: string;
|
|
50
|
-
kind: 'access_token' | 'api_key';
|
|
51
|
-
ownerId?: string;
|
|
52
|
-
scopes: string[];
|
|
53
|
-
};
|
package/dist/audit/config.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AuditEvent, AuditSink } from './types';
|
|
2
|
-
export type AuditConfig<UserType> = {
|
|
3
|
-
auditStore?: AuditSink;
|
|
4
|
-
getUserId?: (user: UserType) => string;
|
|
5
|
-
onAuditEvent?: (event: AuditEvent) => void | Promise<void>;
|
|
6
|
-
redact?: (event: AuditEvent) => AuditEvent | Promise<AuditEvent>;
|
|
7
|
-
};
|
|
8
|
-
export type AuditEmitter = (event: AuditEvent) => Promise<void>;
|
|
9
|
-
export declare const createAuditEmitter: <UserType>({ auditStore, onAuditEvent, redact }: AuditConfig<UserType>) => (event: AuditEvent) => Promise<void>;
|
package/dist/audit/export.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AuditEvent, AuditSink } from './types';
|
|
2
|
-
export type AuditIntegrity = {
|
|
3
|
-
hash: string;
|
|
4
|
-
previousHash: string;
|
|
5
|
-
writerId?: string;
|
|
6
|
-
};
|
|
7
|
-
export type AuditChainResult = {
|
|
8
|
-
brokenAt?: number;
|
|
9
|
-
ok: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const createTamperEvidentSink: ({ loadWriterHead, secret, seedScanLimit, sink, writerId }: {
|
|
12
|
-
loadWriterHead?: (writerId: string) => Promise<string | undefined> | string | undefined;
|
|
13
|
-
secret?: string;
|
|
14
|
-
seedScanLimit?: number;
|
|
15
|
-
sink: AuditSink;
|
|
16
|
-
writerId?: string;
|
|
17
|
-
}) => AuditSink;
|
|
18
|
-
export declare const hashAuditEvent: (event: AuditEvent, previousHash: string, secret?: string) => Promise<string>;
|
|
19
|
-
export declare const verifyAuditChain: (events: AuditEvent[], secret?: string) => Promise<AuditChainResult>;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { type AnyPgDatabase } from '../stores/postgres';
|
|
2
|
-
import type { AuditSink } from './types';
|
|
3
|
-
export declare const auditEventsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
|
-
name: "auth_audit_events";
|
|
5
|
-
schema: undefined;
|
|
6
|
-
columns: {
|
|
7
|
-
at_ms: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
|
|
8
|
-
name: string;
|
|
9
|
-
tableName: "auth_audit_events";
|
|
10
|
-
dataType: "number int53";
|
|
11
|
-
data: number;
|
|
12
|
-
driverParam: string | number;
|
|
13
|
-
notNull: true;
|
|
14
|
-
hasDefault: false;
|
|
15
|
-
isPrimaryKey: false;
|
|
16
|
-
isAutoincrement: false;
|
|
17
|
-
hasRuntimeDefault: false;
|
|
18
|
-
enumValues: undefined;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}>;
|
|
22
|
-
id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
23
|
-
name: string;
|
|
24
|
-
tableName: "auth_audit_events";
|
|
25
|
-
dataType: "string";
|
|
26
|
-
data: string;
|
|
27
|
-
driverParam: string;
|
|
28
|
-
notNull: true;
|
|
29
|
-
hasDefault: false;
|
|
30
|
-
isPrimaryKey: false;
|
|
31
|
-
isAutoincrement: false;
|
|
32
|
-
hasRuntimeDefault: false;
|
|
33
|
-
enumValues: undefined;
|
|
34
|
-
identity: undefined;
|
|
35
|
-
generated: undefined;
|
|
36
|
-
}>;
|
|
37
|
-
ip: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
38
|
-
name: string;
|
|
39
|
-
tableName: "auth_audit_events";
|
|
40
|
-
dataType: "string";
|
|
41
|
-
data: string;
|
|
42
|
-
driverParam: string;
|
|
43
|
-
notNull: false;
|
|
44
|
-
hasDefault: false;
|
|
45
|
-
isPrimaryKey: false;
|
|
46
|
-
isAutoincrement: false;
|
|
47
|
-
hasRuntimeDefault: false;
|
|
48
|
-
enumValues: undefined;
|
|
49
|
-
identity: undefined;
|
|
50
|
-
generated: undefined;
|
|
51
|
-
}>;
|
|
52
|
-
metadata_json: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, Record<string, unknown>>, {
|
|
53
|
-
name: string;
|
|
54
|
-
tableName: "auth_audit_events";
|
|
55
|
-
dataType: "object json";
|
|
56
|
-
data: Record<string, unknown>;
|
|
57
|
-
driverParam: unknown;
|
|
58
|
-
notNull: false;
|
|
59
|
-
hasDefault: false;
|
|
60
|
-
isPrimaryKey: false;
|
|
61
|
-
isAutoincrement: false;
|
|
62
|
-
hasRuntimeDefault: false;
|
|
63
|
-
enumValues: undefined;
|
|
64
|
-
identity: undefined;
|
|
65
|
-
generated: undefined;
|
|
66
|
-
}>;
|
|
67
|
-
organization_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
68
|
-
name: string;
|
|
69
|
-
tableName: "auth_audit_events";
|
|
70
|
-
dataType: "string";
|
|
71
|
-
data: string;
|
|
72
|
-
driverParam: string;
|
|
73
|
-
notNull: false;
|
|
74
|
-
hasDefault: false;
|
|
75
|
-
isPrimaryKey: false;
|
|
76
|
-
isAutoincrement: false;
|
|
77
|
-
hasRuntimeDefault: false;
|
|
78
|
-
enumValues: undefined;
|
|
79
|
-
identity: undefined;
|
|
80
|
-
generated: undefined;
|
|
81
|
-
}>;
|
|
82
|
-
type: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>>, {
|
|
83
|
-
name: string;
|
|
84
|
-
tableName: "auth_audit_events";
|
|
85
|
-
dataType: "string";
|
|
86
|
-
data: string;
|
|
87
|
-
driverParam: string;
|
|
88
|
-
notNull: true;
|
|
89
|
-
hasDefault: false;
|
|
90
|
-
isPrimaryKey: false;
|
|
91
|
-
isAutoincrement: false;
|
|
92
|
-
hasRuntimeDefault: false;
|
|
93
|
-
enumValues: undefined;
|
|
94
|
-
identity: undefined;
|
|
95
|
-
generated: undefined;
|
|
96
|
-
}>;
|
|
97
|
-
user_id: import("drizzle-orm/pg-core").PgBuildColumn<"auth_audit_events", import("drizzle-orm/pg-core").PgVarcharBuilder<[string, ...string[]]>, {
|
|
98
|
-
name: string;
|
|
99
|
-
tableName: "auth_audit_events";
|
|
100
|
-
dataType: "string";
|
|
101
|
-
data: string;
|
|
102
|
-
driverParam: string;
|
|
103
|
-
notNull: false;
|
|
104
|
-
hasDefault: false;
|
|
105
|
-
isPrimaryKey: false;
|
|
106
|
-
isAutoincrement: false;
|
|
107
|
-
hasRuntimeDefault: false;
|
|
108
|
-
enumValues: undefined;
|
|
109
|
-
identity: undefined;
|
|
110
|
-
generated: undefined;
|
|
111
|
-
}>;
|
|
112
|
-
};
|
|
113
|
-
dialect: "pg";
|
|
114
|
-
}>;
|
|
115
|
-
export declare const createNeonAuditSink: (databaseUrl: string) => AuditSink;
|
|
116
|
-
export declare const createPostgresAuditSink: <DB extends AnyPgDatabase>(db: DB) => AuditSink;
|
package/dist/audit/siem.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AuditSink } from './types';
|
|
2
|
-
export type SiemFormat = 'datadog' | 'generic' | 'splunk';
|
|
3
|
-
export type SiemEndpoint = {
|
|
4
|
-
format?: SiemFormat;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
token?: string;
|
|
7
|
-
url: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const createSiemLogStream: ({ endpoints }: {
|
|
10
|
-
endpoints: SiemEndpoint[];
|
|
11
|
-
}) => AuditSink;
|
package/dist/audit/types.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { OrganizationId } from '../tenancy';
|
|
2
|
-
export type AuditEventType = 'account_deleted' | 'agent_credential_issued' | 'agent_delegated' | 'agent_registered' | 'agent_revoked' | 'authorization_denied' | 'credentials_login' | 'credentials_login_failed' | 'data_exported' | 'email_verified' | 'identity_conflict' | 'impersonation_ended' | 'impersonation_started' | 'invitation_accepted' | 'invitation_created' | 'logout' | 'membership_removed' | 'mfa_challenge' | 'mfa_challenge_failed' | 'mfa_enrolled' | 'oauth_login' | 'organization_created' | 'password_reset' | 'passwordless_login' | 'register' | 'role_assigned' | 'scim_provision' | 'scim_token_created' | 'session_revoked' | 'setup_session_created' | 'sso_connection_configured' | 'sso_login' | 'token_refreshed' | 'token_revoked' | 'webauthn_authenticated' | 'webauthn_registered';
|
|
3
|
-
export type AuditEvent = {
|
|
4
|
-
at: number;
|
|
5
|
-
ip?: string;
|
|
6
|
-
metadata?: Record<string, unknown>;
|
|
7
|
-
organizationId?: OrganizationId;
|
|
8
|
-
type: AuditEventType;
|
|
9
|
-
userId?: string;
|
|
10
|
-
};
|
|
11
|
-
export type AuditEventFilter = {
|
|
12
|
-
limit?: number;
|
|
13
|
-
userId?: string;
|
|
14
|
-
};
|
|
15
|
-
export type AuditSink = {
|
|
16
|
-
append: (event: AuditEvent) => Promise<void>;
|
|
17
|
-
list?: (filter?: AuditEventFilter) => Promise<AuditEvent[]>;
|
|
18
|
-
prune?: (before: number) => Promise<number>;
|
|
19
|
-
};
|
package/dist/audit/wrap.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CredentialsConfig } from '../credentials/config';
|
|
2
|
-
import type { MfaConfig } from '../mfa/config';
|
|
3
|
-
import type { OnCallbackSuccess, OnRevocationSuccess, OnSignOut } from '../types';
|
|
4
|
-
import type { AuditEmitter } from './config';
|
|
5
|
-
export declare const composeCallbackAudit: <UserType>(onCallbackSuccess: OnCallbackSuccess<UserType>, emit: AuditEmitter) => (context: Parameters<NonNullable<OnCallbackSuccess<UserType>>>[0]) => Promise<void | Response | import("..").StatusReturn>;
|
|
6
|
-
export declare const composeCredentialsAudit: <UserType>(credentials: CredentialsConfig<UserType>, emit: AuditEmitter, getUserId?: (user: UserType) => string) => CredentialsConfig<UserType>;
|
|
7
|
-
export declare const composeMfaAudit: <UserType>(mfa: MfaConfig<UserType>, emit: AuditEmitter) => MfaConfig<UserType>;
|
|
8
|
-
export declare const composeRevocationAudit: (onRevocationSuccess: OnRevocationSuccess, emit: AuditEmitter) => (context: Parameters<NonNullable<OnRevocationSuccess>>[0]) => Promise<void | undefined>;
|
|
9
|
-
export declare const composeSignOutAudit: <UserType>(onSignOut: OnSignOut<UserType>, emit: AuditEmitter) => (context: Parameters<NonNullable<OnSignOut<UserType>>>[0]) => Promise<void | undefined>;
|