Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection interface {
Authenticate(serverName string, reader io.Reader) (UserContext, error)
}
Connection is the interface that must be implemented by every concrete connection types.
type Mock ¶
Mock is an insecure connection type that is only helpful for testing purposes. It is not meant to be used in production.
func (Mock) Authenticate ¶
Authenticate implements the connection interface.
type Unmarshaler ¶
type Unmarshaler[T any] struct { // contains filtered or unexported fields }
Unmarshaler is a generic type to unmarshal an io.Reader.
func NewUnmarshaler ¶
func NewUnmarshaler[T any](reader io.Reader) *Unmarshaler[T]
NewUnmarshaler instantiates a new Unmarshaler.
func (*Unmarshaler[T]) Unmarshal ¶
func (u *Unmarshaler[T]) Unmarshal() (T, error)
Unmarshal takes care of unmarshalling the data into the given type T.
type UserContext ¶
type UserContext struct { ServerName string ConnectionName string Subject string Authenticated bool // contains filtered or unexported fields }
UserContext is the context of the user.
func (UserContext) AuthTime ¶
func (u UserContext) AuthTime() time.Time
AuthTime returns the time at which the user was authenticated.
func (UserContext) IsAuthenticated ¶
func (u UserContext) IsAuthenticated() bool
IsAuthenticated returns true if the user is authenticated.
type UserPass ¶
UserPass is the connection that allows us to store a user in the Raft/Badger internal database.
func (UserPass) Authenticate ¶
Authenticate implements the Connection interface.