auth

package
v0.0.0-...-50815b3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidTokenErr = "invalid token"
)

Constant error messages

Variables

This section is empty.

Functions

func GetAPIPrivateKey

func GetAPIPrivateKey() ([]byte, error)

GetAPIPrivateKey returns the private RSA key to authenticate HTTP requests sent to the daemon.

func GetAPIPublicKey

func GetAPIPublicKey() ([]byte, error)

GetAPIPublicKey returns public RSA key

Types

type Claims

type Claims struct {
	Email string `json:"email"`
	jwt.StandardClaims
}

Claims (payload) of JWT token

func ValidateToken

func ValidateToken(tokenString string, lookup jwt.Keyfunc) (*Claims, error)

ValidateToken ensures token is valid and returns its metadata

func (*Claims) GenerateToken

func (c *Claims) GenerateToken() (string, error)

GenerateToken creates a JWT token using signKey (ie private rsa key)

Jump to

Keyboard shortcuts

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