auth

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler() http_boundary.Handler

Types

type AuthResult

type AuthResult struct {
	UserId string
}

Result of parsing the authentication token

This struct might be just in/out struct for GetToken/Parse

type Authenticator

type Authenticator interface {
	// Returns authentication token for given user
	//
	// When expiation time is null it will be set with default value.
	GetToken(userId string, expirationTime *time.Time) (string, error)
	Parse(string) (*AuthResult, error)
}

Implementations are responsible for providing authentication tokens and verifying tokens from user.

func NewAuthenticator

func NewAuthenticator() Authenticator

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
	*http_boundary.Response
}

type Service

type Service interface {
	Login(string, string) (string, *http_boundary.ApiError)
}

func NewService

func NewService() Service

Jump to

Keyboard shortcuts

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