Documentation ¶
Index ¶
- func CheckHtaccessUser(username string, password string) bool
- func GeneralResponseTemplate(w http.ResponseWriter, error string, code int)
- func GenerateRandomBytes(n int) []byte
- func GenerateRandomString(s int) string
- func RenderTemplate(w http.ResponseWriter, tmpl string, data interface{})
- func RenderTemplateWithResultCode(w http.ResponseWriter, tmpl string, data interface{}, code int)
- type Config
- type Hs256
- type Rs256
- type Signing
- type StaticAudience
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHtaccessUser ¶ added in v0.1.1
func GeneralResponseTemplate ¶
func GeneralResponseTemplate(w http.ResponseWriter, error string, code int)
func GenerateRandomBytes ¶
func GenerateRandomString ¶
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, tmpl string, data interface{})
func RenderTemplateWithResultCode ¶
func RenderTemplateWithResultCode(w http.ResponseWriter, tmpl string, data interface{}, code int)
Types ¶
type Config ¶
type Config struct { Server struct { Port string `yaml:"port" envconfig:"PORT"` Uri string `yaml:"uri" envconfig:"URI"` Loglevel int `yaml:"loglevel" envconfig:"LOGLEVEL"` } `yaml:"server"` AdminBackend struct { BaseUrl string `yaml:"base_url" envconfig:"BASEURL"` } `yaml:"adminbackend"` OAuthServer struct { Duration int `yaml:"duration" envconfig:"DURATION"` InternalDuration int `yaml:"internal_duration" envconfig:"INTERNALDURATION"` DefaultAudience string `yaml:"default_audience" envconfig:"DEFAULTAUDIENCE"` StaticAudiences []StaticAudience `yaml:"static_audience" envconfig:"STATICAUDIENCE"` Signing Signing `yaml:"signing" envconfig:"SIGNING"` Issuer string `yaml:"issuer" envconfig:"ISSUER"` RedirectDomain string `yaml:"redirect_domain" envconfig:"REDIRECTDOMAIN"` } `yaml:"oauthserver"` Aad struct { ClientId string `yaml:"clientid" envconfig:"CLIENTID"` ClientSecret string `yaml:"clientsecret" envconfig:"CLIENTSECRET"` TenantId string `yaml:"tenantid" envconfig:"TENANTID"` CallbackUrl string `yaml:"callback_url" envconfig:"CALLBACKURL"` JwksUri string `yaml:"jwksuri" envconfig:"JWKSURI"` Issuers []string `yaml:"issuers"` } `yaml:"aad"` Google struct { ClientId string `yaml:"clientid" envconfig:"CLIENTID"` ClientSecret string `yaml:"clientsecret" envconfig:"CLIENTSECRET"` CallbackUrl string `yaml:"callback_url" envconfig:"CALLBACKURL"` Issuers []string `yaml:"issuers"` } `yaml:"google"` BasicAuth struct { Enabled bool `yaml:"enabled" envconfig:"ENABLED"` Users string `yaml:"users" envconfig:"USERS"` } `yaml:"basicauth"` }
func ReadConfig ¶
func ReadConfig() *Config
type Hs256 ¶
type Hs256 struct {
Secret string `yaml:"secret" envconfig:"OAUTHSERVER_SIGNING_HS256_SECRET"`
}
type StaticAudience ¶
type StaticAudience struct { Name string `yaml:"name" envconfig:"NAME"` Redirect string `yaml:"redirect" envconfig:"REDIRECT"` Authorize bool `yaml:"authorize" envconfig:"AUTHORIZE"` AuthorizeUrl string `yaml:"authorizeUrl" envconfig:"AUTHORIZEURL"` }
func FindStaticAudience ¶
func FindStaticAudience(config Config, audience string) *StaticAudience
Click to show internal directories.
Click to hide internal directories.