auth

package
v0.0.0-...-e652847 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInfo

type ClientInfo struct {
	Name            string
	ProtocolVersion ProtocolVersion
	Client          string
	ClientVersion   string
}

ClientInfo is a parsed client information (found in the 'Name' connect info field)

func ParseClientInfo

func ParseClientInfo(name string) (*ClientInfo, error)

ParseClientInfo parses a 'Name' connect info field

type ProtocolVersion

type ProtocolVersion struct {
	Major int
	Minor int
}

ProtocolVersion is a parsed protocol version

func ParseProtocolVersion

func ParseProtocolVersion(version string) (*ProtocolVersion, error)

ParseProtocolVersion parses a protocol version

type XBusAuth

type XBusAuth struct {
	AccountStorage  storage.AccountStorage
	PasswordStorage storage.PasswordStorage
	ActorStorage    storage.ActorStorage
	SessionStorage  storage.SessionStorage
	AuthToken       string
	Logger          xbus.Logger
}

XBusAuth ...

func NewXBusAuth

func NewXBusAuth(
	accountStorage storage.AccountStorage,
	passwordStorage storage.PasswordStorage,
	actorStorage storage.ActorStorage,
	sessionStorage storage.SessionStorage,
	logger xbus.Logger,
) XBusAuth

NewXBusAuth returns a gnatsd.server.Auth implementation on top of actor & account storage instances. It provides a simple login/password authentication based on the Account model stored in the database. A special token allow full-access (used by internal services)

func (*XBusAuth) Check

Check authenticate a client for first or third auth step

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL