Implement renaming and deprecation of GitHub App Installation Access 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
This commit is contained in:
Ryan Gribble
2018-09-03 20:05:36 +10:00
committed by GitHub
parent 90b0a7c551
commit ac86133f18
2 changed files with 2 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ namespace Octokit.Tests.Clients
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");
}
}
}

View File

@@ -287,7 +287,7 @@ namespace Octokit
/// <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>