@@ -7,6 +7,191 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
8
## [ Unreleased]
9
9
10
+ ## [ 10.1.0]
11
+
12
+ - Adds Webauthn (Passkeys) support to core
13
+ - Adds APIs:
14
+ - GET ` /recipe/webauthn/user/credential/ `
15
+ - GET ` /recipe/webauthn/user/credential/list `
16
+ - GET ` /recipe/webauthn/options `
17
+ - GET ` /recipe/webauthn/user/recover `
18
+ - POST ` /recipe/webauthn/options/register `
19
+ - POST ` /recipe/webauthn/options/signin `
20
+ - POST ` /recipe/webauthn/user/credential/register `
21
+ - POST ` /recipe/webauthn/signup `
22
+ - POST ` /recipe/webauthn/signin `
23
+ - POST ` /recipe/webauthn/user/recover/token `
24
+ - POST ` /recipe/webauthn/user/recover/token/consume `
25
+ - PUT ` /recipe/webauthn/user/email `
26
+ - DELETE ` /recipe/webauthn/user/credential/remove `
27
+ - DELETE ` /recipe/webauthn/options/remove `
28
+ - Adds additional indexing for ` emailverification_verified_emails `
29
+
30
+ ### Migration
31
+
32
+ If using PostgreSQL, run the following SQL script:
33
+
34
+ ``` sql
35
+
36
+ CREATE INDEX IF NOT EXISTS emailverification_verified_emails_app_id_email_index ON emailverification_verified_emails
37
+ (app_id, email);
38
+
39
+ CREATE TABLE IF NOT EXISTS webauthn_account_recovery_tokens (
40
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
41
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
42
+ user_id CHAR (36 ) NOT NULL ,
43
+ email VARCHAR (256 ) NOT NULL ,
44
+ token VARCHAR (256 ) NOT NULL ,
45
+ expires_at BIGINT NOT NULL ,
46
+ CONSTRAINT webauthn_account_recovery_token_pkey PRIMARY KEY (app_id, tenant_id, user_id, token),
47
+ CONSTRAINT webauthn_account_recovery_token_user_id_fkey FOREIGN KEY (app_id, tenant_id, user_id) REFERENCES
48
+ all_auth_recipe_users(app_id, tenant_id, user_id) ON DELETE CASCADE
49
+ );
50
+
51
+ CREATE TABLE IF NOT EXISTS webauthn_credentials (
52
+ id VARCHAR (256 ) NOT NULL ,
53
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
54
+ rp_id VARCHAR (256 ) NOT NULL ,
55
+ user_id CHAR (36 ),
56
+ counter BIGINT NOT NULL ,
57
+ public_key BYTEA NOT NULL ,
58
+ transports TEXT NOT NULL ,
59
+ created_at BIGINT NOT NULL ,
60
+ updated_at BIGINT NOT NULL ,
61
+ CONSTRAINT webauthn_credentials_pkey PRIMARY KEY (app_id, rp_id, id),
62
+ CONSTRAINT webauthn_credentials_user_id_fkey FOREIGN KEY (app_id, user_id) REFERENCES webauthn_users
63
+ (app_id, user_id) ON DELETE CASCADE
64
+ );
65
+
66
+ CREATE TABLE IF NOT EXISTS webauthn_generated_options (
67
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
68
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
69
+ id CHAR (36 ) NOT NULL ,
70
+ challenge VARCHAR (256 ) NOT NULL ,
71
+ email VARCHAR (256 ),
72
+ rp_id VARCHAR (256 ) NOT NULL ,
73
+ rp_name VARCHAR (256 ) NOT NULL ,
74
+ origin VARCHAR (256 ) NOT NULL ,
75
+ expires_at BIGINT NOT NULL ,
76
+ created_at BIGINT NOT NULL ,
77
+ user_presence_required BOOLEAN DEFAULT false NOT NULL ,
78
+ user_verification VARCHAR (12 ) DEFAULT ' preferred' NOT NULL ,
79
+ CONSTRAINT webauthn_generated_options_pkey PRIMARY KEY (app_id, tenant_id, id),
80
+ CONSTRAINT webauthn_generated_options_tenant_id_fkey FOREIGN KEY (app_id, tenant_id) REFERENCES tenants
81
+ (app_id, tenant_id) ON DELETE CASCADE
82
+ );
83
+
84
+ CREATE TABLE IF NOT EXISTS webauthn_user_to_tenant (
85
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
86
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
87
+ user_id CHAR (36 ) NOT NULL ,
88
+ email VARCHAR (256 ) NOT NULL ,
89
+ CONSTRAINT webauthn_user_to_tenant_email_key UNIQUE (app_id, tenant_id, email),
90
+ CONSTRAINT webauthn_user_to_tenant_pkey PRIMARY KEY (app_id, tenant_id, user_id),
91
+ CONSTRAINT webauthn_user_to_tenant_user_id_fkey FOREIGN KEY (app_id, tenant_id, user_id) REFERENCES
92
+ all_auth_recipe_users(app_id, tenant_id, user_id) ON DELETE CASCADE
93
+ );
94
+
95
+ CREATE TABLE IF NOT EXISTS webauthn_users (
96
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
97
+ user_id CHAR (36 ) NOT NULL ,
98
+ email VARCHAR (256 ) NOT NULL ,
99
+ rp_id VARCHAR (256 ) NOT NULL ,
100
+ time_joined BIGINT NOT NULL ,
101
+ CONSTRAINT webauthn_users_pkey PRIMARY KEY (app_id, user_id),
102
+ CONSTRAINT webauthn_users_user_id_fkey FOREIGN KEY (app_id, user_id) REFERENCES app_id_to_user_id(app_id,
103
+ user_id) ON DELETE CASCADE
104
+ );
105
+
106
+ CREATE INDEX IF NOT EXISTS webauthn_user_to_tenant_email_index ON webauthn_user_to_tenant (app_id, email);
107
+ CREATE INDEX IF NOT EXISTS webauthn_user_challenges_expires_at_index ON webauthn_generated_options (app_id, tenant_id, expires_at);
108
+ CREATE INDEX IF NOT EXISTS webauthn_credentials_user_id_index ON webauthn_credentials (user_id);
109
+ CREATE INDEX IF NOT EXISTS webauthn_account_recovery_token_token_index ON webauthn_account_recovery_tokens (app_id, tenant_id, token);
110
+ CREATE INDEX IF NOT EXISTS webauthn_account_recovery_token_expires_at_index ON webauthn_account_recovery_tokens (expires_at DESC );
111
+ CREATE INDEX IF NOT EXISTS webauthn_account_recovery_token_email_index ON webauthn_account_recovery_tokens (app_id, tenant_id, email);
112
+ ```
113
+
114
+ If using MySQL, run the following SQL script:
115
+
116
+ ``` sql
117
+ CREATE INDEX emailverification_verified_emails_app_id_email_index ON emailverification_verified_emails
118
+ (app_id, email);
119
+
120
+ CREATE TABLE IF NOT EXISTS webauthn_account_recovery_tokens (
121
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
122
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
123
+ user_id CHAR (36 ) NOT NULL ,
124
+ email VARCHAR (256 ) NOT NULL ,
125
+ token VARCHAR (256 ) NOT NULL ,
126
+ expires_at BIGINT NOT NULL ,
127
+ CONSTRAINT webauthn_account_recovery_token_pkey PRIMARY KEY (app_id, tenant_id, user_id, token),
128
+ CONSTRAINT webauthn_account_recovery_token_user_id_fkey FOREIGN KEY (app_id, tenant_id, user_id) REFERENCES
129
+ all_auth_recipe_users(app_id, tenant_id, user_id) ON DELETE CASCADE
130
+ );
131
+
132
+ CREATE TABLE IF NOT EXISTS webauthn_credentials (
133
+ id VARCHAR (256 ) NOT NULL ,
134
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
135
+ rp_id VARCHAR (256 ) NOT NULL ,
136
+ user_id CHAR (36 ),
137
+ counter BIGINT NOT NULL ,
138
+ public_key BLOB NOT NULL ,
139
+ transports TEXT NOT NULL ,
140
+ created_at BIGINT NOT NULL ,
141
+ updated_at BIGINT NOT NULL ,
142
+ CONSTRAINT webauthn_credentials_pkey PRIMARY KEY (app_id, rp_id, id),
143
+ CONSTRAINT webauthn_credentials_user_id_fkey FOREIGN KEY (app_id, user_id) REFERENCES webauthn_users
144
+ (app_id, user_id) ON DELETE CASCADE
145
+ );
146
+
147
+ CREATE TABLE IF NOT EXISTS webauthn_generated_options (
148
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
149
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
150
+ id CHAR (36 ) NOT NULL ,
151
+ challenge VARCHAR (256 ) NOT NULL ,
152
+ email VARCHAR (256 ),
153
+ rp_id VARCHAR (256 ) NOT NULL ,
154
+ rp_name VARCHAR (256 ) NOT NULL ,
155
+ origin VARCHAR (256 ) NOT NULL ,
156
+ expires_at BIGINT NOT NULL ,
157
+ created_at BIGINT NOT NULL ,
158
+ user_presence_required BOOLEAN DEFAULT false NOT NULL ,
159
+ user_verification VARCHAR (12 ) DEFAULT ' preferred' NOT NULL ,
160
+ CONSTRAINT webauthn_generated_options_pkey PRIMARY KEY (app_id, tenant_id, id),
161
+ CONSTRAINT webauthn_generated_options_tenant_id_fkey FOREIGN KEY (app_id, tenant_id) REFERENCES tenants
162
+ (app_id, tenant_id) ON DELETE CASCADE
163
+ );
164
+
165
+ CREATE TABLE IF NOT EXISTS webauthn_user_to_tenant (
166
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
167
+ tenant_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
168
+ user_id CHAR (36 ) NOT NULL ,
169
+ email VARCHAR (256 ) NOT NULL ,
170
+ CONSTRAINT webauthn_user_to_tenant_email_key UNIQUE (app_id, tenant_id, email),
171
+ CONSTRAINT webauthn_user_to_tenant_pkey PRIMARY KEY (app_id, tenant_id, user_id),
172
+ CONSTRAINT webauthn_user_to_tenant_user_id_fkey FOREIGN KEY (app_id, tenant_id, user_id) REFERENCES
173
+ all_auth_recipe_users(app_id, tenant_id, user_id) ON DELETE CASCADE
174
+ );
175
+
176
+ CREATE TABLE IF NOT EXISTS webauthn_users (
177
+ app_id VARCHAR (64 ) DEFAULT ' public' NOT NULL ,
178
+ user_id CHAR (36 ) NOT NULL ,
179
+ email VARCHAR (256 ) NOT NULL ,
180
+ rp_id VARCHAR (256 ) NOT NULL ,
181
+ time_joined BIGINT NOT NULL ,
182
+ CONSTRAINT webauthn_users_pkey PRIMARY KEY (app_id, user_id),
183
+ CONSTRAINT webauthn_users_user_id_fkey FOREIGN KEY (app_id, user_id) REFERENCES app_id_to_user_id (app_id,
184
+ user_id) ON DELETE CASCADE
185
+ );
186
+
187
+ CREATE INDEX webauthn_user_to_tenant_email_index ON webauthn_user_to_tenant (app_id, email);
188
+ CREATE INDEX webauthn_user_challenges_expires_at_index ON webauthn_generated_options (app_id, tenant_id, expires_at);
189
+ CREATE INDEX webauthn_credentials_user_id_index ON webauthn_credentials (user_id);
190
+ CREATE INDEX webauthn_account_recovery_token_token_index ON webauthn_account_recovery_tokens (app_id, tenant_id, token);
191
+ CREATE INDEX webauthn_account_recovery_token_expires_at_index ON webauthn_account_recovery_tokens (expires_at DESC );
192
+ CREATE INDEX webauthn_account_recovery_token_email_index ON webauthn_account_recovery_tokens (app_id, tenant_id, email);
193
+ ```
194
+
10
195
## [ 10.0.3]
11
196
12
197
- Fixes ` StorageTransactionLogicException ` in bulk import when not using userRoles and totpDevices in import json.
0 commit comments