auth

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Topic       string   `json:"topic"`
	Channels    []string `json:"channels"`
	Permissions []string `json:"permissions"`
}

func (*Authorization) HasPermission

func (a *Authorization) HasPermission(permission string) bool

func (*Authorization) IsAllowed

func (a *Authorization) IsAllowed(topic, channel string) bool

type State

type State struct {
	TTL            int             `json:"ttl"`
	Authorizations []Authorization `json:"authorizations"`
	Identity       string          `json:"identity"`
	IdentityURL    string          `json:"identity_url"`
	Expires        time.Time
}

func QueryAnyAuthd

func QueryAnyAuthd(authd []string, remoteIP, tlsEnabled, authSecret string) (*State, error)

func QueryAuthd

func QueryAuthd(authd, remoteIP, tlsEnabled, authSecret string) (*State, error)

func (*State) IsAllowed

func (a *State) IsAllowed(topic, channel string) bool

func (*State) IsExpired

func (a *State) IsExpired() bool

Jump to

Keyboard shortcuts

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