diff --git a/Octokit.Reactive/Clients/IObservableAuthorizationsClient.cs b/Octokit.Reactive/Clients/IObservableAuthorizationsClient.cs index 0bc48385..4c6894a0 100644 --- a/Octokit.Reactive/Clients/IObservableAuthorizationsClient.cs +++ b/Octokit.Reactive/Clients/IObservableAuthorizationsClient.cs @@ -77,13 +77,6 @@ namespace Octokit.Reactive NewAuthorization newAuthorization, string twoFactorAuthenticationCode); - /// - /// Create a new . - /// - /// Information about the new authorization to create - /// - IObservable Create(NewAuthorization newAuthorization); - /// /// Update the specified by the id. /// diff --git a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs index 0974d552..88a8cc04 100644 --- a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs @@ -112,19 +112,6 @@ namespace Octokit.Reactive .ToObservable(); } - /// - /// Create a new . - /// - /// Information about the new authorization to create - /// - [Obsolete("Deprecating in favour of GetOrCreateApplicationAuthentication")] - public IObservable Create(NewAuthorization newAuthorization) - { - Ensure.ArgumentNotNull(newAuthorization, "authorization"); - - return _client.Create(newAuthorization).ToObservable(); - } - /// /// Update the specified by the id. /// diff --git a/Octokit.Tests.Integration/Clients/AuthorizationClientTests.cs b/Octokit.Tests.Integration/Clients/AuthorizationClientTests.cs index 46d7d3ca..7e4b7183 100644 --- a/Octokit.Tests.Integration/Clients/AuthorizationClientTests.cs +++ b/Octokit.Tests.Integration/Clients/AuthorizationClientTests.cs @@ -77,7 +77,6 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(created.Id, get.Id); Assert.Equal(created.Note, get.Note); - // but the second time we call this API we get // a different set of data var getExisting = await client.Authorization.GetOrCreateApplicationAuthentication( @@ -86,7 +85,13 @@ namespace Octokit.Tests.Integration.Clients newAuthorization); Assert.Equal(created.Id, getExisting.Id); + + // NOTE: the new API will no longer return the full + // token as soon as you specify a Fingerprint Assert.True(String.IsNullOrWhiteSpace(getExisting.Token)); + + // NOTE: however you will get these two new properties + // to help identify the authorization at hand Assert.False(String.IsNullOrWhiteSpace(getExisting.TokenLastEight)); Assert.False(String.IsNullOrWhiteSpace(getExisting.HashedToken)); diff --git a/Octokit.Tests/Clients/AuthorizationsClientTests.cs b/Octokit.Tests/Clients/AuthorizationsClientTests.cs index 6e3b85ff..c1bd8d25 100644 --- a/Octokit.Tests/Clients/AuthorizationsClientTests.cs +++ b/Octokit.Tests/Clients/AuthorizationsClientTests.cs @@ -73,21 +73,6 @@ namespace Octokit.Tests.Clients } } - public class TheCreateMethod - { - [Fact] - public void SendsCreateToCorrectUrl() - { - var client = Substitute.For(); - var authEndpoint = new AuthorizationsClient(client); - - authEndpoint.Create(new NewAuthorization()); - - client.Received().Post(Arg.Is(u => u.ToString() == "authorizations") - , Args.NewAuthorization); - } - } - public class TheDeleteMethod { [Fact] diff --git a/Octokit/Clients/AuthorizationsClient.cs b/Octokit/Clients/AuthorizationsClient.cs index 4960a04f..59865c6a 100644 --- a/Octokit/Clients/AuthorizationsClient.cs +++ b/Octokit/Clients/AuthorizationsClient.cs @@ -210,26 +210,6 @@ namespace Octokit } } - /// - /// Creates a new . - /// - /// - /// This method requires authentication. - /// See the API documentation for more information. - /// - /// Describes the new authorization to create - /// - /// Thrown when the current user does not have permission to make the request. - /// - /// Thrown when a general API error occurs. - /// The created . - public Task Create(NewAuthorization newAuthorization) - { - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); - - return ApiConnection.Post(ApiUrls.Authorizations(), newAuthorization, previewAcceptsHeader); - } - /// /// Deletes the specified . /// diff --git a/Octokit/Clients/IAuthorizationsClient.cs b/Octokit/Clients/IAuthorizationsClient.cs index 8047bdf2..a08b97e0 100644 --- a/Octokit/Clients/IAuthorizationsClient.cs +++ b/Octokit/Clients/IAuthorizationsClient.cs @@ -98,22 +98,6 @@ namespace Octokit string clientSecret, NewAuthorization newAuthorization, string twoFactorAuthenticationCode); - - /// - /// Creates a new . - /// - /// - /// This method requires authentication. - /// See the API documentation for more information. - /// - /// Describes the new authorization to create - /// - /// Thrown when the current user does not have permission to make the request. - /// - /// Thrown when a general API error occurs. - /// The created . - [Obsolete("Deprecating in favour of GetOrCreateApplicationAuthentication")] - Task Create(NewAuthorization newAuthorization); /// /// Updates the specified .