HandleGetSession handles the `GET /sessions/:id` request and responds with the session object in JSON format.
(w http.ResponseWriter, r *http.Request)
| 360 | // HandleGetSession handles the `GET /sessions/:id` request and responds with the session |
| 361 | // object in JSON format. |
| 362 | func (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. |
nothing calls this directly
no test coverage detected