1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-01 22:51:45 +02:00

Add convert-config-to-alpha flag to convert existing configuration to alpha structure

This commit is contained in:
Joel Speed
2020-11-09 20:34:55 +00:00
parent 5b683a7631
commit b201dbb2d3
2 changed files with 39 additions and 0 deletions

View File

@@ -37,3 +37,11 @@ func (a *AlphaOptions) MergeInto(opts *Options) {
opts.InjectRequestHeaders = a.InjectRequestHeaders
opts.InjectResponseHeaders = a.InjectResponseHeaders
}
// ExtractFrom populates the fields in the AlphaOptions with the values from
// the Options
func (a *AlphaOptions) ExtractFrom(opts *Options) {
a.Upstreams = opts.UpstreamServers
a.InjectRequestHeaders = opts.InjectRequestHeaders
a.InjectResponseHeaders = opts.InjectResponseHeaders
}