mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-25 05:58:16 +02:00
config: use config.Config instead of config.Options everywhere
This commit is contained in:
parent
5f51510e91
commit
1b80e8a6c2
40 changed files with 484 additions and 412 deletions
|
@ -28,7 +28,7 @@ import (
|
|||
type Handler struct {
|
||||
mu sync.RWMutex
|
||||
key []byte
|
||||
options *config.Options
|
||||
cfg *config.Config
|
||||
policies map[uint64]config.Policy
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ func (h *Handler) Middleware(next http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
h.mu.RLock()
|
||||
options := h.options
|
||||
options := h.cfg.Options
|
||||
policy, ok := h.policies[policyID]
|
||||
h.mu.RUnlock()
|
||||
|
||||
|
@ -132,7 +132,7 @@ func (h *Handler) Update(ctx context.Context, cfg *config.Config) {
|
|||
defer h.mu.Unlock()
|
||||
|
||||
h.key, _ = cfg.Options.GetSharedKey()
|
||||
h.options = cfg.Options
|
||||
h.cfg = cfg
|
||||
h.policies = make(map[uint64]config.Policy)
|
||||
for _, p := range cfg.Options.GetAllPolicies() {
|
||||
id, err := p.RouteID()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue