SetCoderdCallback is optional and only works if not using the IsServing. It will setup a fake "Coderd" for the IDP to call when the IDP redirects back after authenticating.
(callback func(req *http.Request) (*http.Response, error))
| 1510 | // It will setup a fake "Coderd" for the IDP to call when the IDP redirects |
| 1511 | // back after authenticating. |
| 1512 | func (f *FakeIDP) SetCoderdCallback(callback func(req *http.Request) (*http.Response, error)) { |
| 1513 | if f.serve { |
| 1514 | panic("cannot set callback handler when using 'WithServing'. Must implement an actual 'Coderd'") |
| 1515 | } |
| 1516 | f.locked.SetFakeCoderd(callback) |
| 1517 | } |
| 1518 | |
| 1519 | func (f *FakeIDP) SetCoderdCallbackHandler(handler http.HandlerFunc) { |
| 1520 | f.SetCoderdCallback(func(req *http.Request) (*http.Response, error) { |
no test coverage detected