@@ -35,6 +35,8 @@ redirect_url="http://localhost:4180/oauth2/callback"
3535session_cookie_minimal="true"
3636ping_path="/ping-pong"
3737ready_path="/readysteady"
38+ errors_to_info_log="true"
39+ silence_ping_logging="true"
3840`
3941
4042 const testAlphaConfig = `
@@ -89,6 +91,9 @@ session:
8991probeOptions:
9092 pingPath: /ping-pong
9193 readyPath: /readysteady
94+ logging:
95+ errToInfo: true
96+ silencePing: true
9297providers:
9398- provider: google
9499 ID: google=oauth2-proxy
@@ -109,11 +114,6 @@ providers:
109114 - force
110115`
111116
112- const testCoreConfig = `
113- errors_to_info_log="true"
114- silence_ping_logging="true"
115- `
116-
117117 boolPtr := func (b bool ) * bool {
118118 return & b
119119 }
@@ -271,30 +271,30 @@ providers:
271271 Expect (opts ).To (EqualOpts (in .expectedOptions ()))
272272 },
273273 Entry ("with legacy configuration" , loadConfigurationTableInput {
274- configContent : testCoreConfig + testLegacyConfig ,
274+ configContent : testLegacyConfig ,
275275 expectedOptions : testExpectedOptions ,
276276 }),
277277 Entry ("with alpha configuration" , loadConfigurationTableInput {
278- configContent : testCoreConfig ,
278+ configContent : "" ,
279279 alphaConfigContent : testAlphaConfig ,
280280 expectedOptions : testExpectedOptions ,
281281 }),
282282 Entry ("with bad legacy configuration" , loadConfigurationTableInput {
283- configContent : testCoreConfig + "unknown_field=\" something\" " ,
283+ configContent : testLegacyConfig + "unknown_field=\" something\" " ,
284284 expectedOptions : func () * options.Options { return nil },
285285 expectedErr : errors .New ("failed to load config: error unmarshalling config: 1 error(s) decoding:\n \n * '' has invalid keys: unknown_field" ),
286286 }),
287287 Entry ("with bad alpha configuration" , loadConfigurationTableInput {
288- configContent : testCoreConfig ,
288+ configContent : "" ,
289289 alphaConfigContent : testAlphaConfig + ":" ,
290290 expectedOptions : func () * options.Options { return nil },
291291 expectedErr : fmt .Errorf ("failed to load alpha options: error unmarshalling config: error converting YAML to JSON: yaml: line %d: did not find expected key" , strings .Count (testAlphaConfig , "\n " )),
292292 }),
293- Entry ("with alpha configuration and bad core configuration" , loadConfigurationTableInput {
294- configContent : testCoreConfig + "unknown_field= \" something \" " ,
293+ Entry ("with alpha configuration and legacy configuration" , loadConfigurationTableInput {
294+ configContent : testLegacyConfig ,
295295 alphaConfigContent : testAlphaConfig ,
296296 expectedOptions : func () * options.Options { return nil },
297- expectedErr : errors .New ("has invalid keys: unknown_field " ),
297+ expectedErr : errors .New ("please convert all legacy options " ),
298298 }),
299299 )
300300})
0 commit comments