[FEAT]: Create a GitHub App from a manifest

* Create a GitHub App from a manifest

* Add missing InstallationPermissions

* observable and tests

* Remove ManualRoute on Observable route

---------

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
This commit is contained in:
Colby Williams
2024-06-24 12:24:45 -05:00
committed by GitHub
parent b208057af6
commit c2aee1ac54
11 changed files with 282 additions and 13 deletions

View File

@@ -110,5 +110,13 @@ namespace Octokit.Reactive
/// <remarks>https://developer.github.com/v3/apps/#find-user-installation</remarks>
/// <param name="user">The name of the user</param>
IObservable<Installation> GetUserInstallationForCurrent(string user);
/// <summary>
/// Creates a GitHub app by completing the handshake necessary when implementing the GitHub App Manifest flow.
/// https://docs.github.com/apps/sharing-github-apps/registering-a-github-app-from-a-manifest
/// </summary>
/// <remarks>https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest</remarks>
/// <param name="code">Temporary code in a code parameter.</param>
IObservable<GitHubAppFromManifest> CreateAppFromManifest(string code);
}
}

View File

@@ -175,5 +175,18 @@ namespace Octokit.Reactive
return _client.GetUserInstallationForCurrent(user).ToObservable();
}
/// <summary>
/// Creates a GitHub app by completing the handshake necessary when implementing the GitHub App Manifest flow.
/// https://docs.github.com/apps/sharing-github-apps/registering-a-github-app-from-a-manifest
/// </summary>
/// <remarks>https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest</remarks>
/// <param name="code">Temporary code in a code parameter.</param>
public IObservable<GitHubAppFromManifest> CreateAppFromManifest(string code)
{
Ensure.ArgumentNotNullOrEmptyString(code, nameof(code));
return _client.CreateAppFromManifest(code).ToObservable();
}
}
}