Implement observable oauth client

Rx will never die
This commit is contained in:
Haacked
2014-04-22 08:38:53 -07:00
parent 5d70f885b7
commit 9e0fb886ca
5 changed files with 61 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
using System;
namespace Octokit.Reactive
{
public interface IObservableOauthClient
{
/// <summary>
/// Gets the URL used in the first step of the web flow. The Web application should redirect to this URL.
/// </summary>
/// <param name="request">Parameters to the Oauth web flow login url</param>
/// <returns></returns>
IObservable<Uri> GetGitHubLoginUrl(OauthLoginRequest request);
/// <summary>
/// Makes a request to get an access token using the code returned when GitHub.com redirects back from the URL
/// <see cref="GetGitHubLoginUrl">GitHub login url</see> to the application.
/// </summary>
/// <remarks>
/// If the user accepts your request, GitHub redirects back to your site with a temporary code in a code
/// parameter as well as the state you provided in the previous step in a state parameter. If the states dont
/// match, the request has been created by a third party and the process should be aborted. Exchange this for
/// an access token using this method.
/// </remarks>
/// <param name="request"></param>
/// <returns></returns>
IObservable<OauthToken> CreateAccessToken(OauthTokenRequest request);
}
}