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

Function readAttributeQuery

samlsp/middleware_attribute_query_test.go:163–179  ·  view source on GitHub ↗
(t *testing.T, r *http.Request)

Source from the content-addressed store, hash-verified

161}
162
163func readAttributeQuery(t *testing.T, r *http.Request) *saml.AttributeQuery {
164 body, err := io.ReadAll(r.Body)
165 assert.Check(t, err)
166 doc := etree.NewDocument()
167 assert.Check(t, doc.ReadFromBytes(body))
168 queryEl := doc.FindElement("/Envelope/Body/AttributeQuery")
169 if !assert.Check(t, queryEl != nil, "%s", body) {
170 return nil
171 }
172 queryDoc := etree.NewDocument()
173 queryDoc.SetRoot(queryEl.Copy())
174 buf, err := queryDoc.WriteToBytes()
175 assert.Check(t, err)
176 query := &saml.AttributeQuery{}
177 assert.Check(t, xml.Unmarshal(buf, query))
178 return query
179}
180
181// attributeQueryResponse returns the SOAP response of the attribute
182// authority to query: a Response signed by the IdP with an assertion about

Callers 1

newAQTestAuthorityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected