auth

package
v0.0.0-...-edff900 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_LEN_DEVICE_ID = 5
	MIN_LEN_SECRET    = 5
)

Variables

View Source
var (
	DataDir string = "/tmp/secrets" // TODO: Move to configuration
)

Functions

func AuthenticateByFile

func AuthenticateByFile(deviceId, secret string) bool

Only authenticates if file [deviceId]/secret exists with content == [secret]

func AuthorizeRequest

func AuthorizeRequest(deviceId string, request *rest.Request) bool

func CheckHashedSecret

func CheckHashedSecret(deviceId, secretb64 string) bool

func CheckSecret

func CheckSecret(deviceId, secret string) bool

func DeviceIdExists

func DeviceIdExists(deviceId string) bool

func DeviceIsConnected

func DeviceIsConnected(deviceId string) bool

func HashSecret

func HashSecret(secret string) string

func LoadToken

func LoadToken(deviceId string) (*oauth2.Token, error)

func RegisterDevice

func RegisterDevice(deviceId, secret string) error

func SaveToken

func SaveToken(deviceId string, token *oauth2.Token) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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