mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-21 13:07:13 +02:00
Prevent nil pointer when reloading in single service mode
This commit is contained in:
parent
e8b0bcead6
commit
30243097d2
5 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,7 @@
|
||||||
### FIXED
|
### FIXED
|
||||||
|
|
||||||
- Fixed potential race condition when signing requests. [GH-240]
|
- Fixed potential race condition when signing requests. [GH-240]
|
||||||
|
- Fixed panic when reloading configuration in single service mode [GH-247]
|
||||||
|
|
||||||
## v0.1.0
|
## v0.1.0
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,9 @@ func (a *Authorize) ValidIdentity(route string, identity *Identity) bool {
|
||||||
// UpdateOptions updates internal structures based on config.Options
|
// UpdateOptions updates internal structures based on config.Options
|
||||||
func (a *Authorize) UpdateOptions(o config.Options) error {
|
func (a *Authorize) UpdateOptions(o config.Options) error {
|
||||||
log.Info().Msg("authorize: updating options")
|
log.Info().Msg("authorize: updating options")
|
||||||
|
if a == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
a.identityAccess = NewIdentityWhitelist(o.Policies, o.Administrators)
|
a.identityAccess = NewIdentityWhitelist(o.Policies, o.Administrators)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,4 +94,8 @@ func Test_UpdateOptions(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test nil
|
||||||
|
var a *Authorize
|
||||||
|
a.UpdateOptions(config.Options{})
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,5 +321,8 @@ func (p *Proxy) newReverseProxyHandler(rp *httputil.ReverseProxy, route *config.
|
||||||
|
|
||||||
// UpdateOptions updates internal structures based on config.Options
|
// UpdateOptions updates internal structures based on config.Options
|
||||||
func (p *Proxy) UpdateOptions(o config.Options) error {
|
func (p *Proxy) UpdateOptions(o config.Options) error {
|
||||||
|
if p == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return p.UpdatePolicies(&o)
|
return p.UpdatePolicies(&o)
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,4 +329,8 @@ func Test_UpdateOptions(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test nil
|
||||||
|
var p *Proxy
|
||||||
|
p.UpdateOptions(config.Options{})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue