auth

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialStrategy

type CredentialStrategy interface {
	GetCredentials(w http.ResponseWriter, r *http.Request) (*Credentials, error)
}

CredentialStrategy obtains Credentials from the request.

type Credentials

type Credentials struct {
	ClientID     string
	ClientSecret string
}

Credentials contains the client id and secret.

type Manager

type Manager interface {
	Authenticate(ctx context.Context, clientID, clientSecret string) (*typespb.UserId, error)
}

Manager is the interface to implement to authenticate users

type Registry

type Registry interface {
	ListProviders(ctx context.Context) ([]*authregistryv0alphapb.ProviderInfo, error)
	GetProvider(ctx context.Context, authType string) (*authregistryv0alphapb.ProviderInfo, error)
}

Registry is the interface that auth registries implement for discovering auth providers

type TokenStrategy

type TokenStrategy interface {
	GetToken(r *http.Request) string
}

TokenStrategy obtains a token from the request. If token does not exist returns an empty string.

type TokenWriter

type TokenWriter interface {
	WriteToken(token string, w http.ResponseWriter)
}

TokenWriter stores the token in a http response.

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

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