go-ssb-room/admindb/interface.go

32 lines
1001 B
Go
Raw Normal View History

2021-02-08 11:57:14 +00:00
package admindb
import (
"go.mindeco.de/http/auth"
)
2021-02-08 16:47:42 +00:00
// AuthFallbackService might be helpful for scenarios where one lost access to his ssb device or key
type AuthFallbackService interface {
2021-02-08 11:57:14 +00:00
auth.Auther
2021-02-08 16:47:42 +00:00
Create(user string, password []byte) error
2021-02-08 11:57:14 +00:00
}
2021-02-08 16:47:42 +00:00
// AuthWithSSBService defines functions needed for the challange/response system of sign-in with ssb
type AuthWithSSBService interface{}
2021-02-08 11:57:14 +00:00
// 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
2021-02-08 16:47:42 +00:00
//go:generate counterfeiter -o mockdb/auth.go . AuthWithSSBService
2021-02-08 11:57:14 +00:00
2021-02-08 16:47:42 +00:00
//go:generate counterfeiter -o mockdb/auth_fallback.go . AuthFallbackService
2021-02-08 11:57:14 +00:00
//go:generate counterfeiter -o mockdb/room.go . RoomService
//go:generate counterfeiter -o mockdb/alias.go . AliasService