[feature] add TOTP two-factor authentication (2FA) (#3960)

* [feature] add TOTP two-factor authentication (2FA)

* use byteutil.S2B to avoid allocations when comparing + generating password hashes

* don't bother with string conversion  for consts

* use io.ReadFull

* use MustGenerateSecret for backup codes

* rename util functions
This commit is contained in:
tobi 2025-04-07 16:14:41 +02:00 committed by GitHub
commit 365b575341
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 5593 additions and 825 deletions

11
vendor/modules.txt vendored
View file

@ -297,6 +297,11 @@ github.com/aymerick/douceur/parser
# github.com/beorn7/perks v1.0.1
## explicit; go 1.11
github.com/beorn7/perks/quantile
# github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc
## explicit
github.com/boombuler/barcode
github.com/boombuler/barcode/qr
github.com/boombuler/barcode/utils
# github.com/buckket/go-blurhash v1.1.0
## explicit; go 1.14
github.com/buckket/go-blurhash
@ -730,6 +735,12 @@ github.com/pkg/errors
# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
## explicit
github.com/pmezard/go-difflib/difflib
# github.com/pquerna/otp v1.4.0
## explicit; go 1.12
github.com/pquerna/otp
github.com/pquerna/otp/hotp
github.com/pquerna/otp/internal
github.com/pquerna/otp/totp
# github.com/prometheus/client_golang v1.21.1
## explicit; go 1.21
github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil