Skip to content

Commit

Permalink
Merge pull request agola-io#215 from sgotti/gateway_move_auth_api
Browse files Browse the repository at this point in the history
gateway: move authentication apis to /api/v1alpha/auth
  • Loading branch information
sgotti authored Feb 20, 2020
2 parents 76cd562 + 74baa0a commit 36062f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions internal/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ func (g *Gateway) Run(ctx context.Context) error {

apirouter.Handle("/version", versionHandler).Methods("GET")

apirouter.Handle("/auth/#", 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/#", 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))

Expand Down
2 changes: 1 addition & 1 deletion services/gateway/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 36062f5

Please # to comment.