Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserNotFound = echo.NewHTTPError(http.StatusNotFound, "user not found")
View Source
var Sessions = map[string]*webauthn.SessionData{}
View Source
var Users = map[string]*User{}
Functions ¶
func GetSession ¶
func GetSession(id string) (*webauthn.SessionData, error)
func InsertSession ¶
func InsertSession(id string, session *webauthn.SessionData)
func InsertUser ¶
func RandomString ¶
Types ¶
type Handler ¶
func (*Handler) BeginCreateHandler ¶
WebAuthnを新規に登録するためのチャレンジを返す。 ユーザーとセッションはDBに保存し、クッキーにセッションIDを保存している。
func (*Handler) BeginLoginHandler ¶
ログイン用のチャレンジを返す ログインページで毎回生成する。 セッションはDBに保存して、IDをクッキーに保存している。
func (*Handler) CreateHandler ¶
WebAuthのクレデンシャルを検証して成功の場合は、新規にクレデンシャルを登録する。 CookieからセッションIDを取得し、DBからユーザーとセッションを取得する。
func (*Handler) DebugDatabase ¶
func (*Handler) LoginHandler ¶
type User ¶
type User struct { ID []byte `json:"id"` Name string `json:"name"` DisplayName string `json:"display_name,omitempty"` Credentials []webauthn.Credential `json:"-"` }
func GetUserById ¶
func (*User) WebAuthnCredentials ¶
func (u *User) WebAuthnCredentials() []webauthn.Credential
func (*User) WebAuthnDisplayName ¶
func (*User) WebAuthnID ¶
func (*User) WebAuthnIcon ¶
func (*User) WebAuthnName ¶
Click to show internal directories.
Click to hide internal directories.