@effect-auth/core 0.1.0-alpha.0 → 0.1.0-alpha.10
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 +774 -36
- package/dist/ApiKey.d.ts +207 -0
- package/dist/ApiKey.d.ts.map +1 -0
- package/dist/ApiKey.js +275 -0
- package/dist/ApiKey.js.map +1 -0
- package/dist/AuditLog.d.ts +278 -1
- package/dist/AuditLog.d.ts.map +1 -1
- package/dist/AuditLog.js +217 -2
- package/dist/AuditLog.js.map +1 -1
- package/dist/AuthConfig.d.ts +42 -0
- package/dist/AuthConfig.d.ts.map +1 -0
- package/dist/AuthConfig.js +43 -0
- package/dist/AuthConfig.js.map +1 -0
- package/dist/AuthFlow.d.ts +465 -36
- package/dist/AuthFlow.d.ts.map +1 -1
- package/dist/AuthFlow.js +660 -5
- package/dist/AuthFlow.js.map +1 -1
- package/dist/AuthKernel.d.ts +3 -0
- package/dist/AuthKernel.d.ts.map +1 -0
- package/dist/AuthKernel.js +9 -0
- package/dist/AuthKernel.js.map +1 -0
- package/dist/Challenge.d.ts +27 -4
- package/dist/Challenge.d.ts.map +1 -1
- package/dist/Challenge.js +170 -1
- package/dist/Challenge.js.map +1 -1
- package/dist/Client.d.ts +378 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +768 -0
- package/dist/Client.js.map +1 -0
- package/dist/Crypto.d.ts +9 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +65 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/EffectQbSqliteStorage.d.ts +600 -0
- package/dist/EffectQbSqliteStorage.d.ts.map +1 -0
- package/dist/EffectQbSqliteStorage.js +1637 -0
- package/dist/EffectQbSqliteStorage.js.map +1 -0
- package/dist/EmailOtp.d.ts +120 -0
- package/dist/EmailOtp.d.ts.map +1 -0
- package/dist/EmailOtp.js +286 -0
- package/dist/EmailOtp.js.map +1 -0
- package/dist/EmailVerification.d.ts +121 -0
- package/dist/EmailVerification.d.ts.map +1 -0
- package/dist/EmailVerification.js +200 -0
- package/dist/EmailVerification.js.map +1 -0
- package/dist/HttpApi/Api.d.ts +1956 -0
- package/dist/HttpApi/Api.d.ts.map +1 -0
- package/dist/HttpApi/Api.js +2325 -0
- package/dist/HttpApi/Api.js.map +1 -0
- package/dist/HttpApi/Endpoints.d.ts +945 -0
- package/dist/HttpApi/Endpoints.d.ts.map +1 -0
- package/dist/HttpApi/Endpoints.js +373 -0
- package/dist/HttpApi/Endpoints.js.map +1 -0
- package/dist/HttpApi/Errors.d.ts +82 -0
- package/dist/HttpApi/Errors.d.ts.map +1 -0
- package/dist/HttpApi/Errors.js +184 -0
- package/dist/HttpApi/Errors.js.map +1 -0
- package/dist/HttpApi/Schemas.d.ts +1113 -0
- package/dist/HttpApi/Schemas.d.ts.map +1 -0
- package/dist/HttpApi/Schemas.js +734 -0
- package/dist/HttpApi/Schemas.js.map +1 -0
- package/dist/HttpApi/Security.d.ts +159 -0
- package/dist/HttpApi/Security.d.ts.map +1 -0
- package/dist/HttpApi/Security.js +530 -0
- package/dist/HttpApi/Security.js.map +1 -0
- package/dist/HttpApi/Transport.d.ts +65 -0
- package/dist/HttpApi/Transport.d.ts.map +1 -0
- package/dist/HttpApi/Transport.js +311 -0
- package/dist/HttpApi/Transport.js.map +1 -0
- package/dist/HttpApi/index.d.ts +8 -0
- package/dist/HttpApi/index.d.ts.map +1 -0
- package/dist/HttpApi/index.js +7 -0
- package/dist/HttpApi/index.js.map +1 -0
- package/dist/HttpApi.d.ts +2 -0
- package/dist/HttpApi.d.ts.map +1 -0
- package/dist/HttpApi.js +2 -0
- package/dist/HttpApi.js.map +1 -0
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js.map +1 -1
- package/dist/Internal.d.ts +7 -0
- package/dist/Internal.d.ts.map +1 -0
- package/dist/Internal.js +12 -0
- package/dist/Internal.js.map +1 -0
- package/dist/Jwt.d.ts +271 -0
- package/dist/Jwt.d.ts.map +1 -0
- package/dist/Jwt.js +512 -0
- package/dist/Jwt.js.map +1 -0
- package/dist/LoginApproval.d.ts +314 -0
- package/dist/LoginApproval.d.ts.map +1 -0
- package/dist/LoginApproval.js +551 -0
- package/dist/LoginApproval.js.map +1 -0
- package/dist/LoginNotification.d.ts +183 -0
- package/dist/LoginNotification.d.ts.map +1 -0
- package/dist/LoginNotification.js +329 -0
- package/dist/LoginNotification.js.map +1 -0
- package/dist/LoginRisk.d.ts +73 -0
- package/dist/LoginRisk.d.ts.map +1 -0
- package/dist/LoginRisk.js +57 -0
- package/dist/LoginRisk.js.map +1 -0
- package/dist/MagicLink.d.ts +85 -0
- package/dist/MagicLink.d.ts.map +1 -0
- package/dist/MagicLink.js +206 -0
- package/dist/MagicLink.js.map +1 -0
- package/dist/Mailer.d.ts +147 -0
- package/dist/Mailer.d.ts.map +1 -0
- package/dist/Mailer.js +208 -0
- package/dist/Mailer.js.map +1 -0
- package/dist/OAuth.d.ts +934 -0
- package/dist/OAuth.d.ts.map +1 -0
- package/dist/OAuth.js +1661 -0
- package/dist/OAuth.js.map +1 -0
- package/dist/Passkey.d.ts +334 -0
- package/dist/Passkey.d.ts.map +1 -0
- package/dist/Passkey.js +422 -0
- package/dist/Passkey.js.map +1 -0
- package/dist/PasskeySimpleWebAuthn.d.ts +11 -0
- package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -0
- package/dist/PasskeySimpleWebAuthn.js +181 -0
- package/dist/PasskeySimpleWebAuthn.js.map +1 -0
- package/dist/Password.d.ts +237 -0
- package/dist/Password.d.ts.map +1 -0
- package/dist/Password.js +641 -0
- package/dist/Password.js.map +1 -0
- package/dist/Policy.d.ts +7 -4
- package/dist/Policy.d.ts.map +1 -1
- package/dist/Policy.js +28 -5
- package/dist/Policy.js.map +1 -1
- package/dist/Privacy.d.ts +18 -0
- package/dist/Privacy.d.ts.map +1 -1
- package/dist/Privacy.js +63 -3
- package/dist/Privacy.js.map +1 -1
- package/dist/RateLimiter.d.ts +104 -0
- package/dist/RateLimiter.d.ts.map +1 -0
- package/dist/RateLimiter.js +118 -0
- package/dist/RateLimiter.js.map +1 -0
- package/dist/RecoveryCode.d.ts +169 -0
- package/dist/RecoveryCode.d.ts.map +1 -0
- package/dist/RecoveryCode.js +299 -0
- package/dist/RecoveryCode.js.map +1 -0
- package/dist/RefreshToken.d.ts +222 -0
- package/dist/RefreshToken.d.ts.map +1 -0
- package/dist/RefreshToken.js +342 -0
- package/dist/RefreshToken.js.map +1 -0
- package/dist/SecurityTimeline.d.ts +72 -0
- package/dist/SecurityTimeline.d.ts.map +1 -0
- package/dist/SecurityTimeline.js +386 -0
- package/dist/SecurityTimeline.js.map +1 -0
- package/dist/Sessions.d.ts +135 -11
- package/dist/Sessions.d.ts.map +1 -1
- package/dist/Sessions.js +546 -1
- package/dist/Sessions.js.map +1 -1
- package/dist/StepUp.d.ts +44 -0
- package/dist/StepUp.d.ts.map +1 -0
- package/dist/StepUp.js +82 -0
- package/dist/StepUp.js.map +1 -0
- package/dist/Storage.d.ts +175 -0
- package/dist/Storage.d.ts.map +1 -0
- package/dist/Storage.js +27 -0
- package/dist/Storage.js.map +1 -0
- package/dist/StorageMigrations.d.ts +19 -0
- package/dist/StorageMigrations.d.ts.map +1 -0
- package/dist/StorageMigrations.js +291 -0
- package/dist/StorageMigrations.js.map +1 -0
- package/dist/Testing.d.ts +9 -1
- package/dist/Testing.d.ts.map +1 -1
- package/dist/Testing.js +30 -2
- package/dist/Testing.js.map +1 -1
- package/dist/Totp.d.ts +220 -0
- package/dist/Totp.d.ts.map +1 -0
- package/dist/Totp.js +477 -0
- package/dist/Totp.js.map +1 -0
- package/dist/TrustedDevice.d.ts +127 -0
- package/dist/TrustedDevice.d.ts.map +1 -0
- package/dist/TrustedDevice.js +252 -0
- package/dist/TrustedDevice.js.map +1 -0
- package/dist/WaitUntil.d.ts +3 -0
- package/dist/WaitUntil.d.ts.map +1 -1
- package/dist/WaitUntil.js +6 -3
- package/dist/WaitUntil.js.map +1 -1
- package/dist/Webhook.d.ts +72 -0
- package/dist/Webhook.d.ts.map +1 -0
- package/dist/Webhook.js +82 -0
- package/dist/Webhook.js.map +1 -0
- package/dist/alchemy/cloudflare/Email.d.ts +25 -0
- package/dist/alchemy/cloudflare/Email.d.ts.map +1 -0
- package/dist/alchemy/cloudflare/Email.js +117 -0
- package/dist/alchemy/cloudflare/Email.js.map +1 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts +34 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.js +30 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.js.map +1 -0
- package/dist/cloudflare/Email.d.ts +25 -0
- package/dist/cloudflare/Email.d.ts.map +1 -0
- package/dist/cloudflare/Email.js +153 -0
- package/dist/cloudflare/Email.js.map +1 -0
- package/dist/cloudflare/RateLimitDurableObject.d.ts +50 -0
- package/dist/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/cloudflare/RateLimitDurableObject.js +51 -0
- package/dist/cloudflare/RateLimitDurableObject.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/RateLimitDurableObject.d.ts +32 -0
- package/dist/internal/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/internal/RateLimitDurableObject.js +80 -0
- package/dist/internal/RateLimitDurableObject.js.map +1 -0
- package/migrations/0001_auth_storage.sql +32 -0
- package/migrations/0002_auth_password.sql +25 -0
- package/migrations/0003_auth_login_approval_review.sql +22 -0
- package/migrations/0004_auth_trusted_device.sql +12 -0
- package/migrations/0005_auth_passkey.sql +17 -0
- package/migrations/0006_auth_totp_factor.sql +17 -0
- package/migrations/0007_auth_recovery_code.sql +13 -0
- package/migrations/0008_auth_api_key.sql +17 -0
- package/migrations/0009_auth_refresh_token.sql +21 -0
- package/migrations/0010_auth_jwt_revocation.sql +8 -0
- package/migrations/0011_auth_oauth_account.sql +16 -0
- package/migrations/0012_auth_oauth_provider_token_vault.sql +20 -0
- package/migrations/0013_auth_security_timeline.sql +16 -0
- package/package.json +161 -16
- package/LICENSE +0 -21
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
create table if not exists auth_session (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
secret_hash text not null,
|
|
5
|
+
created_at integer not null,
|
|
6
|
+
expires_at integer not null,
|
|
7
|
+
auth_time integer not null,
|
|
8
|
+
aal text not null,
|
|
9
|
+
amr text not null,
|
|
10
|
+
mfa_verified_at integer,
|
|
11
|
+
metadata text,
|
|
12
|
+
revoked_at integer,
|
|
13
|
+
last_seen_at integer,
|
|
14
|
+
rotated_at integer
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
create index if not exists auth_session_user_id_idx on auth_session (user_id);
|
|
18
|
+
create index if not exists auth_session_expires_at_idx on auth_session (expires_at);
|
|
19
|
+
|
|
20
|
+
create table if not exists auth_verification (
|
|
21
|
+
id text primary key,
|
|
22
|
+
type text not null,
|
|
23
|
+
subject text not null,
|
|
24
|
+
secret_hash text,
|
|
25
|
+
created_at integer not null,
|
|
26
|
+
expires_at integer not null,
|
|
27
|
+
metadata text,
|
|
28
|
+
consumed_at integer
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
create index if not exists auth_verification_type_subject_idx on auth_verification (type, subject);
|
|
32
|
+
create index if not exists auth_verification_expires_at_idx on auth_verification (expires_at);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
create table if not exists auth_user (
|
|
2
|
+
id text primary key,
|
|
3
|
+
email text not null,
|
|
4
|
+
email_verified integer not null,
|
|
5
|
+
created_at integer not null,
|
|
6
|
+
updated_at integer not null,
|
|
7
|
+
disabled_at integer,
|
|
8
|
+
metadata text
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
create unique index if not exists auth_user_email_idx on auth_user (email);
|
|
12
|
+
|
|
13
|
+
create table if not exists auth_credential (
|
|
14
|
+
id text primary key,
|
|
15
|
+
user_id text not null,
|
|
16
|
+
type text not null,
|
|
17
|
+
password_hash text,
|
|
18
|
+
created_at integer not null,
|
|
19
|
+
updated_at integer not null,
|
|
20
|
+
revoked_at integer,
|
|
21
|
+
metadata text
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
create index if not exists auth_credential_user_id_idx on auth_credential (user_id);
|
|
25
|
+
create unique index if not exists auth_credential_user_type_idx on auth_credential (user_id, type);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
create table if not exists auth_login_approval_review (
|
|
2
|
+
approval_challenge_id text primary key,
|
|
3
|
+
flow_id text not null,
|
|
4
|
+
user_id text not null,
|
|
5
|
+
channel text not null,
|
|
6
|
+
reason text not null,
|
|
7
|
+
session_binding text not null,
|
|
8
|
+
same_device_required integer not null,
|
|
9
|
+
status text not null,
|
|
10
|
+
created_at integer not null,
|
|
11
|
+
expires_at integer not null,
|
|
12
|
+
reviewed_at integer,
|
|
13
|
+
reviewed_by text,
|
|
14
|
+
denied_reason text,
|
|
15
|
+
risk text,
|
|
16
|
+
metadata text,
|
|
17
|
+
review_metadata text
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
create index if not exists auth_login_approval_review_flow_id_idx on auth_login_approval_review (flow_id);
|
|
21
|
+
create index if not exists auth_login_approval_review_user_id_idx on auth_login_approval_review (user_id);
|
|
22
|
+
create index if not exists auth_login_approval_review_status_expires_at_idx on auth_login_approval_review (status, expires_at);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
create table if not exists auth_trusted_device (
|
|
2
|
+
user_id text not null,
|
|
3
|
+
token_hash text not null,
|
|
4
|
+
created_at integer not null,
|
|
5
|
+
last_seen_at integer not null,
|
|
6
|
+
expires_at integer not null,
|
|
7
|
+
metadata text,
|
|
8
|
+
primary key (user_id, token_hash)
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
create index if not exists auth_trusted_device_user_id_idx on auth_trusted_device (user_id);
|
|
12
|
+
create index if not exists auth_trusted_device_expires_at_idx on auth_trusted_device (expires_at);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
create table if not exists auth_passkey_credential (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
credential_id text not null,
|
|
5
|
+
public_key text not null,
|
|
6
|
+
sign_count integer not null,
|
|
7
|
+
transports text,
|
|
8
|
+
backed_up integer,
|
|
9
|
+
created_at integer not null,
|
|
10
|
+
last_used_at integer,
|
|
11
|
+
revoked_at integer,
|
|
12
|
+
metadata text
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
create unique index if not exists auth_passkey_credential_credential_id_idx on auth_passkey_credential (credential_id);
|
|
16
|
+
create index if not exists auth_passkey_credential_user_id_idx on auth_passkey_credential (user_id);
|
|
17
|
+
create index if not exists auth_passkey_credential_revoked_at_idx on auth_passkey_credential (revoked_at);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
create table if not exists auth_totp_factor (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
secret text not null,
|
|
5
|
+
algorithm text not null,
|
|
6
|
+
digits integer not null,
|
|
7
|
+
period integer not null,
|
|
8
|
+
created_at integer not null,
|
|
9
|
+
confirmed_at integer,
|
|
10
|
+
last_used_at integer,
|
|
11
|
+
revoked_at integer,
|
|
12
|
+
metadata text
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
create index if not exists auth_totp_factor_user_id_idx on auth_totp_factor (user_id);
|
|
16
|
+
create index if not exists auth_totp_factor_confirmed_at_idx on auth_totp_factor (confirmed_at);
|
|
17
|
+
create index if not exists auth_totp_factor_revoked_at_idx on auth_totp_factor (revoked_at);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
create table if not exists auth_recovery_code (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
code_hash text not null,
|
|
5
|
+
created_at integer not null,
|
|
6
|
+
used_at integer,
|
|
7
|
+
revoked_at integer,
|
|
8
|
+
metadata text
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
create index if not exists auth_recovery_code_user_id_idx on auth_recovery_code (user_id);
|
|
12
|
+
create index if not exists auth_recovery_code_used_at_idx on auth_recovery_code (used_at);
|
|
13
|
+
create index if not exists auth_recovery_code_revoked_at_idx on auth_recovery_code (revoked_at);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
create table if not exists auth_api_key (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
prefix text not null,
|
|
5
|
+
secret_hash text not null,
|
|
6
|
+
scopes text not null,
|
|
7
|
+
created_at integer not null,
|
|
8
|
+
expires_at integer,
|
|
9
|
+
last_used_at integer,
|
|
10
|
+
revoked_at integer,
|
|
11
|
+
metadata text
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
create unique index if not exists auth_api_key_prefix_idx on auth_api_key (prefix);
|
|
15
|
+
create index if not exists auth_api_key_user_id_idx on auth_api_key (user_id);
|
|
16
|
+
create index if not exists auth_api_key_expires_at_idx on auth_api_key (expires_at);
|
|
17
|
+
create index if not exists auth_api_key_revoked_at_idx on auth_api_key (revoked_at);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
create table if not exists auth_refresh_token (
|
|
2
|
+
id text primary key,
|
|
3
|
+
family_id text not null,
|
|
4
|
+
user_id text not null,
|
|
5
|
+
secret_hash text not null,
|
|
6
|
+
created_at integer not null,
|
|
7
|
+
expires_at integer not null,
|
|
8
|
+
last_used_at integer,
|
|
9
|
+
rotated_at integer,
|
|
10
|
+
replaced_by_id text,
|
|
11
|
+
revoked_at integer,
|
|
12
|
+
reuse_detected_at integer,
|
|
13
|
+
metadata text
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
create unique index if not exists auth_refresh_token_secret_hash_idx on auth_refresh_token (secret_hash);
|
|
17
|
+
create index if not exists auth_refresh_token_family_id_idx on auth_refresh_token (family_id);
|
|
18
|
+
create index if not exists auth_refresh_token_user_id_idx on auth_refresh_token (user_id);
|
|
19
|
+
create index if not exists auth_refresh_token_expires_at_idx on auth_refresh_token (expires_at);
|
|
20
|
+
create index if not exists auth_refresh_token_rotated_at_idx on auth_refresh_token (rotated_at);
|
|
21
|
+
create index if not exists auth_refresh_token_revoked_at_idx on auth_refresh_token (revoked_at);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
create table if not exists auth_oauth_account (
|
|
2
|
+
id text primary key,
|
|
3
|
+
provider_id text not null,
|
|
4
|
+
provider_account_id text not null,
|
|
5
|
+
user_id text not null,
|
|
6
|
+
email text,
|
|
7
|
+
email_verified integer,
|
|
8
|
+
created_at integer not null,
|
|
9
|
+
updated_at integer not null,
|
|
10
|
+
unlinked_at integer,
|
|
11
|
+
metadata text
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
create unique index if not exists auth_oauth_account_provider_account_idx on auth_oauth_account (provider_id, provider_account_id);
|
|
15
|
+
create index if not exists auth_oauth_account_user_id_idx on auth_oauth_account (user_id);
|
|
16
|
+
create index if not exists auth_oauth_account_unlinked_at_idx on auth_oauth_account (unlinked_at);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
create table if not exists auth_oauth_provider_token_vault (
|
|
2
|
+
account_id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
provider_id text not null,
|
|
5
|
+
provider_account_id text not null,
|
|
6
|
+
access_token_ciphertext text not null,
|
|
7
|
+
refresh_token_ciphertext text,
|
|
8
|
+
id_token_ciphertext text,
|
|
9
|
+
token_type text not null,
|
|
10
|
+
scopes text,
|
|
11
|
+
expires_at integer,
|
|
12
|
+
updated_at integer not null,
|
|
13
|
+
revoked_at integer,
|
|
14
|
+
revocation_reason text
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
create index if not exists auth_oauth_provider_token_vault_user_id_idx on auth_oauth_provider_token_vault (user_id);
|
|
18
|
+
create index if not exists auth_oauth_provider_token_vault_provider_account_idx on auth_oauth_provider_token_vault (provider_id, provider_account_id);
|
|
19
|
+
create index if not exists auth_oauth_provider_token_vault_expires_at_idx on auth_oauth_provider_token_vault (expires_at);
|
|
20
|
+
create index if not exists auth_oauth_provider_token_vault_revoked_at_idx on auth_oauth_provider_token_vault (revoked_at);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
create table if not exists auth_security_timeline (
|
|
2
|
+
id text primary key,
|
|
3
|
+
user_id text not null,
|
|
4
|
+
type text not null,
|
|
5
|
+
category text not null,
|
|
6
|
+
severity text not null,
|
|
7
|
+
occurred_at integer not null,
|
|
8
|
+
summary text not null,
|
|
9
|
+
actor text,
|
|
10
|
+
request text,
|
|
11
|
+
metadata text
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
create index if not exists auth_security_timeline_user_occurred_at_idx on auth_security_timeline (user_id, occurred_at);
|
|
15
|
+
create index if not exists auth_security_timeline_type_idx on auth_security_timeline (type);
|
|
16
|
+
create index if not exists auth_security_timeline_category_idx on auth_security_timeline (category);
|
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-auth/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
4
|
"description": "Composable Effect-first authentication primitives.",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*.d.ts",
|
|
8
|
+
"dist/**/*.d.ts.map",
|
|
9
|
+
"dist/**/*.js",
|
|
10
|
+
"dist/**/*.js.map",
|
|
11
|
+
"migrations/**/*.sql"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
7
14
|
"sideEffects": false,
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
},
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
17
|
"types": "./dist/index.d.ts",
|
|
14
18
|
"default": "./dist/index.js"
|
|
15
19
|
},
|
|
20
|
+
"./ApiKey": {
|
|
21
|
+
"types": "./dist/ApiKey.d.ts",
|
|
22
|
+
"default": "./dist/ApiKey.js"
|
|
23
|
+
},
|
|
16
24
|
"./AuditLog": {
|
|
17
25
|
"types": "./dist/AuditLog.d.ts",
|
|
18
26
|
"default": "./dist/AuditLog.js"
|
|
@@ -21,22 +29,98 @@
|
|
|
21
29
|
"types": "./dist/AuthFlow.d.ts",
|
|
22
30
|
"default": "./dist/AuthFlow.js"
|
|
23
31
|
},
|
|
32
|
+
"./AuthConfig": {
|
|
33
|
+
"types": "./dist/AuthConfig.d.ts",
|
|
34
|
+
"default": "./dist/AuthConfig.js"
|
|
35
|
+
},
|
|
36
|
+
"./AuthKernel": {
|
|
37
|
+
"types": "./dist/AuthKernel.d.ts",
|
|
38
|
+
"default": "./dist/AuthKernel.js"
|
|
39
|
+
},
|
|
24
40
|
"./Challenge": {
|
|
25
41
|
"types": "./dist/Challenge.d.ts",
|
|
26
42
|
"default": "./dist/Challenge.js"
|
|
27
43
|
},
|
|
44
|
+
"./AlchemyCloudflareRateLimitDurableObject": {
|
|
45
|
+
"types": "./dist/alchemy/cloudflare/RateLimitDurableObject.d.ts",
|
|
46
|
+
"default": "./dist/alchemy/cloudflare/RateLimitDurableObject.js"
|
|
47
|
+
},
|
|
48
|
+
"./AlchemyCloudflareEmail": {
|
|
49
|
+
"types": "./dist/alchemy/cloudflare/Email.d.ts",
|
|
50
|
+
"default": "./dist/alchemy/cloudflare/Email.js"
|
|
51
|
+
},
|
|
52
|
+
"./CloudflareRateLimitDurableObject": {
|
|
53
|
+
"types": "./dist/cloudflare/RateLimitDurableObject.d.ts",
|
|
54
|
+
"default": "./dist/cloudflare/RateLimitDurableObject.js"
|
|
55
|
+
},
|
|
56
|
+
"./CloudflareEmail": {
|
|
57
|
+
"types": "./dist/cloudflare/Email.d.ts",
|
|
58
|
+
"default": "./dist/cloudflare/Email.js"
|
|
59
|
+
},
|
|
60
|
+
"./Client": {
|
|
61
|
+
"types": "./dist/Client.d.ts",
|
|
62
|
+
"default": "./dist/Client.js"
|
|
63
|
+
},
|
|
28
64
|
"./Crypto": {
|
|
29
65
|
"types": "./dist/Crypto.d.ts",
|
|
30
66
|
"default": "./dist/Crypto.js"
|
|
31
67
|
},
|
|
68
|
+
"./EffectQbSqliteStorage": {
|
|
69
|
+
"types": "./dist/EffectQbSqliteStorage.d.ts",
|
|
70
|
+
"default": "./dist/EffectQbSqliteStorage.js"
|
|
71
|
+
},
|
|
72
|
+
"./EmailOtp": {
|
|
73
|
+
"types": "./dist/EmailOtp.d.ts",
|
|
74
|
+
"default": "./dist/EmailOtp.js"
|
|
75
|
+
},
|
|
76
|
+
"./EmailVerification": {
|
|
77
|
+
"types": "./dist/EmailVerification.d.ts",
|
|
78
|
+
"default": "./dist/EmailVerification.js"
|
|
79
|
+
},
|
|
32
80
|
"./WaitUntil": {
|
|
33
81
|
"types": "./dist/WaitUntil.d.ts",
|
|
34
82
|
"default": "./dist/WaitUntil.js"
|
|
35
83
|
},
|
|
84
|
+
"./Webhook": {
|
|
85
|
+
"types": "./dist/Webhook.d.ts",
|
|
86
|
+
"default": "./dist/Webhook.js"
|
|
87
|
+
},
|
|
36
88
|
"./Identifiers": {
|
|
37
89
|
"types": "./dist/Identifiers.d.ts",
|
|
38
90
|
"default": "./dist/Identifiers.js"
|
|
39
91
|
},
|
|
92
|
+
"./LoginApproval": {
|
|
93
|
+
"types": "./dist/LoginApproval.d.ts",
|
|
94
|
+
"default": "./dist/LoginApproval.js"
|
|
95
|
+
},
|
|
96
|
+
"./LoginNotification": {
|
|
97
|
+
"types": "./dist/LoginNotification.d.ts",
|
|
98
|
+
"default": "./dist/LoginNotification.js"
|
|
99
|
+
},
|
|
100
|
+
"./LoginRisk": {
|
|
101
|
+
"types": "./dist/LoginRisk.d.ts",
|
|
102
|
+
"default": "./dist/LoginRisk.js"
|
|
103
|
+
},
|
|
104
|
+
"./Jwt": {
|
|
105
|
+
"types": "./dist/Jwt.d.ts",
|
|
106
|
+
"default": "./dist/Jwt.js"
|
|
107
|
+
},
|
|
108
|
+
"./HttpApi": {
|
|
109
|
+
"types": "./dist/HttpApi.d.ts",
|
|
110
|
+
"default": "./dist/HttpApi.js"
|
|
111
|
+
},
|
|
112
|
+
"./Mailer": {
|
|
113
|
+
"types": "./dist/Mailer.d.ts",
|
|
114
|
+
"default": "./dist/Mailer.js"
|
|
115
|
+
},
|
|
116
|
+
"./MagicLink": {
|
|
117
|
+
"types": "./dist/MagicLink.d.ts",
|
|
118
|
+
"default": "./dist/MagicLink.js"
|
|
119
|
+
},
|
|
120
|
+
"./OAuth": {
|
|
121
|
+
"types": "./dist/OAuth.d.ts",
|
|
122
|
+
"default": "./dist/OAuth.js"
|
|
123
|
+
},
|
|
40
124
|
"./Policy": {
|
|
41
125
|
"types": "./dist/Policy.d.ts",
|
|
42
126
|
"default": "./dist/Policy.js"
|
|
@@ -45,31 +129,92 @@
|
|
|
45
129
|
"types": "./dist/Privacy.d.ts",
|
|
46
130
|
"default": "./dist/Privacy.js"
|
|
47
131
|
},
|
|
132
|
+
"./RateLimiter": {
|
|
133
|
+
"types": "./dist/RateLimiter.d.ts",
|
|
134
|
+
"default": "./dist/RateLimiter.js"
|
|
135
|
+
},
|
|
136
|
+
"./RecoveryCode": {
|
|
137
|
+
"types": "./dist/RecoveryCode.d.ts",
|
|
138
|
+
"default": "./dist/RecoveryCode.js"
|
|
139
|
+
},
|
|
140
|
+
"./RefreshToken": {
|
|
141
|
+
"types": "./dist/RefreshToken.d.ts",
|
|
142
|
+
"default": "./dist/RefreshToken.js"
|
|
143
|
+
},
|
|
144
|
+
"./Password": {
|
|
145
|
+
"types": "./dist/Password.d.ts",
|
|
146
|
+
"default": "./dist/Password.js"
|
|
147
|
+
},
|
|
148
|
+
"./Passkey": {
|
|
149
|
+
"types": "./dist/Passkey.d.ts",
|
|
150
|
+
"default": "./dist/Passkey.js"
|
|
151
|
+
},
|
|
152
|
+
"./PasskeySimpleWebAuthn": {
|
|
153
|
+
"types": "./dist/PasskeySimpleWebAuthn.d.ts",
|
|
154
|
+
"default": "./dist/PasskeySimpleWebAuthn.js"
|
|
155
|
+
},
|
|
48
156
|
"./Sessions": {
|
|
49
157
|
"types": "./dist/Sessions.d.ts",
|
|
50
158
|
"default": "./dist/Sessions.js"
|
|
51
159
|
},
|
|
160
|
+
"./SecurityTimeline": {
|
|
161
|
+
"types": "./dist/SecurityTimeline.d.ts",
|
|
162
|
+
"default": "./dist/SecurityTimeline.js"
|
|
163
|
+
},
|
|
164
|
+
"./Storage": {
|
|
165
|
+
"types": "./dist/Storage.d.ts",
|
|
166
|
+
"default": "./dist/Storage.js"
|
|
167
|
+
},
|
|
168
|
+
"./StepUp": {
|
|
169
|
+
"types": "./dist/StepUp.d.ts",
|
|
170
|
+
"default": "./dist/StepUp.js"
|
|
171
|
+
},
|
|
172
|
+
"./StorageMigrations": {
|
|
173
|
+
"types": "./dist/StorageMigrations.d.ts",
|
|
174
|
+
"default": "./dist/StorageMigrations.js"
|
|
175
|
+
},
|
|
52
176
|
"./Testing": {
|
|
53
177
|
"types": "./dist/Testing.d.ts",
|
|
54
178
|
"default": "./dist/Testing.js"
|
|
55
179
|
},
|
|
180
|
+
"./Totp": {
|
|
181
|
+
"types": "./dist/Totp.d.ts",
|
|
182
|
+
"default": "./dist/Totp.js"
|
|
183
|
+
},
|
|
184
|
+
"./TrustedDevice": {
|
|
185
|
+
"types": "./dist/TrustedDevice.d.ts",
|
|
186
|
+
"default": "./dist/TrustedDevice.js"
|
|
187
|
+
},
|
|
56
188
|
"./package.json": {
|
|
57
189
|
"default": "./package.json"
|
|
58
190
|
}
|
|
59
191
|
},
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"dist/**/*.d.ts.map",
|
|
63
|
-
"dist/**/*.js",
|
|
64
|
-
"dist/**/*.js.map"
|
|
65
|
-
],
|
|
66
|
-
"peerDependencies": {
|
|
67
|
-
"effect": "^4.0.0-beta.67"
|
|
192
|
+
"publishConfig": {
|
|
193
|
+
"access": "public"
|
|
68
194
|
},
|
|
69
195
|
"scripts": {
|
|
70
196
|
"build": "tsc -b",
|
|
71
|
-
"check": "tsc -b --pretty false &&
|
|
72
|
-
"
|
|
197
|
+
"check": "tsc -b --pretty false && bun run type-test && bun run test-type",
|
|
198
|
+
"prepack": "rm -rf dist && bun run build",
|
|
199
|
+
"test": "bun run build && bun --bun vitest run --config ../../vitest.config.ts",
|
|
200
|
+
"test-type": "tsc -p tsconfig.test.json --pretty false",
|
|
73
201
|
"type-test": "tsc -p tsconfig.type-tests.json --pretty false"
|
|
202
|
+
},
|
|
203
|
+
"peerDependencies": {
|
|
204
|
+
"@simplewebauthn/server": "^13.3.1",
|
|
205
|
+
"alchemy": ">=2.0.0-beta.44 <3",
|
|
206
|
+
"effect": "^4.0.0-beta.67",
|
|
207
|
+
"effect-qb": "4.0.0-beta.66"
|
|
208
|
+
},
|
|
209
|
+
"peerDependenciesMeta": {
|
|
210
|
+
"@simplewebauthn/server": {
|
|
211
|
+
"optional": true
|
|
212
|
+
},
|
|
213
|
+
"alchemy": {
|
|
214
|
+
"optional": true
|
|
215
|
+
},
|
|
216
|
+
"effect-qb": {
|
|
217
|
+
"optional": true
|
|
218
|
+
}
|
|
74
219
|
}
|
|
75
|
-
}
|
|
220
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Effect Auth contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|