parse parses the fixture's response at an SP whose Key, EncryptionKey and DecryptionKeys are set by configure.
(t *testing.T, configure func(sp *ServiceProvider))
| 57 | // parse parses the fixture's response at an SP whose Key, EncryptionKey and |
| 58 | // DecryptionKeys are set by configure. |
| 59 | func (f decryptionKeysFixture) parse(t *testing.T, configure func(sp *ServiceProvider)) (*Assertion, error) { |
| 60 | t.Helper() |
| 61 | test := NewServiceProviderTest(t) |
| 62 | TimeNow = func() time.Time { |
| 63 | rv, _ := time.Parse("Mon Jan 2 15:04:05 MST 2006", f.now) |
| 64 | return rv |
| 65 | } |
| 66 | Clock = dsig.NewFakeClockAt(TimeNow()) |
| 67 | |
| 68 | sp := &ServiceProvider{ |
| 69 | Certificate: test.Certificate, |
| 70 | MetadataURL: mustParseURL(f.spURL + "metadata"), |
| 71 | AcsURL: mustParseURL(f.spURL + "acs"), |
| 72 | IDPMetadata: &EntityDescriptor{}, |
| 73 | } |
| 74 | assert.NilError(t, xml.Unmarshal(golden.Get(t, f.idpMetadata), sp.IDPMetadata)) |
| 75 | configure(sp) |
| 76 | |
| 77 | req := http.Request{PostForm: url.Values{}, URL: &sp.AcsURL} |
| 78 | req.PostForm.Set("SAMLResponse", f.response(t)) |
| 79 | return sp.ParseResponse(&req, []string{f.requestID}) |
| 80 | } |
| 81 | |
| 82 | func decryptionKeysPrivateErr(t *testing.T, err error) string { |
| 83 | t.Helper() |
no test coverage detected