auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package assetattributor is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(rt http.RoundTripper) *http.Client

NewTransport creates a new Transport object with any passed in information

Types

type ACLCheckPOST

type ACLCheckPOST struct {
	Username string `json:"username"`
	ClientID string `json:"clientid"`
	Topic    string `json:"topic"`
	ACC      string `json:"acc"`
}

ACLCheckPOST is the struct that is sent to the acl endpoint

type ClientCheckPOST

type ClientCheckPOST struct {
	ClientID string `json:"clientid"`
	Password string `json:"password"`
	Username string `json:"username"`
}

ClientCheckPOST is the struct that is sent to the client authentication endpoint

type Hook

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

Hook is a hook that makes http requests to an external service

func (*Hook) ID

func (h *Hook) ID() string

ID returns the ID of the hook

func (*Hook) Init

func (h *Hook) Init(config any) error

Init initializes the hook with the given config

func (*Hook) OnACLCheck

func (h *Hook) OnACLCheck(cl *mqtt.Client, topic string, write bool) bool

OnACLCheck is called when a client attempts to publish or subscribe to a topic

func (*Hook) OnConnectAuthenticate

func (h *Hook) OnConnectAuthenticate(cl *mqtt.Client, pk packets.Packet) bool

OnConnectAuthenticate is called when a client attempts to connect to the server

func (*Hook) Provides

func (h *Hook) Provides(b byte) bool

Provides returns whether or not the hook provides the given hook

type MockRoundTripper

type MockRoundTripper struct {
	// contains filtered or unexported fields
}

MockRoundTripper is a mock of RoundTripper interface

func NewMockRoundTripper

func NewMockRoundTripper(ctrl *gomock.Controller) *MockRoundTripper

NewMockRoundTripper creates a new mock instance

func (*MockRoundTripper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRoundTripper) RoundTrip

func (m *MockRoundTripper) RoundTrip(arg0 *http.Request) (*http.Response, error)

RoundTrip mocks base method

type MockRoundTripperMockRecorder

type MockRoundTripperMockRecorder struct {
	// contains filtered or unexported fields
}

MockRoundTripperMockRecorder is the mock recorder for MockRoundTripper

func (*MockRoundTripperMockRecorder) RoundTrip

func (mr *MockRoundTripperMockRecorder) RoundTrip(arg0 interface{}) *gomock.Call

RoundTrip indicates an expected call of RoundTrip

type Options

type Options struct {
	ACLHost                  *url.URL
	SuperUserHost            *url.URL
	ClientAuthenticationHost *url.URL // currently unused
	RoundTripper             http.RoundTripper
	Callback                 func(resp *http.Response) bool
}

Options is a struct that contains all the information required to configure the http hook It is the responsibility of the configurer to pass a properly configured RoundTripper that takes care other requirements such as authentication, timeouts, retries, etc

type Transport

type Transport struct {
	OriginalTransport http.RoundTripper
}

Transport represents everything required for adding to the roundtripper interface

func (*Transport) RoundTrip

func (st *Transport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip goes through the HTTP RoundTrip implementation and attempts to add ASAP if not passed it

Jump to

Keyboard shortcuts

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