We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 817854d commit bdb93fcCopy full SHA for bdb93fc
flyteadmin/auth/cookie_test.go
@@ -76,6 +76,24 @@ func TestSecureCookieLifecycle(t *testing.T) {
76
}
77
78
79
+func TestNewCsrfToken(t *testing.T) {
80
+ // Generate many tokens and assert uniqueness and decodability
81
+ const n = 1000
82
+ seen := make(map[string]struct{}, n)
83
+
84
+ for i := 0; i < n; i++ {
85
+ tok, err := NewCsrfToken()
86
+ require.NoError(t, err)
87
+ require.Len(t, tok, 44)
88
89
+ if _, ok := seen[tok]; ok {
90
+ t.Fatalf("duplicate token generated at i=%d", i)
91
+ }
92
+ seen[tok] = struct{}{}
93
94
95
+}
96
97
func TestNewCsrfCookie(t *testing.T) {
98
tests := []struct {
99
name string
0 commit comments