Merge pull request #215 from sgotti/gateway_move_auth_api

gateway: move authentication apis to /api/v1alpha/auth
This commit is contained in:
Simone Gotti 2020-02-20 09:53:52 +01:00 committed by GitHub
commit 3e611f6cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}