feat: always set auth cookie (#8213)
* feat: always set auth cookie Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com> * feat: Add annotation to always set auth cookie * Add annotation * Add global configmap key * Provide unit tests and e2e tests * Fix e2e documentation autogen script Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com> * Regenerate e2e tests Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
parent
93af9f726a
commit
2c27e66cc7
13 changed files with 501 additions and 537 deletions
|
|
@ -229,6 +229,34 @@ func TestGlobalExternalAuthSigninParsing(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestGlobalExternalAlwaysSetCookie(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
alwaysSetCookie string
|
||||
result bool
|
||||
}{
|
||||
"true": {
|
||||
alwaysSetCookie: "true",
|
||||
result: true,
|
||||
},
|
||||
"false": {
|
||||
alwaysSetCookie: "false",
|
||||
},
|
||||
"set empty": {
|
||||
alwaysSetCookie: "",
|
||||
},
|
||||
"error": {
|
||||
alwaysSetCookie: "error string",
|
||||
},
|
||||
}
|
||||
|
||||
for n, tc := range testCases {
|
||||
cfg := ReadConfig(map[string]string{"global-auth-always-set-cookie": tc.alwaysSetCookie})
|
||||
if cfg.GlobalExternalAuth.AlwaysSetCookie != tc.result {
|
||||
t.Errorf("Testing %v. Expected \"%v\" but \"%v\" was returned", n, tc.result, cfg.GlobalExternalAuth.AlwaysSetCookie)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGlobalExternalAuthSigninRedirectParamParsing(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
param string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue