auth

package
v0.0.0-...-5503e3d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SecretsFile = flag.String("secrets", "secrets.json", "Path to secrets.json.")
)

Functions

func LoadSecrets

func LoadSecrets() (map[string]Secret, error)

func MustAuth

func MustAuth(handler http.Handler) http.Handler

func NewLoginHandler

func NewLoginHandler(oauthAdapter OAuthAdapter) http.Handler

Types

type GomniAuthAdapter

type GomniAuthAdapter struct{}

func (*GomniAuthAdapter) Provider

func (*GomniAuthAdapter) Provider(provider string) (Provider, error)

type OAuthAdapter

type OAuthAdapter interface {
	Provider(string) (Provider, error)
}

type Provider

type Provider interface {
	GetBeginAuthURL(*common.State, objx.Map) (string, error)
	CompleteAuth(data objx.Map) (*common.Credentials, error)
	GetUser(*common.Credentials) (common.User, error)
}

type Secret

type Secret struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RedirectURI  string `json:"redirect_uri"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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