MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / ServeHTTP

Method ServeHTTP

app/controlplane/internal/service/auth.go:213–221  ·  view source on GitHub ↗

Implement http.Handler interface

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

211
212// Implement http.Handler interface
213func (h oauthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
214 if resp := h.H(h.svc, w, r); resp != nil {
215 if resp.redirectURL != nil {
216 http.Redirect(w, r, resp.redirectURL.String(), http.StatusTemporaryRedirect)
217 return
218 }
219 http.Error(w, resp.ErrorMessage(h.svc.log), resp.code)
220 }
221}
222
223func loginHandler(svc *AuthService, w http.ResponseWriter, r *http.Request) *oauthResp {
224 b := make([]byte, 16)

Callers 8

LoggingFunction · 0.45
verifyJWTAndServeNextFunction · 0.45
TestAuthFromQueryParamFunction · 0.45
NewHTTPServerFunction · 0.45

Calls 3

ErrorMessageMethod · 0.80
StringMethod · 0.65
ErrorMethod · 0.65