Skip to content

Commit

Permalink
Change Pivnet API endpoint to get access token
Browse files Browse the repository at this point in the history
cf. #150922464

[#150153665]

Signed-off-by: Debbie Chen <dechen@pivotal.io>
  • Loading branch information
Timothy Kopp authored and xtreme-debbie-chen committed Sep 21, 2017
1 parent 8cbd4dd commit 10e4ef3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion uaa/uaa.go
Expand Up @@ -29,7 +29,7 @@ func (t TokenFetcher) GetToken() (string, error) {
return "", fmt.Errorf("failed to marshal API token request body: %s", err.Error())
}

req, err := http.NewRequest("POST", t.Endpoint+"/api/v2/access_tokens", bytes.NewReader(b))
req, err := http.NewRequest("POST", t.Endpoint+"/api/v2/authentication/access_tokens", bytes.NewReader(b))
if err != nil {
return "", fmt.Errorf("failed to construct API token request: %s", err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions uaa/uaa_test.go
Expand Up @@ -30,7 +30,7 @@ var _ = Describe("UAA", func() {

server.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/api/v2/access_tokens"),
ghttp.VerifyRequest("POST", "/api/v2/authentication/access_tokens"),
ghttp.VerifyBody([]byte(`{"refresh_token":"some-refresh-token"}`)),
ghttp.RespondWithJSONEncoded(http.StatusOK, response),
),
Expand All @@ -45,7 +45,7 @@ var _ = Describe("UAA", func() {
It("returns the error", func() {
server.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("POST", "/api/v2/access_tokens"),
ghttp.VerifyRequest("POST", "/api/v2/authentication/access_tokens"),
ghttp.VerifyBody([]byte(`{"refresh_token":"some-refresh-token"}`)),
ghttp.RespondWithJSONEncoded(http.StatusTeapot, nil),
),
Expand Down

0 comments on commit 10e4ef3

Please sign in to comment.