MCPcopy Create free account
hub / github.com/supabase/auth / TestSAMLConfigurationValidateNextKey

Function TestSAMLConfigurationValidateNextKey

internal/conf/saml_test.go:235–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestSAMLConfigurationValidateNextKey(t *testing.T) {
236 invalidExamples := []*SAMLConfiguration{
237 {
238 Enabled: true,
239 PrivateKey: validPrivateKey,
240 PrivateKeyNext: "InvalidBase64!",
241 },
242 {
243 Enabled: true,
244 PrivateKey: validPrivateKey,
245 PrivateKeyNext: base64.StdEncoding.EncodeToString([]byte("not PKCS#1")),
246 },
247 {
248 Enabled: true,
249 PrivateKey: validPrivateKey,
250 PrivateKeyNext: invalidRSA1024Key,
251 },
252 {
253 Enabled: true,
254 PrivateKey: validPrivateKey,
255 PrivateKeyNext: invalidWrongExponentKey,
256 },
257 }
258
259 for i, example := range invalidExamples {
260 err := example.Validate()
261 require.Error(t, err, "Invalid next key example %d was regarded as valid", i)
262 }
263}
264
265func TestSAMLConfigurationDeterministicCertificate(t *testing.T) {
266 a := &SAMLConfiguration{

Callers

nothing calls this directly

Calls 2

ValidateMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected