webauthn.go 648 B

1234567891011121314151617181920212223242526
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. import (
  5. "encoding/hex"
  6. "time"
  7. "github.com/go-webauthn/webauthn/webauthn"
  8. )
  9. type WebAuthnCredential struct {
  10. Credential webauthn.Credential
  11. Name string
  12. AddedOn *time.Time
  13. LastSeenOn *time.Time
  14. Handle []byte
  15. // False for rows predating the backup_eligible column; the login handler backfills from the assertion on first use.
  16. BackupEligibleKnown bool
  17. }
  18. func (s WebAuthnCredential) HandleEncoded() string {
  19. return hex.EncodeToString(s.Handle)
  20. }