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

Method HandleGetSession

samlidp/session.go:166–174  ·  view source on GitHub ↗

HandleGetSession handles the `GET /sessions/:id` request and responds with the session object in JSON format.

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

Source from the content-addressed store, hash-verified

164// HandleGetSession handles the `GET /sessions/:id` request and responds with the session
165// object in JSON format.
166func (s *Server) HandleGetSession(c web.C, w http.ResponseWriter, r *http.Request) {
167 session := saml.Session{}
168 err := s.Store.Get(fmt.Sprintf("/sessions/%s", c.URLParams["id"]), &session)
169 if err != nil {
170 http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
171 return
172 }
173 json.NewEncoder(w).Encode(session)
174}
175
176// HandleDeleteSession handles the `DELETE /sessions/:id` request. It invalidates the
177// specified session.

Callers

nothing calls this directly

Calls 3

GetMethod · 0.65
EncodeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected