MCPcopy Create free account
hub / github.com/crewjam/saml / HandleGetService

Method HandleGetService

samlidp/service.go:55–64  ·  view source on GitHub ↗

HandleGetService handles the `GET /services/:id` request and responds with the service metadata in XML format.

(c web.C, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

53// HandleGetService handles the `GET /services/:id` request and responds with the service
54// metadata in XML format.
55func (s *Server) HandleGetService(c web.C, w http.ResponseWriter, r *http.Request) {
56 service := Service{}
57 err := s.Store.Get(fmt.Sprintf("/services/%s", c.URLParams["id"]), &service)
58 if err != nil {
59 s.logger.Printf("ERROR: %s", err)
60 http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
61 return
62 }
63 xml.NewEncoder(w).Encode(service.Metadata)
64}
65
66// HandlePutService handles the `PUT /shortcuts/:id` request. It accepts the XML-formatted
67// service metadata in the request body and stores it.

Callers

nothing calls this directly

Calls 4

PrintfMethod · 0.80
GetMethod · 0.65
EncodeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected