auth

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 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 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