Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Cfg the main exported config variable Cfg CfgT // 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", OIDC: "oidc", } )
View Source
var RequiredOptions = []string{"oauth.provider", "oauth.client_id"}
RequiredOptions must have these fields set for minimum viable config
Functions ¶
func BasicTest ¶ added in v0.2.4
func BasicTest() error
BasicTest just a quick sanity check to see if the config is sound
func UnmarshalKey ¶
UnmarshalKey populate struct from contents of cfg tree at key
Types ¶
type CfgT ¶
type CfgT struct {
LogLevel string `mapstructure:"logLevel"`
Listen string `mapstructure:"listen"`
Port int `mapstructure:"port"`
Domains []string `mapstructure:"domains"`
AllowAllUsers bool `mapstructure:"allowAllUsers"`
PublicAccess bool `mapstructure:"publicAccess"`
JWT struct {
MaxAge int `mapstructure:"maxAge"`
Issuer string `mapstructure:"issuer"`
Secret string `mapstructure:"secret"`
Compress bool `mapstructure:"compress"`
}
Cookie struct {
Name string `mapstructure:"name"`
Domain string `mapstructure:"domain"`
Secure bool `mapstructure:"secure"`
HTTPOnly bool `mapstructure:"httpOnly"`
}
Headers struct {
JWT string `mapstructure:"jwt"`
User string `mapstructure:"user"`
QueryString string `mapstructure:"querystring"`
Redirect string `mapstructure:"redirect"`
Success string `mapstructure:"success"`
}
DB struct {
File string `mapstructure:"file"`
}
Session struct {
Name string `mapstructure:"name"`
}
TestURL string `mapstructure:"test_url"`
Testing bool `mapstructure:"testing"`
WebApp bool `mapstructure:"webapp"`
}
CfgT lasso jwt cookie configuration
Click to show internal directories.
Click to hide internal directories.