mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 20:45:51 +00:00
Implemented methods for creating an authorization without having to specify an app clientid/clientsecret.
These methods will ONLY work with username/password Basic Auth. Added a helper method to return a GitHub client using basic auth credentials as if you have both password and oauth token environment variables, you get credentials based on the oauth token.
This commit is contained in:
@@ -47,6 +47,43 @@ namespace Octokit
|
||||
Justification = "It's fiiiine. It's fine. Trust us.")]
|
||||
Task<Authorization> Get(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new personal token for the authenticated user.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method requires authentication.
|
||||
/// See the <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="newAuthorization">Describes the new authorization to create</param>
|
||||
/// <exception cref="AuthorizationException">
|
||||
/// Thrown when the current user does not have permission to make this request.
|
||||
/// </exception>
|
||||
/// <exception cref="TwoFactorRequiredException">
|
||||
/// Thrown when the current account has two-factor authentication enabled and an authentication code is required.
|
||||
/// </exception>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Authorization"/>.</returns>
|
||||
Task<ApplicationAuthorization> Create(NewAuthorization newAuthorization);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new personal token for the authenticated user.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method requires authentication.
|
||||
/// See the <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="twoFactorAuthenticationCode">The two-factor authentication code in response to the current user's previous challenge</param>
|
||||
/// <param name="newAuthorization">Describes the new authorization to create</param>
|
||||
/// <exception cref="AuthorizationException">
|
||||
/// Thrown when the current user does not have permission to make this request.
|
||||
/// </exception>
|
||||
/// <exception cref="TwoFactorRequiredException">
|
||||
/// Thrown when the current account has two-factor authentication enabled and an authentication code is required.
|
||||
/// </exception>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Authorization"/>.</returns>
|
||||
Task<ApplicationAuthorization> Create(NewAuthorization newAuthorization, string twoFactorAuthenticationCode);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new authorization for the specified OAuth application if an authorization for that application
|
||||
/// doesn’t already exist for the user; otherwise, it fails.
|
||||
|
||||
Reference in New Issue
Block a user