http

package
v2.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeJson = "application/json"
	TypeForm = "application/x-www-form-urlencoded"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	mqtt.HookBase
	// contains filtered or unexported fields
}

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

func (*Auth) ID

func (a *Auth) ID() string

ID returns the ID of the hook.

func (*Auth) Init

func (a *Auth) Init(config any) error

func (*Auth) OnACLCheck

func (a *Auth) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

OnACLCheck returns true if the connecting client has matching read or write access to subscribe or publish to a given topic.

func (*Auth) OnConnectAuthenticate

func (a *Auth) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

OnConnectAuthenticate returns true if the connecting client has rules which provide access in the auth ledger.

func (*Auth) Provides

func (a *Auth) Provides(b byte) bool

Provides indicates which hook methods this hook provides.

type Options

type Options struct {
	pa.Blacklist
	AuthMode    byte   `json:"auth-mode" yaml:"auth-mode"`
	AclMode     byte   `json:"acl-mode" yaml:"acl-mode"`
	TlsEnable   bool   `json:"tls-enable" yaml:"tls-enable"`
	TlsCert     string `json:"tls-cert" yaml:"tls-cert"`
	TlsKey      string `json:"tls-key" yaml:"tls-key"`
	Method      string `json:"method" yaml:"method"`
	ContentType string `json:"content-type" yaml:"content-type"`
	AuthUrl     string `json:"auth-url" yaml:"auth-url"`
	AclUrl      string `json:"acl-url" yaml:"acl-url"`
}

Jump to

Keyboard shortcuts

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