Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding initial support for GitHub Apps. #1738

Merged
merged 104 commits into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
87c01d4
Added authentication using bearer token.
adriangodong Dec 28, 2017
002b7bd
Added Installation and AccessToken clients.
adriangodong Dec 28, 2017
33d659e
Added new clients to Reactive project
adriangodong Dec 28, 2017
9c27c00
added support for DateTime serialized as FileTime
itaibh Jan 1, 2018
f987709
added support for StatusEventPayload
itaibh Jan 2, 2018
fc4e7b2
added support for StatusEventPayload
itaibh Jan 2, 2018
d60be44
Added test for StatusEventPayload and fixed serializer to return that…
itaibh Jan 4, 2018
cd70453
Merge pull request #1 from adriangodong/master
itaibh Jan 8, 2018
fca88fb
Merge pull request #2 from itaibh/StatusEventPayload
itaibh Jan 8, 2018
04757bb
Merge branch 'master' of github.com:octokit/octokit.net
itaibh Jan 8, 2018
d6ceb5a
Merge branch 'master' of github.com:itaibh/octokit.net
itaibh Jan 8, 2018
81e178a
WIP - added ApplicationClient and related Api Urls.
itaibh Jan 8, 2018
08d28b8
Merge pull request #3 from itaibh/GitHubApps
itaibh Jan 8, 2018
abde93f
Merge branch 'master' of github.com:itaibh/octokit.net
itaibh Jan 8, 2018
0004f34
Merge branch 'master' of github.com:octokit/octokit.net
itaibh Jan 9, 2018
176352e
Merge branch 'master' of github.com:octokit/octokit.net into GitHubApps
itaibh Jan 9, 2018
038b48f
Continued implementing Installations support.
itaibh Jan 11, 2018
8c81b8b
Fixing build (WIP)
itaibh Jan 11, 2018
fb4f58a
fixed build
itaibh Jan 11, 2018
a097869
added Account property to Installation. prefer nameof(x) over literal…
itaibh Jan 14, 2018
c3efb73
fixed according to code review.
itaibh Jan 18, 2018
967b49a
Merge branch 'master' of github.com:octokit/octokit.net
itaibh Jan 18, 2018
bee50f3
Merge branch 'master' into GitHubApps
itaibh Jan 18, 2018
a5551b9
fixed build.
itaibh Jan 18, 2018
bc9c394
Merge branch 'master' into GitHubApps
itaibh Jan 21, 2018
e412099
switched Installation ID from int to long.
itaibh Jan 22, 2018
0b0eee9
added Permissions and Events properties to Installation.
itaibh Jan 22, 2018
0e6a370
added documentation to Application and Installation properties in IGi…
itaibh Jan 22, 2018
07f19d7
Merge branch 'master' of github.com:octokit/octokit.net
itaibh Jan 22, 2018
40c9bf7
Merge branch 'master' into GitHubApps
itaibh Jan 22, 2018
788b692
wip - added tests to new clients
itaibh Jan 28, 2018
e888b90
wip - fix build
itaibh Jan 28, 2018
faa94b3
wip - fixed build.
itaibh Jan 29, 2018
7189a50
added InstallationsClient tests.
itaibh Jan 29, 2018
43132da
added integration test for InstallationsClient.
itaibh Jan 29, 2018
3211fc7
changes requested in code review.
itaibh Jan 31, 2018
e085b1a
add Get method for App
ryangribble Feb 27, 2018
8fde911
Create GitHubApp response model instead of re-using existing Applicat…
ryangribble Feb 27, 2018
d1a4603
add Get method to observable client
ryangribble Feb 27, 2018
b039fd5
Merge branch 'master' of github.com:octokit/octokit.net into GitHubApps
itaibh Feb 28, 2018
0e49287
fixed build (both locally and failed test).
itaibh Feb 28, 2018
7c494e6
Fixed documentation and added some missing XML docs.
itaibh Mar 5, 2018
f001908
added DebuggerDisplay to StatusEventPayload
itaibh Mar 6, 2018
76a8860
updated XML docs and added some missing bits. prefer nameof(x) over l…
itaibh Mar 6, 2018
6032ca3
Add xml comments to AccessToken response model and use DateTimeOffset…
ryangribble Mar 6, 2018
6bd5ac4
Tidy up XmlComments and make consistent across client and observable …
ryangribble Mar 6, 2018
5d48e64
fixup unit tests to independently verify preview header
ryangribble Mar 6, 2018
de3b659
Implement GetInstallation method
ryangribble Mar 6, 2018
11b1d8d
revert commits unrelated to GitHubApps - these can be done on a separ…
ryangribble Mar 6, 2018
a21103a
this extra authenticator class doesnt appear to be used anywhere
ryangribble Mar 6, 2018
513874a
undo project file change as it doesnt appear to be necessary
ryangribble Mar 6, 2018
0c9e413
Merge remote-tracking branch 'origin/master' into GitHubApps
itaibh Mar 7, 2018
c53cc11
Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps
itaibh Mar 7, 2018
02d52b8
Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubA…
itaibh Mar 7, 2018
e0d5b99
Revert "Revert "Merge remote-tracking branch 'remote/GitHubApps' into…
ryangribble Mar 7, 2018
96d56d6
Merge remote-tracking branch 'upstream/master' into GitHubApps
ryangribble Mar 7, 2018
1b48ce4
add XmlDoc comments to response models and flesh out installation per…
ryangribble Mar 7, 2018
d590250
name AcceptHeaders member consistently
ryangribble Mar 7, 2018
3ccfd42
accidentally lost changes to Credentials.cs
ryangribble Mar 7, 2018
9beec57
Enhance Intergation test framework to handle GitHubApp settings and d…
ryangribble Mar 7, 2018
edb3fe9
Merge branch 'master' of github.com:octokit/octokit.net into GitHubApps
itaibh Mar 7, 2018
af51d40
Merge branch 'GitHubApps' of github.com:itaibh/octokit.net into GitHu…
itaibh Mar 7, 2018
6e7a3ae
fixed compiler warnings.
itaibh Mar 12, 2018
e89d474
Added support for Installation=>Id field that arrives in a Pull Reque…
itaibh Mar 12, 2018
a3ac9d5
Change integration test project to netcoreapp2.0 so we can use GitHub…
ryangribble Mar 12, 2018
62f5d37
Merge remote-tracking branch 'itaibh/GitHubApps' into GitHubApps
ryangribble Mar 12, 2018
7caef24
First cut at some GitHubApp doco
ryangribble Mar 12, 2018
be5df3d
update mkdocs config
ryangribble Mar 12, 2018
9478c0e
Moved the Installation property to ActivityPayload, so it's available…
itaibh Mar 12, 2018
8993f08
Split Installation to Installation and InstallationId, and added a co…
itaibh Mar 13, 2018
2584f60
fixed InstallationId CreateAccessToken to receive IGitHubAppsClient. …
itaibh Mar 13, 2018
8982461
reverted object-oriented style comfort method and it's docs.
itaibh Mar 14, 2018
7959937
update all test projects to netcoreapp2.0
ryangribble Mar 14, 2018
70fe467
tweak build configs to use 2.0.3 SDK
ryangribble Mar 14, 2018
cfacf51
also need to update cake frosting build to netcoreapp2.0
ryangribble Mar 14, 2018
90241a1
tweak docs some more
ryangribble Mar 14, 2018
21f9f7f
fix convention test failures
ryangribble Mar 14, 2018
4e19617
test projects still had some old runtime parts in them!
ryangribble Mar 14, 2018
9aa755d
travis osx image needs to be at least 10.12 for .NET Core 2.0
ryangribble Mar 14, 2018
095be97
shell script might need the same argument tweak for cake
ryangribble Mar 14, 2018
f5a093e
more doc tweaks
ryangribble Mar 14, 2018
95d9485
Make sure compiler warning output isnt somehow causing Linux and OSX …
ryangribble Mar 14, 2018
d87d277
moar logging for linux/OSX builds
ryangribble Mar 14, 2018
f87dc1e
stop sourcelink on linux/OSX builds to see if that is the problem
ryangribble Mar 14, 2018
2c87015
set verbosity to detailed for the dotnet build step
ryangribble Mar 15, 2018
138c22f
try new sourcelink and list out remotes
ryangribble Mar 15, 2018
99891af
is travis being weird with git clone?
ryangribble Mar 15, 2018
b24285d
SourceLink may be defaulting to true on CI server so explicitly set i…
ryangribble Mar 15, 2018
697ca2b
detailed is a bit too verbose for travis, try normal
ryangribble Mar 15, 2018
3812a76
turn sourcelink back on for Linux/OSX
ryangribble Mar 15, 2018
5775520
fix compiler warning
ryangribble Mar 16, 2018
e3b3858
Try SourceLink.Create.CommandLine instead of SourceLink.Create.GitHub
ryangribble Mar 16, 2018
bddd276
CliToolReferences did not update to latest versions
ryangribble Mar 16, 2018
1b6e6d3
remove debug origin info
ryangribble Mar 17, 2018
8ff176b
turn off msbuild output
ryangribble Mar 17, 2018
2f0c914
go back to SourceLink.Create.GitHub!
ryangribble Mar 17, 2018
fa98682
time diff between dev PC and API causes issues if specifying a full 6…
ryangribble Mar 21, 2018
a9f8318
handle extra date format that Installation end point now returns
ryangribble Mar 21, 2018
63c11c8
field needs to be protected in order to be deserialized
ryangribble Mar 21, 2018
dd1f102
provide even more buffer for client vs server clock drift
ryangribble Apr 4, 2018
ac2b32a
Update to latest GitHubJwt reference
ryangribble Apr 4, 2018
89a152a
go back to SDK 1 since SDK 2 is having sporadic travisCI faliures in …
ryangribble Apr 4, 2018
08d5439
get appveyor working
ryangribble Apr 4, 2018
b6cc81d
update sourcelink back to latest, and use SDK 1.04 (runtime 1.0.5)
ryangribble Apr 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ matrix:
sudo: required
dotnet: 1.0.4
- os: osx
osx_image: xcode8
osx_image: xcode8.3
dotnet: 1.0.4

before_script:
- if test "$TRAVIS_OS_NAME" == "osx"; then export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/; else export FrameworkPathOverride=/usr/lib/mono/4.5/; fi

script:
- git fetch --unshallow --tags
- dotnet --info
- ./build.sh --linksources=true
- ./build.sh --linksources=true --verbosity=verbose
57 changes: 57 additions & 0 deletions Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;

namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub Applications API. Provides the methods required to get GitHub applications and installations.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/apps/">GitHub Apps API documentation</a> for more information.
/// </remarks>
public interface IObservableGitHubAppsClient
{
/// <summary>
/// Get a single GitHub App.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#get-a-single-github-app</remarks>
/// <param name="slug">The URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App.</param>
IObservable<GitHubApp> Get(string slug);

/// <summary>
/// Returns the GitHub App associated with the authentication credentials used (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#get-the-authenticated-github-app</remarks>
IObservable<GitHubApp> GetCurrent();

/// <summary>
/// List installations of the authenticated GitHub App (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-installations</remarks>
IObservable<Installation> GetAllInstallationsForCurrent();

/// <summary>
/// List installations of the authenticated GitHub App (requires GitHubApp JWT token auth).
/// </summary>
/// <param name="options">Options for changing the API response</param>
/// <remarks>https://developer.github.com/v3/apps/#find-installations</remarks>
IObservable<Installation> GetAllInstallationsForCurrent(ApiOptions options);

/// <summary>
/// Get a single GitHub App Installation (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#get-a-single-installation</remarks>
/// <param name="installationId">The Id of the GitHub App Installation</param>
IObservable<Installation> GetInstallation(long installationId);

/// <summary>
/// Create a time bound access token for a GitHubApp Installation that can be used to access other API endpoints (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/apps/#create-a-new-installation-token
/// https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-an-installation
/// https://developer.github.com/v3/apps/available-endpoints/
/// </remarks>
/// <param name="installationId">The Id of the GitHub App Installation</param>
IObservable<AccessToken> CreateInstallationToken(long installationId);
}
}
85 changes: 85 additions & 0 deletions Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using Octokit.Reactive.Internal;
using System;
using System.Reactive.Threading.Tasks;

namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub Applications API. Provides the methods required to get GitHub applications and installations.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/apps/">GitHub Apps API documentation</a> for more information.
/// </remarks>
public class ObservableGitHubAppsClient : IObservableGitHubAppsClient
{
private IGitHubAppsClient _client;
private readonly IConnection _connection;

public ObservableGitHubAppsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.GitHubApps;
_connection = client.Connection;
}

public IObservable<GitHubApp> Get(string slug)
{
return _client.Get(slug).ToObservable();
}

/// <summary>
/// Returns the GitHub App associated with the authentication credentials used (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#get-the-authenticated-github-app</remarks>
public IObservable<GitHubApp> GetCurrent()
{
return _client.GetCurrent().ToObservable();
}

/// <summary>
/// List installations of the authenticated GitHub App (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-installations</remarks>
public IObservable<Installation> GetAllInstallationsForCurrent()
{
return _connection.GetAndFlattenAllPages<Installation>(ApiUrls.Installations(), null, AcceptHeaders.GitHubAppsPreview);
}

/// <summary>
/// List installations of the authenticated GitHub App (requires GitHubApp JWT token auth).
/// </summary>
/// <param name="options">Options for changing the API response</param>
/// <remarks>https://developer.github.com/v3/apps/#find-installations</remarks>
public IObservable<Installation> GetAllInstallationsForCurrent(ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<Installation>(ApiUrls.Installations(), null, AcceptHeaders.GitHubAppsPreview, options);
}

/// <summary>
/// Get a single GitHub App Installation (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#get-a-single-installation</remarks>
/// <param name="installationId">The Id of the GitHub App Installation</param>
public IObservable<Installation> GetInstallation(long installationId)
{
return _client.GetInstallation(installationId).ToObservable();
}

/// <summary>
/// Create a time bound access token for a GitHubApp Installation that can be used to access other API endpoints (requires GitHubApp JWT token auth).
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/apps/#create-a-new-installation-token
/// https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-an-installation
/// https://developer.github.com/v3/apps/available-endpoints/
/// </remarks>
/// <param name="installationId">The Id of the GitHub App Installation</param>
public IObservable<AccessToken> CreateInstallationToken(long installationId)
{
return _client.CreateInstallationToken(installationId).ToObservable();
}
}
}
1 change: 1 addition & 0 deletions Octokit.Reactive/IObservableGitHubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public interface IObservableGitHubClient : IApiInfoProvider

IObservableAuthorizationsClient Authorization { get; }
IObservableActivitiesClient Activity { get; }
IObservableGitHubAppsClient GitHubApps { get; }
IObservableIssuesClient Issue { get; }
IObservableMiscellaneousClient Miscellaneous { get; }
IObservableOauthClient Oauth { get; }
Expand Down
2 changes: 2 additions & 0 deletions Octokit.Reactive/ObservableGitHubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public ObservableGitHubClient(IGitHubClient gitHubClient)
_gitHubClient = gitHubClient;
Authorization = new ObservableAuthorizationsClient(gitHubClient);
Activity = new ObservableActivitiesClient(gitHubClient);
GitHubApps = new ObservableGitHubAppsClient(gitHubClient);
Issue = new ObservableIssuesClient(gitHubClient);
Miscellaneous = new ObservableMiscellaneousClient(gitHubClient);
Oauth = new ObservableOauthClient(gitHubClient);
Expand Down Expand Up @@ -69,6 +70,7 @@ public void SetRequestTimeout(TimeSpan timeout)

public IObservableAuthorizationsClient Authorization { get; private set; }
public IObservableActivitiesClient Activity { get; private set; }
public IObservableGitHubAppsClient GitHubApps { get; private set; }
public IObservableIssuesClient Issue { get; private set; }
public IObservableMiscellaneousClient Miscellaneous { get; private set; }
public IObservableOauthClient Oauth { get; private set; }
Expand Down
9 changes: 3 additions & 6 deletions Octokit.Reactive/Octokit.Reactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@

<ItemGroup>
<PackageReference Include="System.Reactive" Version="3.1.0" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.0" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public InvalidUrlPropertyTypeException(Type modelType, IEnumerable<PropertyInfo>

static string CreateMessage(Type modelType, IEnumerable<PropertyInfo> propertiesWithInvalidType)
{
return string.Format("Model type '{0}' contains the following properties that are named or suffixed with 'Url' but are not of type String: {!}{2}",
return string.Format("Model type '{0}' contains the following properties that are named or suffixed with 'Url' but are not of type String: {1}{2}",
modelType.FullName,
Environment.NewLine,
string.Join(Environment.NewLine, propertiesWithInvalidType.Select(x => x.Name)));
Expand Down
2 changes: 0 additions & 2 deletions Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<AssemblyName>Octokit.Tests.Conventions</AssemblyName>
<PackageId>Octokit.Tests.Conventions</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand Down
130 changes: 130 additions & 0 deletions Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
using Octokit.Tests.Integration.Helpers;
using System;
using System.Linq;
using System.Threading.Tasks;
using Xunit;

namespace Octokit.Tests.Integration.Clients
{
public class GitHubAppsClientTests
{
public class TheGetMethod
{
IGitHubClient _github;

public TheGetMethod()
{
// Regular authentication
_github = Helper.GetAuthenticatedClient();
}

[GitHubAppsTest]
public async Task GetsApp()
{
var result = await _github.GitHubApps.Get(Helper.GitHubAppSlug);

Assert.Equal(Helper.GitHubAppId, result.Id);
Assert.False(string.IsNullOrEmpty(result.Name));
Assert.NotNull(result.Owner);
}
}

public class TheGetCurrentMethod
{
IGitHubClient _github;

public TheGetCurrentMethod()
{
// Authenticate as a GitHubApp
_github = Helper.GetAuthenticatedGitHubAppsClient();
}

[GitHubAppsTest]
public async Task GetsCurrentApp()
{
var result = await _github.GitHubApps.GetCurrent();

Assert.Equal(Helper.GitHubAppId, result.Id);
Assert.False(string.IsNullOrEmpty(result.Name));
Assert.NotNull(result.Owner);
}
}

public class TheGetAllInstallationsForCurrentMethod
{
IGitHubClient _github;

public TheGetAllInstallationsForCurrentMethod()
{
// Authenticate as a GitHubApp
_github = Helper.GetAuthenticatedGitHubAppsClient();
}

[GitHubAppsTest]
public async Task GetsAllInstallations()
{
var result = await _github.GitHubApps.GetAllInstallationsForCurrent();

Assert.True(result.Any(x => x.Id == Helper.GitHubAppInstallationId));
foreach (var installation in result)
{
Assert.Equal(Helper.GitHubAppId, installation.AppId);
Assert.NotNull(installation.Account);
Assert.NotNull(installation.Permissions);
Assert.Equal(InstallationPermissionLevel.Read, installation.Permissions.Metadata);
Assert.False(string.IsNullOrEmpty(installation.HtmlUrl));
Assert.NotEqual(0, installation.TargetId);
}
}
}

public class TheGetInstallationMethod
{
IGitHubClient _github;

public TheGetInstallationMethod()
{
// Authenticate as a GitHubApp
_github = Helper.GetAuthenticatedGitHubAppsClient();
}

[GitHubAppsTest]
public async Task GetsInstallation()
{
var installationId = Helper.GitHubAppInstallationId;

var result = await _github.GitHubApps.GetInstallation(installationId);

Assert.True(result.AppId == Helper.GitHubAppId);
Assert.Equal(Helper.GitHubAppId, result.AppId);
Assert.NotNull(result.Account);
Assert.NotNull(result.Permissions);
Assert.Equal(InstallationPermissionLevel.Read, result.Permissions.Metadata);
Assert.False(string.IsNullOrEmpty(result.HtmlUrl));
Assert.NotEqual(0, result.TargetId);
}
}

public class TheCreateInstallationTokenMethod
{
IGitHubClient _github;

public TheCreateInstallationTokenMethod()
{
// Authenticate as a GitHubApp
_github = Helper.GetAuthenticatedGitHubAppsClient();
}

[GitHubAppsTest]
public async Task GetsInstallation()
{
var installationId = Helper.GitHubAppInstallationId;

var result = await _github.GitHubApps.CreateInstallationToken(installationId);

Assert.NotNull(result.Token);
Assert.True(DateTimeOffset.Now < result.ExpiresAt);
}
}
}
}
Loading