Documentation
¶
Overview ¶
Package passkeyexample demonstrates application-owned credential persistence. Package passkeyexample 演示应用自行管理的凭据持久化。
Index ¶
- type Store
- func (s *Store) Delete(ctx context.Context, id, userID string) (bool, error)
- func (s *Store) Get(ctx context.Context, id string) (passkey.Credential, bool, error)
- func (s *Store) Insert(ctx context.Context, c passkey.Credential) error
- func (s *Store) List(ctx context.Context, id string) ([]passkey.Credential, error)
- func (s *Store) Rename(ctx context.Context, id, userID, name string) (bool, error)
- func (s *Store) UpdateUsage(ctx context.Context, id, userID string, a webauthn.Authenticator, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
Store uses schema.sql. The application owns DB and fixes RPID at construction. Store 使用 schema.sql。应用负责 DB 生命周期,并在构造时固定 RPID。
func (*Store) Insert ¶
Insert preserves credential ownership by rejecting duplicate IDs. Insert 拒绝重复 ID,保证凭据归属不变。
func (*Store) UpdateUsage ¶
func (s *Store) UpdateUsage(ctx context.Context, id, userID string, a webauthn.Authenticator, flags webauthn.CredentialFlags, at time.Time) (bool, error)
UpdateUsage locks the existing row and preserves its key, owner, and name. UpdateUsage 锁定现有记录,并保留其密钥、所有者和名称。