MCPcopy Index your code
hub / github.com/oauth2-proxy/oauth2-proxy / TestGenerateCodeVerifierString

Function TestGenerateCodeVerifierString

pkg/encryption/utils_test.go:133–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func TestGenerateCodeVerifierString(t *testing.T) {
134 randomString, err := GenerateCodeVerifierString(96)
135 assert.NoError(t, err)
136
137 // Should be 128 characters long
138 assert.Equal(t, 128, len([]byte(randomString)))
139
140 // All non-ascii characters removed should still be the original string
141 removedChars := strings.Map(func(r rune) rune {
142 if r > unicode.MaxASCII {
143 return -1
144 }
145 return r
146 }, randomString)
147 assert.Equal(t, removedChars, randomString)
148}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected