Documentation ¶
Index ¶
- Constants
- Variables
- func AuthenticateByFile(deviceId, secret string) bool
- func AuthorizeRequest(deviceId string, request *rest.Request) bool
- func CheckHashedSecret(deviceId, secretb64 string) bool
- func CheckSecret(deviceId, secret string) bool
- func DeviceIdExists(deviceId string) bool
- func DeviceIsConnected(deviceId string) bool
- func HashSecret(secret string) string
- func LoadToken(deviceId string) (*oauth2.Token, error)
- func RegisterDevice(deviceId, secret string) error
- func SaveToken(deviceId string, token *oauth2.Token) error
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 ¶
Only authenticates if file [deviceId]/secret exists with content == [secret]
func CheckHashedSecret ¶
func CheckSecret ¶
func DeviceIdExists ¶
func DeviceIsConnected ¶
func HashSecret ¶
func RegisterDevice ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.