auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 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 AuthState

type AuthState 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) (*AuthState, error)

func QueryAuthd

func QueryAuthd(authd, remoteIp, tlsEnabled, authSecret string) (*AuthState, error)

func (*AuthState) IsAllowed

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

func (*AuthState) IsExpired

func (a *AuthState) IsExpired() bool

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

Jump to

Keyboard shortcuts

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