cfg

package
v0.0.0-...-81bf7c8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Branding that's our name
	Branding = branding{"oauth2", "OAUTH2", "Oauth2", "lasso", "https://github.com/rdeusser/oauth2-proxy"}

	// Cfg the main exported config variable
	Cfg config

	// GenOAuth exported OAuth config variable
	// TODO: I think GenOAuth and OAuthConfig can be combined!
	// perhaps by https://golang.org/doc/effective_go.html#embedding
	GenOAuth *oauthConfig

	// OAuthClient is the configured client which will call the provider
	// this actually carries the oauth2 client ala oauthclient.Client(oauth2.NoContext, providerToken)
	OAuthClient *oauth2.Config
	// OAuthopts authentication options
	OAuthopts oauth2.AuthCodeOption

	// Providers static strings to test against
	Providers = &OAuthProviders{
		Google:    "google",
		GitHub:    "github",
		IndieAuth: "indieauth",
		ADFS:      "adfs",
		OIDC:      "oidc",
	}

	// RequiredOptions must have these fields set for minimum viable config
	RequiredOptions = []string{"oauth.provider", "oauth.client_id"}
)

Functions

func BasicTest

func BasicTest() error

BasicTest just a quick sanity check to see if the config is sound

func Get

func Get(key string) string

Get string value for key

func InitForTestPurposes

func InitForTestPurposes()

InitForTestPurposes is called by most *_testing.go files in Oauth2 Proxy

func ParseConfig

func ParseConfig()

ParseConfig parse the config file

func SetDefaults

func SetDefaults()

SetDefaults set default options for some items

func UnmarshalKey

func UnmarshalKey(key string, rawVal interface{}) error

UnmarshalKey populate struct from contents of cfg tree at key

Types

type OAuthProviders

type OAuthProviders struct {
	Google    string
	GitHub    string
	IndieAuth string
	ADFS      string
	OIDC      string
}

OAuthProviders holds the stings for

Jump to

Keyboard shortcuts

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