INNER CODE UNIT · Go
client
platform-engineering-labs/formae · internal/workflow_tests/cmd/test-oidc-broker/main.go:42
client := &http.Client{Timeout: 2 * time.Minute, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
resp, err := client.Get(cfg.StartupURL)
if err != nil {
return errors.New("startup controller unavailable")
}
_ = resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return errors.New("startup controller denied launch")
}
}
if cfg.CompletionURL != "" {
completion, err := url.Parse(cfg.CompletionURL)
if err != nil || completion.Scheme != "http" || completion.User != nil || !net.ParseIP(completion.Hostname()).IsLoopback() {
return errors.New("test broker requires literal loopback completion controller")
}
}
b.controlURL = cfg.ControlURL
b.completionURL = cfg.CompletionURL