Commit 01ebce1
feat: store latest challenge/attestation data (#2179)
## What kind of change does this PR introduce?
Feature - Store WebAuthn challenge data for customer verification
purposes
## What is the current behavior?
Currently, WebAuthn challenge data (attestation/assertion responses) is
not persisted after verification, making it impossible for customers to
review or audit the WebAuthn authentication details.
## What is the new behavior?
- Added `last_webauthn_challenge_data` JSONB column to `mfa_factors`
table to store the latest challenge verification data
- The system now stores the challenge, type (create/request), and parsed
credential response after successful WebAuthn verification, THEN deletes
the challenge like before.
## Additional context
The structure for the JSONb would be like so, based on whether it's a
`create` or `request` webauthn operation
```typescript
type LastWebAuthnChallengeData = {
challenge: ChallengeData,
} & {
type: "create"
credential_response: ParsedCredentialCreationData
} | {
type: "request"
credential_response: ParsedCredentialAssertionData
}
```
---------
Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>1 parent 1731466 commit 01ebce1
3 files changed
Lines changed: 81 additions & 21 deletions
File tree
- internal
- api
- models
- migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | 909 | | |
| 910 | + | |
914 | 911 | | |
915 | 912 | | |
916 | | - | |
| 913 | + | |
917 | 914 | | |
918 | 915 | | |
919 | 916 | | |
920 | | - | |
| 917 | + | |
921 | 918 | | |
922 | 919 | | |
923 | 920 | | |
924 | 921 | | |
925 | 922 | | |
926 | | - | |
| 923 | + | |
927 | 924 | | |
928 | 925 | | |
929 | 926 | | |
930 | | - | |
| 927 | + | |
931 | 928 | | |
932 | 929 | | |
933 | 930 | | |
934 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
935 | 937 | | |
936 | 938 | | |
937 | 939 | | |
| |||
951 | 953 | | |
952 | 954 | | |
953 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
954 | 960 | | |
955 | 961 | | |
956 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
168 | 203 | | |
169 | 204 | | |
170 | 205 | | |
| |||
265 | 300 | | |
266 | 301 | | |
267 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
268 | 318 | | |
269 | 319 | | |
270 | 320 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments