MCPcopy Index your code
hub / github.com/coder/coder / SetCoderdCallback

Method SetCoderdCallback

coderd/coderdtest/oidctest/idp.go:1512–1517  ·  view source on GitHub ↗

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))

Source from the content-addressed store, hash-verified

1510// It will setup a fake "Coderd" for the IDP to call when the IDP redirects
1511// back after authenticating.
1512func (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
1519func (f *FakeIDP) SetCoderdCallbackHandler(handler http.HandlerFunc) {
1520 f.SetCoderdCallback(func(req *http.Request) (*http.Response, error) {

Callers 1

Calls 1

SetFakeCoderdMethod · 0.80

Tested by

no test coverage detected