Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 97b7bb3

Browse files
authored
Merge branch 'master' into master
2 parents fdb4096 + 0405986 commit 97b7bb3

File tree

173 files changed

+5065
-2887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+5065
-2887
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
url = https://github.com/editor-tools/Akavache
1313
[submodule "script"]
1414
path = script
15-
url = [email protected]:github/VisualStudioBuildScripts
15+
url = [email protected]:github/VisualStudioBuildScripts

appveyor.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.3.7.{build}'
1+
version: '2.4.2.{build}'
22
skip_tags: true
33
install:
44
- ps: |
@@ -19,8 +19,10 @@ install:
1919
nuget restore GitHubVS.sln
2020
build_script:
2121
- ps: scripts\build.ps1 -AppVeyor -BuildNumber:$env:APPVEYOR_BUILD_NUMBER
22-
test_script:
23-
- ps: scripts\test.ps1 -AppVeyor
22+
test:
23+
categories:
24+
except:
25+
- Timings
2426
on_success:
2527
- ps: |
2628
if ($full_build) {
-7.67 KB
Binary file not shown.

lib/Rothko.0.0.2-ghfvs.nupkg

-33.9 KB
Binary file not shown.

lib/Rothko.0.0.3-ghfvs.nupkg

40.7 KB
Binary file not shown.

scripts/Run-XUnit.ps1

Lines changed: 0 additions & 55 deletions
This file was deleted.

scripts/test.ps1

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Param(
1818
$TimeoutDuration = 180
1919
,
2020
[switch]
21-
$AppVeyor = $false
22-
,
23-
[switch]
2421
$Trace = $false
2522

2623
)
@@ -35,30 +32,30 @@ $env:PATH = "$PSScriptRoot;$env:PATH"
3532
$exitcode = 0
3633

3734
Write-Output "Running Tracking Collection Tests..."
38-
Run-NUnit test TrackingCollectionTests $TimeoutDuration $config -AppVeyor:$AppVeyor
35+
Run-NUnit test TrackingCollectionTests $TimeoutDuration $config
3936
if (!$?) {
4037
$exitcode = 1
4138
}
4239

4340
Write-Output "Running GitHub.UI.UnitTests..."
44-
Run-NUnit test GitHub.UI.UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
41+
Run-NUnit test GitHub.UI.UnitTests $TimeoutDuration $config
4542
if (!$?) {
4643
$exitcode = 2
4744
}
4845

4946
Write-Output "Running UnitTests..."
50-
Run-XUnit test UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
47+
Run-NUnit test UnitTests $TimeoutDuration $config
5148
if (!$?) {
5249
$exitcode = 3
5350
}
5451

5552
Write-Output "Running GitHub.InlineReviews.UnitTests..."
56-
Run-XUnit test GitHub.InlineReviews.UnitTests $TimeoutDuration $config -AppVeyor:$AppVeyor
53+
Run-NUnit test GitHub.InlineReviews.UnitTests $TimeoutDuration $config
5754
if (!$?) {
5855
$exitcode = 4
5956
}
6057

61-
if ($exitcode -ne 0 -and $AppVeyor) {
58+
if ($exitcode -ne 0) {
6259
$host.SetShouldExit($exitcode)
6360
}
6461
exit $exitcode

src/GitHub.Api/ApiClientConfiguration.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Globalization;
34
using System.Linq;
45
using System.Net;
56
using System.Net.NetworkInformation;
6-
using System.Reflection;
77
using System.Security.Cryptography;
88
using System.Text;
9-
using GitHub.Primitives;
109

1110
namespace GitHub.Api
1211
{
@@ -33,6 +32,11 @@ static ApiClientConfiguration()
3332
/// </summary>
3433
public static string ClientSecret { get; private set; }
3534

35+
/// <summary>
36+
/// Gets the scopes required by the application.
37+
/// </summary>
38+
public static IReadOnlyList<string> RequiredScopes { get; } = new[] { "user", "repo", "gist", "write:public_key" };
39+
3640
/// <summary>
3741
/// Gets a note that will be stored with the OAUTH token.
3842
/// </summary>

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
</PropertyGroup>
4747
<Import Project="$(SolutionDir)\src\common\signing.props" />
4848
<ItemGroup>
49+
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
50+
<HintPath>..\..\packages\Serilog.2.5.0\lib\net46\Serilog.dll</HintPath>
51+
<Private>True</Private>
52+
</Reference>
4953
<Reference Include="System" />
5054
<Reference Include="System.ComponentModel.Composition" />
5155
<Reference Include="System.Core" />
@@ -64,6 +68,8 @@
6468
<Compile Include="ApiClientConfiguration_User.cs" Condition="$(Buildtype) != 'Internal'" />
6569
<Compile Include="IKeychain.cs" />
6670
<Compile Include="ILoginManager.cs" />
71+
<Compile Include="IOAuthCallbackListener.cs" />
72+
<Compile Include="IncorrectScopesException.cs" />
6773
<Compile Include="ITwoFactorChallengeHandler.cs" />
6874
<Compile Include="LoginManager.cs" />
6975
<Compile Include="KeychainCredentialStore.cs" />
@@ -99,6 +105,9 @@
99105
<Name>GitHub.Logging</Name>
100106
</ProjectReference>
101107
</ItemGroup>
108+
<ItemGroup>
109+
<None Include="packages.config" />
110+
</ItemGroup>
102111
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
103112
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
104113
Other similar extension points exist, see Microsoft.Common.targets.

src/GitHub.Api/ILoginManager.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.Runtime.InteropServices;
1+
using System;
2+
using System.Runtime.InteropServices;
3+
using System.Threading;
24
using System.Threading.Tasks;
35
using GitHub.Primitives;
46
using GitHub.VisualStudio;
@@ -25,6 +27,36 @@ public interface ILoginManager
2527
/// </exception>
2628
Task<User> Login(HostAddress hostAddress, IGitHubClient client, string userName, string password);
2729

30+
/// <summary>
31+
/// Attempts to log into a GitHub server via OAuth in the browser.
32+
/// </summary>
33+
/// <param name="hostAddress">The address of the server.</param>
34+
/// <param name="client">An octokit client configured to access the server.</param>
35+
/// <param name="oauthClient">An octokit OAuth client configured to access the server.</param>
36+
/// <param name="openBrowser">A callback that should open a browser at the requested URL.</param>
37+
/// <param name="cancel">A cancellation token used to cancel the operation.</param>
38+
/// <returns>The logged in user.</returns>
39+
/// <exception cref="AuthorizationException">
40+
/// The login authorization failed.
41+
/// </exception>
42+
Task<User> LoginViaOAuth(
43+
HostAddress hostAddress,
44+
IGitHubClient client,
45+
IOauthClient oauthClient,
46+
Action<Uri> openBrowser,
47+
CancellationToken cancel);
48+
49+
/// <summary>
50+
/// Attempts to log into a GitHub server with a token.
51+
/// </summary>
52+
/// <param name="hostAddress">The address of the server.</param>
53+
/// <param name="client">An octokit client configured to access the server.</param>
54+
/// <param name="token">The token.</param>
55+
Task<User> LoginWithToken(
56+
HostAddress hostAddress,
57+
IGitHubClient client,
58+
string token);
59+
2860
/// <summary>
2961
/// Attempts to log into a GitHub server using existing credentials.
3062
/// </summary>

0 commit comments

Comments
 (0)