mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-21 04:57:18 +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 potential race condition when signing requests. [GH-240]
|
||||
- Fixed panic when reloading configuration in single service mode [GH-247]
|
||||
|
||||
## v0.1.0
|
||||
|
||||
|
|
|
@ -61,6 +61,9 @@ func (a *Authorize) ValidIdentity(route string, identity *Identity) bool {
|
|||
// UpdateOptions updates internal structures based on config.Options
|
||||
func (a *Authorize) UpdateOptions(o config.Options) error {
|
||||
log.Info().Msg("authorize: updating options")
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
a.identityAccess = NewIdentityWhitelist(o.Policies, o.Administrators)
|
||||
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
|
||||
func (p *Proxy) UpdateOptions(o config.Options) error {
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
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