mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-01 02:12:50 +02:00
config: allow dynamic configuration of cookie settings (#1267)
This commit is contained in:
parent
0c51ad0e66
commit
fbf5b403b9
17 changed files with 184 additions and 165 deletions
|
@ -23,18 +23,6 @@ import (
|
|||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
)
|
||||
|
||||
type atomicOptions struct {
|
||||
value atomic.Value
|
||||
}
|
||||
|
||||
func (a *atomicOptions) Load() *config.Options {
|
||||
return a.value.Load().(*config.Options)
|
||||
}
|
||||
|
||||
func (a *atomicOptions) Store(options *config.Options) {
|
||||
a.value.Store(options)
|
||||
}
|
||||
|
||||
type atomicMarshalUnmarshaler struct {
|
||||
value atomic.Value
|
||||
}
|
||||
|
@ -52,7 +40,7 @@ type Authorize struct {
|
|||
pe *evaluator.Evaluator
|
||||
store *evaluator.Store
|
||||
|
||||
currentOptions atomicOptions
|
||||
currentOptions *config.AtomicOptions
|
||||
currentEncoder atomicMarshalUnmarshaler
|
||||
templates *template.Template
|
||||
|
||||
|
@ -84,6 +72,7 @@ func New(opts *config.Options) (*Authorize, error) {
|
|||
}
|
||||
|
||||
a := Authorize{
|
||||
currentOptions: config.NewAtomicOptions(),
|
||||
store: evaluator.NewStore(),
|
||||
templates: template.Must(frontend.NewTemplates()),
|
||||
dataBrokerClient: databroker.NewDataBrokerServiceClient(dataBrokerConn),
|
||||
|
@ -99,7 +88,6 @@ func New(opts *config.Options) (*Authorize, error) {
|
|||
return nil, err
|
||||
}
|
||||
a.currentEncoder.Store(encoder)
|
||||
a.currentOptions.Store(new(config.Options))
|
||||
return &a, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue