Skip to content

Conversation

Bewinxed
Copy link
Collaborator

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

type LastWebAuthnChallengeData = {
    challenge: ChallengeData,
} & {
  type: "create"
  credential_response: ParsedCredentialCreationData
} | {
  type: "request"
  credential_response: ParsedCredentialAssertionData
}



@Bewinxed Bewinxed requested a review from a team as a code owner September 25, 2025 11:45
@coveralls
Copy link

coveralls commented Sep 25, 2025

Pull Request Test Coverage Report for Build 18012303612

Details

  • 4 of 46 (8.7%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 67.633%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/mfa.go 0 11 0.0%
internal/models/factor.go 4 35 11.43%
Totals Coverage Status
Change from base Build 17984690409: -0.1%
Covered Lines: 13246
Relevant Lines: 19585

💛 - Coveralls

@hf hf merged commit 01ebce1 into master Sep 25, 2025
6 checks passed
@hf hf deleted the bewinxed/webauthn-persist-latest-attestation branch September 25, 2025 16:25
issuedat pushed a commit that referenced this pull request Sep 30, 2025
## 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants