auth

package
v0.0.0-...-476ffd2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allow

type Allow struct{}

Allow is an auth controller which allows access to all connections and topics.

func (*Allow) ACL

func (a *Allow) ACL(user []byte, topic string, write bool) bool

ACL returns true if a user has access permissions to read or write on a topic. Allow always returns true.

func (*Allow) Authenticate

func (a *Allow) Authenticate(user, password []byte) (*[]byte, bool)

Authenticate returns true if a username and password are acceptable. Allow always returns true.

type Controller

type Controller interface {

	// Authenticate authenticates a user on CONNECT and returns true if a user is
	// allowed to join the server and optionally return new username
	Authenticate(user, password []byte) (*[]byte, bool)

	// ACL returns true if a user has read or write access to a given topic.
	ACL(user []byte, topic string, write bool) bool
}

Controller is an interface for authentication controllers.

type Disallow

type Disallow struct{}

Disallow is an auth controller which disallows access to all connections and topics.

func (*Disallow) ACL

func (d *Disallow) ACL(user []byte, topic string, write bool) bool

ACL returns true if a user has access permissions to read or write on a topic. Disallow always returns false.

func (*Disallow) Authenticate

func (d *Disallow) Authenticate(user, password []byte) (*[]byte, bool)

Authenticate returns true if a username and password are acceptable. Disallow always returns false.

Jump to

Keyboard shortcuts

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