-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request moby#13698 from cpuguy83/split_api_routes_from_setup
Move api handlers to separate file
- Loading branch information
Showing
7 changed files
with
1,400 additions
and
1,318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}) | ||
} |
Oops, something went wrong.