auth

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CacheDirectory = ".birthday-pal"

CacheDirectory is the location of bpal's cached files

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationClient

type AuthenticationClient interface {
	Client() (*http.Client, error)
}

AuthenticationClient can do a HTTP GET with required authentication

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth is used to perform basic authentication

func (BasicAuth) Client

func (ba BasicAuth) Client() (*http.Client, error)

Client returns a HTTP client authenticated with basic Auth

type OAuth2Authenticator

type OAuth2Authenticator struct {
	Scope   string
	Profile OAuthProfile
}

OAuth2Authenticator is used to perform OAuth2Authenticator authentication

func (OAuth2Authenticator) Authenticate

func (oa OAuth2Authenticator) Authenticate(configFilePath string) error

Authenticate parses and save the config file provided by user then performs a an OAuth2Authenticator authentication then saves token in cache

func (OAuth2Authenticator) Client

func (oa OAuth2Authenticator) Client() (*http.Client, error)

Client returns a HTTP client authenticated with OAuth2Authenticator

type OAuthProfile

type OAuthProfile struct {
	System  system.System
	Profile string
}

OAuthProfile holds logic of cache storage of oauth authentication profiles

func (OAuthProfile) ListProfiles

func (oap OAuthProfile) ListProfiles() ([]string, error)

ListProfiles lists the registered profiles by looking inside cache directory

Jump to

Keyboard shortcuts

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