config: generate cookie secret if not set in all-in-one mode (#3742)

* config: generate cookie secret if not set in all-in-one mode

* fix tests

* config: add warning about cookie_secret

* breakup lines
This commit is contained in:
Caleb Doxsey 2022-11-11 14:14:30 -07:00 committed by GitHub
parent 2c9087f5e7
commit 9413123c0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 111 additions and 17 deletions

View file

@ -41,8 +41,6 @@ func TestOptions_Validate(t *testing.T) {
badAuthURL.AuthenticateURLString = "BAD_URL"
authenticateBadScheme := testOptions(t)
authenticateBadScheme.AuthenticateURLString = "authenticate.corp.beyondperimeter.com"
emptyCookieSecret := testOptions(t)
emptyCookieSecret.CookieSecret = ""
invalidCookieSecret := testOptions(t)
invalidCookieSecret.CookieSecret = "OromP1gurwGWjQPYb1nNgSxtbVB5NnLzX6z5WOKr0Yw^"
shortCookieLength := testOptions(t)
@ -62,7 +60,6 @@ func TestOptions_Validate(t *testing.T) {
}{
{"good - minimum options", good, false},
{"nil options", &config.Options{}, true},
{"no cookie secret", emptyCookieSecret, true},
{"invalid cookie secret", invalidCookieSecret, true},
{"short cookie secret", shortCookieLength, true},
{"no shared secret", badSharedKey, true},