mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-24 12:08:19 +02:00
Merge branch 'main' into cdoxsey/upgrade-lint
This commit is contained in:
commit
359376e786
33 changed files with 2016 additions and 57 deletions
|
@ -827,6 +827,25 @@ func (o *Options) GetInternalAuthenticateURL() (*url.URL, error) {
|
|||
return urlutil.ParseAndValidateURL(o.AuthenticateInternalURLString)
|
||||
}
|
||||
|
||||
// UseStatelessAuthenticateFlow returns true if the stateless authentication
|
||||
// flow should be used (i.e. for hosted authenticate).
|
||||
func (o *Options) UseStatelessAuthenticateFlow() bool {
|
||||
if flow := os.Getenv("DEBUG_FORCE_AUTHENTICATE_FLOW"); flow != "" {
|
||||
if flow == "stateless" {
|
||||
return true
|
||||
} else if flow == "stateful" {
|
||||
return false
|
||||
}
|
||||
log.Warn(context.Background()).
|
||||
Msgf("ignoring unknown DEBUG_FORCE_AUTHENTICATE_FLOW setting %q", flow)
|
||||
}
|
||||
u, err := o.GetInternalAuthenticateURL()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return urlutil.IsHostedAuthenticateDomain(u.Hostname())
|
||||
}
|
||||
|
||||
// GetAuthorizeURLs returns the AuthorizeURLs in the options or 127.0.0.1:5443.
|
||||
func (o *Options) GetAuthorizeURLs() ([]*url.URL, error) {
|
||||
if IsAll(o.Services) && o.AuthorizeURLString == "" && len(o.AuthorizeURLStrings) == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue