authenticate: catch missing required setting (#149)

This commit is contained in:
Bobby DeSimone 2019-05-30 14:20:28 -07:00 committed by GitHub
parent 191015a0ed
commit 7487de94df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -38,6 +38,8 @@ func TestOptions_Validate(t *testing.T) {
shortCookieLength.CookieSecret = "gN3xnvfsAwfCXxnJorGLKUG4l2wC8sS8nfLMhcStPg=="
badSharedKey := testOptions()
badSharedKey.SharedKey = ""
badAuthenticateURL := testOptions()
badAuthenticateURL.AuthenticateURL = new(url.URL)
tests := []struct {
name string
@ -53,6 +55,7 @@ func TestOptions_Validate(t *testing.T) {
{"no shared secret", badSharedKey, true},
{"no client id", emptyClientID, true},
{"no client secret", emptyClientSecret, true},
{"empty authenticate url", badAuthenticateURL, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {