Skip to content

Commit

Permalink
Merge pull request moby#13698 from cpuguy83/split_api_routes_from_setup
Browse files Browse the repository at this point in the history
Move api handlers to separate file
  • Loading branch information
tiborvass committed Aug 3, 2015
2 parents b9aaf8c + 1a77580 commit 1027247
Show file tree
Hide file tree
Showing 7 changed files with 1,400 additions and 1,318 deletions.
26 changes: 26 additions & 0 deletions api/server/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package server

import (
"encoding/json"
"net/http"

"github.com/docker/docker/api/types"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/pkg/version"
)

func (s *Server) postAuth(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
var config *cliconfig.AuthConfig
err := json.NewDecoder(r.Body).Decode(&config)
r.Body.Close()
if err != nil {
return err
}
status, err := s.daemon.RegistryService.Auth(config)
if err != nil {
return err
}
return writeJSON(w, http.StatusOK, &types.AuthResponse{
Status: status,
})
}
Loading

0 comments on commit 1027247

Please sign in to comment.