MCPcopy Create free account
hub / github.com/crewjam/saml / TestSPCanProduceMetadataWithEncryptionCert

Function TestSPCanProduceMetadataWithEncryptionCert

service_provider_test.go:107–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestSPCanProduceMetadataWithEncryptionCert(t *testing.T) {
108 test := NewServiceProviderTest(t)
109 s := ServiceProvider{
110 Key: test.Key,
111 Certificate: test.Certificate,
112 MetadataURL: mustParseURL("https://example.com/saml2/metadata"),
113 AcsURL: mustParseURL("https://example.com/saml2/acs"),
114 SloURL: mustParseURL("https://example.com/saml2/slo"),
115 IDPMetadata: &EntityDescriptor{},
116 LogoutBindings: []string{HTTPPostBinding},
117 }
118 err := xml.Unmarshal(test.IDPMetadata, &s.IDPMetadata)
119 assert.Check(t, err)
120
121 spMetadata, err := xml.MarshalIndent(s.Metadata(), "", " ")
122 assert.Check(t, err)
123 golden.Assert(t, string(spMetadata), t.Name()+"_metadata")
124}
125
126func TestSPCanProduceMetadataWithBothCerts(t *testing.T) {
127 test := NewServiceProviderTest(t)

Callers

nothing calls this directly

Calls 3

MetadataMethod · 0.95
NewServiceProviderTestFunction · 0.85
mustParseURLFunction · 0.50

Tested by

no test coverage detected