auth: publish passkey foundations preview
verify / verify (push) Successful in 3m40s

This commit is contained in:
2026-08-21 17:33:00 -04:00
parent fb6bbd0dad
commit bfe6cfd29e
230 changed files with 44547 additions and 17 deletions
+28
View File
@@ -43,11 +43,39 @@ func TestRevokeSessionRejectsInvalidTokenBeforeStorage(t *testing.T) {
}
}
func TestIssueSessionRejectsInactiveRepositoryPrincipal(t *testing.T) {
repository := &activeSessionRepository{principal: Principal{User: User{ID: "valid-user-id", Status: "disabled"}}}
service, err := New(repository, Options{})
if err != nil {
t.Fatal(err)
}
if _, _, err = service.IssueSession(t.Context(), "valid-user-id", time.Hour); !errors.Is(err, ErrInactiveUser) {
t.Fatalf("err=%v", err)
}
if !repository.deleted {
t.Fatal("inactive session was not deleted")
}
}
type recordingRepository struct {
repositoryStub
deleted bool
}
type activeSessionRepository struct {
repositoryStub
principal Principal
deleted bool
}
func (repository *activeSessionRepository) PrincipalBySession(context.Context, [32]byte, time.Time) (Principal, Session, error) {
return repository.principal, Session{}, nil
}
func (repository *activeSessionRepository) DeleteSession(context.Context, [32]byte) error {
repository.deleted = true
return nil
}
func (repository *recordingRepository) DeleteSession(context.Context, [32]byte) error {
repository.deleted = true
return nil