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

Function TestSAMLMetadata_DualKey_Encryption

internal/api/saml_test.go:141–166  ·  view source on GitHub ↗
(t *tst.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestSAMLMetadata_DualKey_Encryption(t *tst.T) {
142 api, err := newSAMLTestAPI(t, samlTestPrimaryKey, samlTestNextKey, true)
143 require.NoError(t, err)
144
145 metadata, headers := samlMetadataRequest(t, api)
146
147 require.Len(t, metadata.SPSSODescriptors, 1)
148 kds := metadata.SPSSODescriptors[0].KeyDescriptors
149
150 // Two signing + two encryption descriptors
151 var signing, encryption []saml.KeyDescriptor
152 for _, kd := range kds {
153 switch kd.Use {
154 case "signing":
155 signing = append(signing, kd)
156 case "encryption":
157 encryption = append(encryption, kd)
158 }
159 }
160 require.Len(t, signing, 2)
161 require.Len(t, encryption, 2)
162
163 require.Equal(t, "public, max-age=60", headers.Get("Cache-Control"))
164 require.Equal(t, time.Hour, metadata.CacheDuration)
165 _ = headers
166}

Callers

nothing calls this directly

Calls 4

newSAMLTestAPIFunction · 0.85
samlMetadataRequestFunction · 0.85
EqualMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected