1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Support webauthn (#17957)

Migrate from U2F to Webauthn

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2022-01-14 23:03:31 +08:00
committed by GitHub
parent 8808293247
commit 35c3553870
224 changed files with 35040 additions and 1079 deletions

View File

@ -10,7 +10,7 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"github.com/golang-jwt/jwt"
"github.com/golang-jwt/jwt/v4"
)
// ___________ __
@ -37,6 +37,7 @@ type Token struct {
GrantID int64 `json:"gnt"`
Type TokenType `json:"tt"`
Counter int64 `json:"cnt,omitempty"`
// FIXME: Migrate to registered claims
jwt.StandardClaims
}
@ -69,6 +70,7 @@ func (token *Token) SignToken(signingKey JWTSigningKey) (string, error) {
// OIDCToken represents an OpenID Connect id_token
type OIDCToken struct {
// FIXME: Migrate to RegisteredClaims
jwt.StandardClaims
Nonce string `json:"nonce,omitempty"`