Skip to content

Commit

Permalink
Implement renaming and deprecation of GitHub App Installation Access …
Browse files Browse the repository at this point in the history
…Token route (#1860)

* change existing CreateInstallationToken method to use new /app/installations route, and provide an obsolete CreateInstallationTokenPreview() method still using the old route, in order to support GHE 2.14

* suppress obsolete usage warning in tests

* add unit test for new method

* add new method to observable client

* fix routes in tests

* remove CreateInstallationTokenPreview() as it isnt actually required
  • Loading branch information
ryangribble authored Sep 3, 2018
1 parent 90b0a7c commit ac86133
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Octokit.Tests/Clients/GitHubAppsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void PostsToCorrectUrl()

client.CreateInstallationToken(fakeInstallationId);

connection.Received().Post<AccessToken>(Arg.Is<Uri>(u => u.ToString() == "installations/3141/access_tokens"), string.Empty, "application/vnd.github.machine-man-preview+json");
connection.Received().Post<AccessToken>(Arg.Is<Uri>(u => u.ToString() == "app/installations/3141/access_tokens"), string.Empty, "application/vnd.github.machine-man-preview+json");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static Uri NotificationSubscription(int id)
/// <param name="installationId">The Id of the GitHub App installation.</param>
public static Uri AccessTokens(long installationId)
{
return "installations/{0}/access_tokens".FormatUri(installationId);
return "app/installations/{0}/access_tokens".FormatUri(installationId);
}

/// <summary>
Expand Down

0 comments on commit ac86133

Please sign in to comment.