mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +02:00
(proxy, internal\policy, docs\reference): define new access control option to bypass authentication
This commit is contained in:
parent
c53c07c274
commit
c5d2e40435
6 changed files with 60 additions and 3 deletions
|
@ -180,11 +180,17 @@ func (p *Proxy) OAuthCallback(w http.ResponseWriter, r *http.Request) {
|
|||
// Conditions should be few in number and have strong justifications.
|
||||
func (p *Proxy) shouldSkipAuthentication(r *http.Request) bool {
|
||||
pol, foundPolicy := p.policy(r)
|
||||
|
||||
if isCORSPreflight(r) && foundPolicy && pol.CORSAllowPreflight {
|
||||
log.FromRequest(r).Debug().Msg("proxy: skipping authentication for valid CORS preflight request")
|
||||
return true
|
||||
}
|
||||
|
||||
if foundPolicy && pol.AllowPublicUnauthenticatedAccess {
|
||||
log.FromRequest(r).Debug().Msg("proxy: skipping authentication for public route")
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue