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

Method HandleGetSession

samlidp/session.go:362–373  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

360// HandleGetSession handles the `GET /sessions/:id` request and responds with the session
361// object in JSON format.
362func (s *Server) HandleGetSession(w http.ResponseWriter, r *http.Request) {
363 session := saml.Session{}
364 err := s.Store.Get(fmt.Sprintf("/sessions/%s", r.PathValue("id")), &session)
365 if err != nil {
366 s.storeError(w, err)
367 return
368 }
369 if err := json.NewEncoder(w).Encode(session); err != nil {
370 http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
371 return
372 }
373}
374
375// HandleDeleteSession handles the `DELETE /sessions/:id` request. It invalidates the
376// specified session.

Callers

nothing calls this directly

Calls 4

storeErrorMethod · 0.95
GetMethod · 0.65
EncodeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected