gateway: move authentication apis to /api/v1alpha/auth

Move the various authentication apis to /api/v1alpha/auth since they should be
versioned like other apis.
This commit is contained in:
Simone Gotti 2020-02-19 10:03:13 +01:00
parent 42785a1aee
commit eb48e73a54
2 changed files with 6 additions and 6 deletions

View File

@ -315,14 +315,14 @@ func (g *Gateway) Run(ctx context.Context) error {
apirouter.Handle("/version", versionHandler).Methods("GET")
apirouter.Handle("/auth/login", loginUserHandler).Methods("POST")
apirouter.Handle("/auth/authorize", authorizeHandler).Methods("POST")
apirouter.Handle("/auth/register", registerHandler).Methods("POST")
apirouter.Handle("/auth/oauth2/callback", oauth2callbackHandler).Methods("GET")
// TODO(sgotti) add auth to these requests
reposRouter.Handle("/repos/{rest:.*}", reposHandler).Methods("GET", "POST")
router.Handle("/api/login", loginUserHandler).Methods("POST")
router.Handle("/api/authorize", authorizeHandler).Methods("POST")
router.Handle("/api/register", registerHandler).Methods("POST")
router.Handle("/api/oauth2/callback", oauth2callbackHandler).Methods("GET")
router.Handle("/webhooks", webhooksHandler).Methods("POST")
router.PathPrefix("/").HandlerFunc(handlers.NewWebBundleHandlerFunc(g.c.APIExposedURL))

View File

@ -430,7 +430,7 @@ func (c *Client) RegisterUser(ctx context.Context, req *gwapitypes.RegisterUserR
}
res := new(gwapitypes.RegisterUserResponse)
resp, err := c.getParsedResponse(ctx, "POST", "/register", nil, jsonContent, bytes.NewReader(reqj), res)
resp, err := c.getParsedResponse(ctx, "POST", "/auth/register", nil, jsonContent, bytes.NewReader(reqj), res)
return res, resp, err
}