auth

package
v0.0.0-...-53e3d08 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Publish   = "pub"
	Subscribe = "sub"
)

all permit actions

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

Auth auth

func NewAuth

func NewAuth(principals []config.Principal) *Auth

NewAuth creates auth

func (*Auth) AuthenticateAccount

func (a *Auth) AuthenticateAccount(username, password string) *Authorizer

AuthenticateAccount auth client account, then return authorizer if pass

func (*Auth) AuthenticateCert

func (a *Auth) AuthenticateCert(serialNumber string) *Authorizer

AuthenticateCert auth client cert, then return authorizer if pass

type Authorizer

type Authorizer struct {
	*topic.Tree
}

Authorizer checks topic permission

func NewAuthorizer

func NewAuthorizer() *Authorizer

NewAuthorizer create a new authorizer

func (*Authorizer) Authorize

func (p *Authorizer) Authorize(action, topic string) bool

Authorize auth action

Jump to

Keyboard shortcuts

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