go-ssb-room/admindb/interface.go

37 lines
1.1 KiB
Go

// SPDX-License-Identifier: MIT
package admindb
import (
"context"
"go.mindeco.de/http/auth"
)
// AuthFallbackService might be helpful for scenarios where one lost access to his ssb device or key
type AuthFallbackService interface {
auth.Auther
Create(ctx context.Context, user string, password []byte) error
GetByID(ctx context.Context, uid int64) (*User, error)
}
// AuthWithSSBService defines functions needed for the challange/response system of sign-in with ssb
type AuthWithSSBService interface{}
// RoomService deals with changing the privacy modes and managing the allow/deny lists of the room
type RoomService interface{}
// AliasService manages alias handle registration and lookup
type AliasService interface{}
// for tests we use generated mocks from these interfaces created with https://github.com/maxbrunsfeld/counterfeiter
//go:generate counterfeiter -o mockdb/auth.go . AuthWithSSBService
//go:generate counterfeiter -o mockdb/auth_fallback.go . AuthFallbackService
//go:generate counterfeiter -o mockdb/room.go . RoomService
//go:generate counterfeiter -o mockdb/alias.go . AliasService