diff --git a/internal/outpost/ak/api.go b/internal/outpost/ak/api.go index 52f2af282..cfdb41dd0 100644 --- a/internal/outpost/ak/api.go +++ b/internal/outpost/ak/api.go @@ -55,7 +55,13 @@ func NewAPIController(akURL url.URL, token string) *APIController { config.Host = akURL.Host config.Scheme = akURL.Scheme config.HTTPClient = &http.Client{ - Transport: web.NewUserAgentTransport(constants.OutpostUserAgent(), web.NewTracingTransport(rsp.Context(), GetTLSTransport())), + Transport: web.NewUserAgentTransport( + constants.OutpostUserAgent(), + web.NewTracingTransport( + rsp.Context(), + GetTLSTransport(), + ), + ), } config.AddDefaultHeader("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -73,6 +79,9 @@ func NewAPIController(akURL url.URL, token string) *APIController { time.Sleep(time.Second * 3) return NewAPIController(akURL, token) } + if len(outposts.Results) < 1 { + panic("No outposts found with given token, ensure the given token corresponds to an authenitk Outpost") + } outpost := outposts.Results[0] log.WithField("name", outpost.Name).Debug("Fetched outpost configuration")