authentication

package
v0.0.0-...-02c3ccb Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// E2EScope authorizes a user to change their keys in the keyserver.
	E2EScope = "https://www.googleapis.com/auth/e2ekeys"
	// RequiredScopes is the set of scopes the server requires for a user to change keys.
	RequiredScopes = []string{gAPI.UserinfoEmailScope, E2EScope}

	// ErrBadFormat occurs when the authentication header is malformed.
	ErrBadFormat = errors.New("auth: bad authorization header format")
	// ErrInvalidToken occurs when the authentication header is not valid.
	ErrInvalidToken = errors.New("auth: invalid token")
	// ErrEmailNotVerified occurs when token info indicates that email has not been verified.
	ErrEmailNotVerified = errors.New("auth: unverified email address")
	// ErrMissingScope occurs when a required scope is missing.
	ErrMissingScope = errors.New("auth: missing scope")
)

Functions

This section is empty.

Types

type GAuth

type GAuth struct {
	// contains filtered or unexported fields
}

GAuth authenticates Google users through the Google TokenInfo API endpoint.

func NewGoogleAuth

func NewGoogleAuth() (*GAuth, error)

NewGoogleAuth creates a new authenticator for Google users.

func (*GAuth) ValidateCreds

func (a *GAuth) ValidateCreds(ctx context.Context, email string) error

ValidateCreds verifies that email is equal to the validated email address associated with the access token in the authorization header in ctx.

Jump to

Keyboard shortcuts

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