mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-18 11:37:08 +02:00
config: add support for policies stored in the databroker (#1099)
* wip * always use databroker config source * add test * valid policy, remove debug lines
This commit is contained in:
parent
821f2e9000
commit
b79e73b8b8
9 changed files with 965 additions and 6 deletions
|
@ -52,6 +52,24 @@ type Source interface {
|
|||
OnConfigChange(ChangeListener)
|
||||
}
|
||||
|
||||
// A StaticSource always returns the same config. Useful for testing.
|
||||
type StaticSource struct {
|
||||
cfg *Config
|
||||
}
|
||||
|
||||
// NewStaticSource creates a new StaticSource.
|
||||
func NewStaticSource(cfg *Config) *StaticSource {
|
||||
return &StaticSource{cfg: cfg}
|
||||
}
|
||||
|
||||
// GetConfig gets the config.
|
||||
func (src *StaticSource) GetConfig() *Config {
|
||||
return src.cfg
|
||||
}
|
||||
|
||||
// OnConfigChange is ignored for the StaticSource.
|
||||
func (src *StaticSource) OnConfigChange(ChangeListener) {}
|
||||
|
||||
// A FileOrEnvironmentSource retrieves config options from a file or the environment.
|
||||
type FileOrEnvironmentSource struct {
|
||||
configFile string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue