(t *tst.T)
| 139 | } |
| 140 | |
| 141 | func 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 | } |
nothing calls this directly
no test coverage detected