(t *testing.T, r *http.Request)
| 161 | } |
| 162 | |
| 163 | func 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 |
no outgoing calls
no test coverage detected