diff --git a/GitHub.Unity.OctokitDebugging.sln b/GitHub.Unity.OctokitDebugging.sln
deleted file mode 100644
index 8d9cef6c2..000000000
--- a/GitHub.Unity.OctokitDebugging.sln
+++ /dev/null
@@ -1,132 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Unity", "src\UnityExtension\Assets\Editor\GitHub.Unity\GitHub.Unity.csproj", "{ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Api", "src\GitHub.Api\GitHub.Api.csproj", "{B389ADAF-62CC-486E-85B4-2D8B078DF763}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Logging", "src\GitHub.Logging\GitHub.Logging.csproj", "{BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyLibrariesToDevelopmentFolder", "src\packaging\CopyLibrariesToDevelopmentFolder\CopyLibrariesToDevelopmentFolder.csproj", "{44257C81-EE4A-4817-9AF4-A26C02AA6DD4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "src\tests\UnitTests\UnitTests.csproj", "{69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "src\tests\IntegrationTests\IntegrationTests.csproj", "{1AC3F82E-AEAE-4C84-825C-207BB264FCFA}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packaging", "packaging", "{B50B646C-3B86-4BDA-9F2B-766F96608CE0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyLibrariesToPackageProject", "src\packaging\CopyLibrariesToPackageProject\CopyLibrariesToPackageProject.csproj", "{7DEF4226-7740-457F-9199-34174C49A978}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils", "src\tests\TestUtils\TestUtils.csproj", "{66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskSystem", "src\tests\TaskSystemIntegrationTests\TaskSystem.csproj", "{1A382F40-FD9E-43E1-89C1-320073F35CE9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "src\tests\TestApp\TestApp.csproj", "{08B87D2A-8CF1-4211-B7AA-5209F00F72F8}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-httpclient35", "dotnet-httpclient35", "{C6854BB9-D594-46B0-9E10-72607CC97E77}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "octokit", "octokit", "{5C9C1D3B-0740-4EF3-A374-CCCD67FB6E48}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octokit-35", "..\octokit.net\Octokit\Octokit-35.csproj", "{49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http-net_3_5", "..\dotnet-httpclient35\System.Net.Http\System.Net.Http-net_3_5.csproj", "{9862694D-E4FA-418B-8692-A0280FEDDF36}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- dev|Any CPU = dev|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.dev|Any CPU.Build.0 = dev|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {ADD7A18B-DD2A-4C22-A2C1-488964EFF30A}.Release|Any CPU.Build.0 = Release|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.dev|Any CPU.Build.0 = dev|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B389ADAF-62CC-486E-85B4-2D8B078DF763}.Release|Any CPU.Build.0 = Release|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.ActiveCfg = dev|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.dev|Any CPU.Build.0 = dev|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BB6A8EDA-15D8-471B-A6ED-EE551E0B3BA0}.Release|Any CPU.Build.0 = Release|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.dev|Any CPU.Build.0 = Debug|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4}.Release|Any CPU.Build.0 = Release|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.dev|Any CPU.Build.0 = Debug|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9}.Release|Any CPU.Build.0 = Release|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.dev|Any CPU.Build.0 = Debug|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA}.Release|Any CPU.Build.0 = Release|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.dev|Any CPU.Build.0 = Debug|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7DEF4226-7740-457F-9199-34174C49A978}.Release|Any CPU.Build.0 = Release|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.dev|Any CPU.Build.0 = Debug|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF}.Release|Any CPU.Build.0 = Release|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.dev|Any CPU.Build.0 = Debug|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1A382F40-FD9E-43E1-89C1-320073F35CE9}.Release|Any CPU.Build.0 = Release|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.dev|Any CPU.Build.0 = Debug|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8}.Release|Any CPU.Build.0 = Release|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.dev|Any CPU.Build.0 = Debug|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4}.Release|Any CPU.Build.0 = Release|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.dev|Any CPU.ActiveCfg = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.dev|Any CPU.Build.0 = Debug|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9862694D-E4FA-418B-8692-A0280FEDDF36}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {44257C81-EE4A-4817-9AF4-A26C02AA6DD4} = {B50B646C-3B86-4BDA-9F2B-766F96608CE0}
- {69F13D9D-AD56-4EEC-AE10-D528EE23E1A9} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {1AC3F82E-AEAE-4C84-825C-207BB264FCFA} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {7DEF4226-7740-457F-9199-34174C49A978} = {B50B646C-3B86-4BDA-9F2B-766F96608CE0}
- {66A1D219-F61D-4AE4-9BD7-AAEB97276FFF} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {1A382F40-FD9E-43E1-89C1-320073F35CE9} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {08B87D2A-8CF1-4211-B7AA-5209F00F72F8} = {D17F1B4C-42DC-4E78-BCEF-9F239A084C4D}
- {49EF16A2-5ED1-480F-80A1-D1D05D6C1BE4} = {5C9C1D3B-0740-4EF3-A374-CCCD67FB6E48}
- {9862694D-E4FA-418B-8692-A0280FEDDF36} = {C6854BB9-D594-46B0-9E10-72607CC97E77}
- EndGlobalSection
-EndGlobal
diff --git a/common/build.targets b/common/build.targets
index ca88d77e4..450909d08 100644
--- a/common/build.targets
+++ b/common/build.targets
@@ -14,31 +14,6 @@
-
-
-
-
- {9862694d-e4fa-418b-8692-a0280feddf36}
- System.Net.Http-net_3_5
-
-
- {49ef16a2-5ed1-480f-80a1-d1d05d6c1be4}
- Octokit-35
-
-
-
-
-
-
- $(SolutionDir)lib\octokit.net\Octokit.dll
-
-
- $(SolutionDir)lib\dotnet-httpclient35\DotNetHttp35.dll
-
-
-
-
-
Location of Unity dlls is not set. You'll need to install Unity in a known location (the default installation directory for your system), or copy UnityEngine.dll and UnityEditor.dll to the {0}lib folder
diff --git a/common/properties.props b/common/properties.props
index 441fd006d..30e26a07d 100644
--- a/common/properties.props
+++ b/common/properties.props
@@ -2,7 +2,6 @@
- OctokitDebugging
Internal
$(SolutionDir)\script\lib\
diff --git a/lib/dotnet-httpClient35/DotNetHttp35.dll b/lib/dotnet-httpClient35/DotNetHttp35.dll
deleted file mode 100644
index 7e68fe5e3..000000000
--- a/lib/dotnet-httpClient35/DotNetHttp35.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6daaf4e57900d0a092a94dbe10aca3796ad7496f40347112b602a6ff6dcf0275
-size 123392
diff --git a/lib/dotnet-httpClient35/DotNetHttp35.dll.mdb b/lib/dotnet-httpClient35/DotNetHttp35.dll.mdb
deleted file mode 100644
index fdd070e10..000000000
--- a/lib/dotnet-httpClient35/DotNetHttp35.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:be437526dd7332f42ea2c10cf9548e5c8b4f3f0fc735d584294d72ba4d592e81
-size 47000
diff --git a/lib/dotnet-httpClient35/md5sums.txt b/lib/dotnet-httpClient35/md5sums.txt
deleted file mode 100644
index 4f97ea53b..000000000
--- a/lib/dotnet-httpClient35/md5sums.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-0b299a0c541e19a6205f1265da27e540 *DotNetHttp35.dll
-4698f765de6671c08befd610eb254013 *DotNetHttp35.dll.mdb
diff --git a/lib/dotnet-httpClient35/version.txt b/lib/dotnet-httpClient35/version.txt
deleted file mode 100644
index 38dcf35fb..000000000
--- a/lib/dotnet-httpClient35/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-3.5.0.0 3.5.22000.2-gfu 43d89b670547006521c95fc150d9b79506c208ca
\ No newline at end of file
diff --git a/lib/octokit.net/Octokit.dll b/lib/octokit.net/Octokit.dll
deleted file mode 100644
index fd797251f..000000000
--- a/lib/octokit.net/Octokit.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:cb297646723b439a8755e1b967a9f5850dd9c50f1126f1e6ba9ddd8677188f84
-size 741888
diff --git a/lib/octokit.net/Octokit.dll.mdb b/lib/octokit.net/Octokit.dll.mdb
deleted file mode 100644
index ef51d4875..000000000
--- a/lib/octokit.net/Octokit.dll.mdb
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ebdf240eb57a1154884fdc1ae5962e0d2af5f0c663fe5cb8f1897fa5c82b7218
-size 283050
diff --git a/lib/octokit.net/md5sums.txt b/lib/octokit.net/md5sums.txt
deleted file mode 100644
index 33bc5f2df..000000000
--- a/lib/octokit.net/md5sums.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-352dbd9611f700a9dbde52999752d88d *Octokit.dll
-883c04490791e7d4f63c2e918233dc55 *Octokit.dll.mdb
diff --git a/lib/octokit.net/version.txt b/lib/octokit.net/version.txt
deleted file mode 100644
index 1024bde64..000000000
--- a/lib/octokit.net/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.23.0.1 0.23.0.2-gfu 9784094cdd6192887dc97180918565c036c6b62c
\ No newline at end of file
diff --git a/script b/script
index cfc91b439..48d975141 160000
--- a/script
+++ b/script
@@ -1 +1 @@
-Subproject commit cfc91b4391debf6ef9c7829e34c65cfe56c83992
+Subproject commit 48d975141aae81c47fe64981518edc726ee520f0
diff --git a/src/GitHub.Api/Application/ApiClient.cs b/src/GitHub.Api/Application/ApiClient.cs
index 917c53269..468646461 100644
--- a/src/GitHub.Api/Application/ApiClient.cs
+++ b/src/GitHub.Api/Application/ApiClient.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Octokit;
using GitHub.Logging;
using System.Runtime.Serialization;
using System.Text;
@@ -19,7 +18,6 @@ public static IApiClient Create(UriString repositoryUrl, IKeychain keychain, IPr
var hostAddress = HostAddress.Create(repositoryUrl);
return new ApiClient(repositoryUrl, keychain,
- new GitHubClient(ApplicationConfiguration.ProductHeader, credentialStore, hostAddress.ApiUri),
processManager, taskManager, nodeJsExecutablePath, octorunScriptPath);
}
@@ -34,11 +32,10 @@ public static IApiClient Create(UriString repositoryUrl, IKeychain keychain, IPr
private readonly NPath octorunScriptPath;
private readonly ILoginManager loginManager;
- public ApiClient(UriString hostUrl, IKeychain keychain, IGitHubClient githubClient, IProcessManager processManager, ITaskManager taskManager, NPath nodeJsExecutablePath, NPath octorunScriptPath)
+ public ApiClient(UriString hostUrl, IKeychain keychain, IProcessManager processManager, ITaskManager taskManager, NPath nodeJsExecutablePath, NPath octorunScriptPath)
{
Guard.ArgumentNotNull(hostUrl, nameof(hostUrl));
Guard.ArgumentNotNull(keychain, nameof(keychain));
- Guard.ArgumentNotNull(githubClient, nameof(githubClient));
HostAddress = HostAddress.Create(hostUrl);
OriginalUrl = hostUrl;
@@ -64,12 +61,12 @@ private async Task LogoutInternal(UriString host)
await loginManager.Logout(host);
}
- public async Task CreateRepository(NewRepository newRepository, Action callback, string organization = null)
+ public async Task CreateRepository(string name, string description, bool isPrivate, Action callback, string organization = null)
{
Guard.ArgumentNotNull(callback, "callback");
try
{
- var repository = await CreateRepositoryInternal(newRepository, organization);
+ var repository = await CreateRepositoryInternal(name, organization, description, isPrivate);
callback(repository, null);
}
catch (Exception e)
@@ -201,7 +198,7 @@ public async Task ContinueLoginAsync(LoginResult loginResult, Func CreateRepositoryInternal(NewRepository newRepository, string organization)
+ private async Task CreateRepositoryInternal(string repositoryName, string organization, string description, bool isPrivate)
{
try
{
@@ -214,13 +211,13 @@ private async Task CreateRepositoryInternal(NewRepository newR
var keychainAdapter = await keychain.Load(uriString);
var command = new StringBuilder("publish -r \"");
- command.Append(newRepository.Name);
+ command.Append(repositoryName);
command.Append("\"");
- if (!string.IsNullOrEmpty(newRepository.Description))
+ if (!string.IsNullOrEmpty(description))
{
command.Append(" -d \"");
- command.Append(newRepository.Description);
+ command.Append(description);
command.Append("\"");
}
@@ -231,7 +228,7 @@ private async Task CreateRepositoryInternal(NewRepository newR
command.Append("\"");
}
- if (newRepository.Private ?? false)
+ if (isPrivate)
{
command.Append(" -p");
}
diff --git a/src/GitHub.Api/Application/ApplicationConfiguration.cs b/src/GitHub.Api/Application/ApplicationConfiguration.cs
index 0b4a4d31e..40d4e7933 100644
--- a/src/GitHub.Api/Application/ApplicationConfiguration.cs
+++ b/src/GitHub.Api/Application/ApplicationConfiguration.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using Octokit;
namespace GitHub.Unity
{
@@ -11,7 +10,6 @@ static ApplicationConfiguration()
{
var executingAssembly = typeof(ApplicationConfiguration).Assembly;
AssemblyName = executingAssembly.GetName();
- ProductHeader = new ProductHeaderValue(ApplicationInfo.ApplicationSafeName, AssemblyName.Version.ToString());
}
///
@@ -19,11 +17,6 @@ static ApplicationConfiguration()
///
public static AssemblyName AssemblyName { get; }
- ///
- /// The product header used in the user agent.
- ///
- public static ProductHeaderValue ProductHeader { get; private set; }
-
public static int WebTimeout { get; set; } = DefaultWebTimeout;
}
}
diff --git a/src/GitHub.Api/Application/ApplicationManagerBase.cs b/src/GitHub.Api/Application/ApplicationManagerBase.cs
index 8cad50ef8..870f82b4e 100644
--- a/src/GitHub.Api/Application/ApplicationManagerBase.cs
+++ b/src/GitHub.Api/Application/ApplicationManagerBase.cs
@@ -159,8 +159,7 @@ protected void SetupMetrics(string unityVersion, bool firstRun)
TaskManager,
Environment.FileSystem,
Environment.NodeJsExecutablePath,
- Environment.OctorunScriptPath,
- ApplicationConfiguration.ProductHeader);
+ Environment.OctorunScriptPath);
UsageTracker = new UsageTracker(metricsService, UserSettings, usagePath, id, unityVersion);
diff --git a/src/GitHub.Api/Application/IApiClient.cs b/src/GitHub.Api/Application/IApiClient.cs
index d4a87e3e2..438e9bbf5 100644
--- a/src/GitHub.Api/Application/IApiClient.cs
+++ b/src/GitHub.Api/Application/IApiClient.cs
@@ -1,7 +1,5 @@
using System.Threading.Tasks;
-using Octokit;
using System;
-using System.Collections.Generic;
namespace GitHub.Unity
{
@@ -9,7 +7,8 @@ interface IApiClient
{
HostAddress HostAddress { get; }
UriString OriginalUrl { get; }
- Task CreateRepository(NewRepository newRepository, Action callback, string organization = null);
+ Task CreateRepository(string name, string description, bool isPrivate,
+ Action callback, string organization = null);
Task GetOrganizations(Action onSuccess, Action onError = null);
Task Login(string username, string password, Action need2faCode, Action result);
Task ContinueLogin(LoginResult loginResult, string code);
diff --git a/src/GitHub.Api/Application/OctokitExtensions.cs b/src/GitHub.Api/Application/OctokitExtensions.cs
deleted file mode 100644
index c53101c74..000000000
--- a/src/GitHub.Api/Application/OctokitExtensions.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace GitHub.Unity
-{
- static class OctokitExtensions
- {
- public static GitHubUser ToGitHubUser(this Octokit.User user)
- {
- return new GitHubUser() {
- Name = user.Name,
- Login = user.Login,
- };
- }
-
- public static GitHubRepository ToGitHubRepository(this Octokit.Repository repository)
- {
- return new GitHubRepository {
- Name = repository.Name,
- CloneUrl = repository.CloneUrl
- };
- }
- }
-}
\ No newline at end of file
diff --git a/src/GitHub.Api/Authentication/ILoginManager.cs b/src/GitHub.Api/Authentication/ILoginManager.cs
index bbacf54a1..32defff79 100644
--- a/src/GitHub.Api/Authentication/ILoginManager.cs
+++ b/src/GitHub.Api/Authentication/ILoginManager.cs
@@ -1,5 +1,4 @@
using System.Threading.Tasks;
-using Octokit;
namespace GitHub.Unity
{
diff --git a/src/GitHub.Api/Authentication/Keychain.cs b/src/GitHub.Api/Authentication/Keychain.cs
index 204c80bc6..609966044 100644
--- a/src/GitHub.Api/Authentication/Keychain.cs
+++ b/src/GitHub.Api/Authentication/Keychain.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using Octokit;
using GitHub.Logging;
namespace GitHub.Unity
@@ -220,7 +219,7 @@ public async Task Save(UriString host)
throw new ArgumentException($"Host: {host} is not found");
}
- if (credentialAdapter.OctokitCredentials == Credentials.Anonymous)
+ if (string.IsNullOrEmpty(credentialAdapter.Credential.Token))
{
throw new InvalidOperationException("Anonymous credentials cannot be stored");
}
@@ -229,7 +228,7 @@ public async Task Save(UriString host)
if (connectionCache.ContainsKey(host))
connectionCache.Remove(host);
- connectionCache.Add(host, new Connection { Host = host, Username = credentialAdapter.OctokitCredentials.Login });
+ connectionCache.Add(host, new Connection { Host = host, Username = credentialAdapter.Credential.Username });
// flushes credential cache to disk (host and username only)
WriteCacheToDisk();
@@ -275,6 +274,6 @@ public void UpdateToken(UriString host, string token)
public bool HasKeys => connectionCache.Any();
- public bool NeedsLoad => HasKeys && FindOrCreateAdapter(connectionCache.First().Value.Host).OctokitCredentials == Credentials.Anonymous;
+ public bool NeedsLoad => HasKeys && FindOrCreateAdapter(connectionCache.First().Value.Host).Credential.Token != null;
}
}
\ No newline at end of file
diff --git a/src/GitHub.Api/Authentication/KeychainAdapter.cs b/src/GitHub.Api/Authentication/KeychainAdapter.cs
index f61a80855..3fdde60b3 100644
--- a/src/GitHub.Api/Authentication/KeychainAdapter.cs
+++ b/src/GitHub.Api/Authentication/KeychainAdapter.cs
@@ -1,44 +1,27 @@
-using System.Threading.Tasks;
-using Octokit;
-
-namespace GitHub.Unity
+namespace GitHub.Unity
{
class KeychainAdapter : IKeychainAdapter
{
- public Credentials OctokitCredentials { get; private set; } = Credentials.Anonymous;
public ICredential Credential { get; private set; }
public void Set(ICredential credential)
{
Credential = credential;
- OctokitCredentials = new Credentials(credential.Username, credential.Token);
}
public void UpdateToken(string token)
{
Credential.UpdateToken(token);
- OctokitCredentials = new Credentials(OctokitCredentials.Login, token);
}
public void Clear()
{
- OctokitCredentials = Credentials.Anonymous;
Credential = null;
}
-
- ///
- /// Implementation for Octokit
- ///
- /// Octokit credentials
- Task ICredentialStore.GetCredentials()
- {
- return TaskEx.FromResult(OctokitCredentials);
- }
}
- public interface IKeychainAdapter: ICredentialStore
+ public interface IKeychainAdapter
{
- Credentials OctokitCredentials { get; }
ICredential Credential { get; }
}
}
diff --git a/src/GitHub.Api/Authentication/LoginManager.cs b/src/GitHub.Api/Authentication/LoginManager.cs
index aaff724b6..c7b39dd5a 100644
--- a/src/GitHub.Api/Authentication/LoginManager.cs
+++ b/src/GitHub.Api/Authentication/LoginManager.cs
@@ -2,7 +2,6 @@
using System.Linq;
using System.Net;
using System.Threading.Tasks;
-using Octokit;
using GitHub.Logging;
namespace GitHub.Unity
@@ -23,12 +22,9 @@ class LoginManager : ILoginManager
{
private readonly ILogging logger = LogHelper.GetLogger();
- private readonly string[] scopes = { "user", "repo", "gist", "write:public_key" };
private readonly IKeychain keychain;
private readonly string clientId;
private readonly string clientSecret;
- private readonly string authorizationNote;
- private readonly string fingerprint;
private readonly IProcessManager processManager;
private readonly ITaskManager taskManager;
private readonly NPath? nodeJsExecutablePath;
@@ -40,8 +36,6 @@ class LoginManager : ILoginManager
///
/// The application's client API ID.
/// The application's client API secret.
- /// An note to store with the authorization.
- /// The machine fingerprint.
///
///
///
@@ -50,8 +44,6 @@ public LoginManager(
IKeychain keychain,
string clientId,
string clientSecret,
- string authorizationNote = null,
- string fingerprint = null,
IProcessManager processManager = null, ITaskManager taskManager = null, NPath? nodeJsExecutablePath = null, NPath? octorunScript = null)
{
Guard.ArgumentNotNull(keychain, nameof(keychain));
@@ -61,8 +53,6 @@ public LoginManager(
this.keychain = keychain;
this.clientId = clientId;
this.clientSecret = clientSecret;
- this.authorizationNote = authorizationNote;
- this.fingerprint = fingerprint;
this.processManager = processManager;
this.taskManager = taskManager;
this.nodeJsExecutablePath = nodeJsExecutablePath;
@@ -84,70 +74,32 @@ public async Task Login(
keychain.Connect(host);
keychain.SetCredentials(new Credential(host, username, password));
- var newAuth = new NewAuthorization
- {
- Scopes = scopes,
- Note = authorizationNote,
- Fingerprint = fingerprint,
- };
-
- ApplicationAuthorization auth = null;
-
+ string token;
try
{
- auth = await TryLogin(host, username, password);
- EnsureNonNullAuthorization(auth);
- }
- catch (TwoFactorAuthorizationException e)
- {
- LoginResultCodes result;
- if (e is TwoFactorRequiredException)
+ token = await TryLogin(host, username, password);
+ if (string.IsNullOrEmpty(token))
{
- result = LoginResultCodes.CodeRequired;
- logger.Trace("2FA TwoFactorAuthorizationException: {0} {1}", LoginResultCodes.CodeRequired, e.Message);
+ throw new InvalidOperationException("Returned token is null or empty");
}
- else
- {
- result = LoginResultCodes.CodeFailed;
- logger.Error(e, "2FA TwoFactorAuthorizationException: {0} {1}", LoginResultCodes.CodeRequired, e.Message);
- }
-
- return new LoginResultData(result, e.Message, host, newAuth);
- }
- catch(LoginAttemptsExceededException e)
- {
- logger.Warning(e, "Login LoginAttemptsExceededException: {0}", e.Message);
-
- await keychain.Clear(host, false);
- return new LoginResultData(LoginResultCodes.LockedOut, Localization.LockedOut, host);
}
- catch (ApiValidationException e)
+ catch (TwoFactorRequiredException e)
{
- logger.Warning(e, "Login ApiValidationException: {0}", e.Message);
+ LoginResultCodes result;
+ result = LoginResultCodes.CodeRequired;
+ logger.Trace("2FA TwoFactorAuthorizationException: {0} {1}", LoginResultCodes.CodeRequired, e.Message);
- var message = e.ApiError.FirstErrorMessageSafe();
- await keychain.Clear(host, false);
- return new LoginResultData(LoginResultCodes.Failed, message, host);
+ return new LoginResultData(result, e.Message, host, password);
}
catch (Exception e)
{
logger.Warning(e, "Login Exception");
- // Some enterprise instances don't support OAUTH, so fall back to using the
- // supplied password - on instances that don't support OAUTH the user should
- // be using a personal access token as the password.
- if (EnterpriseWorkaround(host, e))
- {
- auth = new ApplicationAuthorization(password);
- }
- else
- {
- await keychain.Clear(host, false);
- return new LoginResultData(LoginResultCodes.Failed, Localization.LoginFailed, host);
- }
+ await keychain.Clear(host, false);
+ return new LoginResultData(LoginResultCodes.Failed, Localization.LoginFailed, host);
}
- keychain.SetToken(host, auth.Token);
+ keychain.SetToken(host, token);
await keychain.Save(host);
return new LoginResultData(LoginResultCodes.Success, "Success", host);
@@ -155,7 +107,7 @@ public async Task Login(
public async Task ContinueLogin(LoginResultData loginResultData, string twofacode)
{
- var newAuth = loginResultData.NewAuth;
+ var token = loginResultData.Token;
var host = loginResultData.Host;
var keychainAdapter = keychain.Connect(host);
var username = keychainAdapter.Credential.Username;
@@ -163,29 +115,18 @@ public async Task ContinueLogin(LoginResultData loginResultData
try
{
logger.Trace("2FA Continue");
- var auth = await TryContinueLogin(host, username, password, twofacode);
-
- EnsureNonNullAuthorization(auth);
+ token = await TryContinueLogin(host, username, password, twofacode);
- keychain.SetToken(host, auth.Token);
+ if (string.IsNullOrEmpty(token))
+ {
+ throw new InvalidOperationException("Returned token is null or empty");
+ }
+
+ keychain.SetToken(host, token);
await keychain.Save(host);
return new LoginResultData(LoginResultCodes.Success, "", host);
}
- catch (TwoFactorAuthorizationException e)
- {
- logger.Trace(e, "2FA TwoFactorAuthorizationException: {0} {1}", LoginResultCodes.CodeFailed, e.Message);
-
- return new LoginResultData(LoginResultCodes.CodeFailed, Localization.Wrong2faCode, host, newAuth);
- }
- catch (ApiValidationException e)
- {
- logger.Trace(e, "2FA ApiValidationException: {0}", e.Message);
-
- var message = e.ApiError.FirstErrorMessageSafe();
- await keychain.Clear(host, false);
- return new LoginResultData(LoginResultCodes.Failed, message, host);
- }
catch (Exception e)
{
logger.Trace(e, "Exception: {0}", e.Message);
@@ -203,50 +144,7 @@ public async Task Logout(UriString hostAddress)
await new ActionTask(keychain.Clear(hostAddress, true)).StartAwait();
}
- private async Task CreateAndDeleteExistingApplicationAuthorization(
- IGitHubClient client,
- NewAuthorization newAuth,
- string twoFactorAuthenticationCode)
- {
- ApplicationAuthorization result;
- var retry = 0;
-
- do
- {
- if (twoFactorAuthenticationCode == null)
- {
-
- result = await client.Authorization.GetOrCreateApplicationAuthentication(
- clientId,
- clientSecret,
- newAuth);
- }
- else
- {
- result = await client.Authorization.GetOrCreateApplicationAuthentication(
- clientId,
- clientSecret,
- newAuth,
- twoFactorAuthenticationCode);
- }
-
- if (result.Token == string.Empty)
- {
- if (twoFactorAuthenticationCode == null)
- {
- await client.Authorization.Delete(result.Id);
- }
- else
- {
- await client.Authorization.Delete(result.Id, twoFactorAuthenticationCode);
- }
- }
- } while (result.Token == string.Empty && retry++ == 0);
-
- return result;
- }
-
- private async Task TryLogin(
+ private async Task TryLogin(
UriString host,
string username,
string password
@@ -262,7 +160,6 @@ string password
throw new InvalidOperationException("octorunScript must be set");
}
- ApplicationAuthorization auth;
var loginTask = new OctorunTask(taskManager.Token, nodeJsExecutablePath.Value, octorunScript.Value,
"login", ApplicationInfo.ClientId, ApplicationInfo.ClientSecret);
loginTask.Configure(processManager, workingDirectory: octorunScript.Value.Parent.Parent, withInput: true);
@@ -277,15 +174,14 @@ string password
if (ret.IsSuccess)
{
- auth = new ApplicationAuthorization(ret.Output[0]);
- return auth;
+ return ret.Output[0];
}
if (ret.IsCustom && ret.Status == "2fa")
{
keychain.SetToken(host, ret.Output[0]);
await keychain.Save(host);
- throw new TwoFactorRequiredException(TwoFactorType.Unknown);
+ throw new TwoFactorRequiredException();
}
if (ret.Output.Any())
@@ -296,7 +192,7 @@ string password
throw new Exception("Authentication failed");
}
- private async Task TryContinueLogin(
+ private async Task TryContinueLogin(
UriString host,
string username,
string password,
@@ -313,7 +209,6 @@ string code
throw new InvalidOperationException("octorunScript must be set");
}
- ApplicationAuthorization auth;
var loginTask = new OctorunTask(taskManager.Token, nodeJsExecutablePath.Value, octorunScript.Value,
"login --twoFactor", ApplicationInfo.ClientId, ApplicationInfo.ClientSecret);
loginTask.Configure(processManager, workingDirectory: octorunScript.Value.Parent.Parent, withInput: true);
@@ -329,8 +224,7 @@ string code
if (ret.IsSuccess)
{
- auth = new ApplicationAuthorization(ret.Output[0]);
- return auth;
+ return ret.Output[0];
}
if (ret.Output.Any())
@@ -340,47 +234,21 @@ string code
throw new Exception("Authentication failed");
}
-
- ApplicationAuthorization EnsureNonNullAuthorization(ApplicationAuthorization auth)
- {
- // If a mock IGitHubClient is not set up correctly, it can return null from
- // IGitHubClient.Authorization.Create - this will cause an infinite loop in Login()
- // so prevent that.
- if (auth == null)
- {
- throw new InvalidOperationException("IGitHubClient.Authorization.Create returned null.");
- }
-
- return auth;
- }
-
- bool EnterpriseWorkaround(UriString hostAddress, Exception e)
- {
- // Older Enterprise hosts either don't have the API end-point to PUT an authorization, or they
- // return 422 because they haven't white-listed our client ID. In that case, we just ignore
- // the failure, using basic authentication (with username and password) instead of trying
- // to get an authorization token.
- var apiException = e as ApiException;
- return !HostAddress.IsGitHubDotCom(hostAddress) &&
- (e is NotFoundException ||
- e is ForbiddenException ||
- apiException?.StatusCode == (HttpStatusCode)422);
- }
}
class LoginResultData
{
public LoginResultCodes Code;
public string Message;
- internal NewAuthorization NewAuth { get; set; }
+ internal string Token { get; set; }
internal UriString Host { get; set; }
internal LoginResultData(LoginResultCodes code, string message,
- UriString host, NewAuthorization newAuth)
+ UriString host, string token)
{
this.Code = code;
this.Message = message;
- this.NewAuth = newAuth;
+ this.Token = token;
this.Host = host;
}
@@ -390,4 +258,8 @@ internal LoginResultData(LoginResultCodes code, string message, UriString host)
}
}
+ class TwoFactorRequiredException : Exception
+ {
+
+ }
}
diff --git a/src/GitHub.Api/Extensions/ExceptionExtensions.cs b/src/GitHub.Api/Extensions/ExceptionExtensions.cs
index 162292d2c..a367bfdfc 100644
--- a/src/GitHub.Api/Extensions/ExceptionExtensions.cs
+++ b/src/GitHub.Api/Extensions/ExceptionExtensions.cs
@@ -1,29 +1,8 @@
using System;
-using System.Linq;
-using Octokit;
using System.Threading;
namespace GitHub.Unity
{
- static class ApiExceptionExtensions
- {
- const string GithubHeader = "X-GitHub-Request-Id";
- public static bool IsGitHubApiException(this Exception ex)
- {
- var apiex = ex as ApiException;
- return apiex?.HttpResponse?.Headers.ContainsKey(GithubHeader) ?? false;
- }
-
- public static string FirstErrorMessageSafe(this ApiError apiError)
- {
- if (apiError == null) return null;
- if (apiError.Errors == null) return apiError.Message;
- var firstError = apiError.Errors.FirstOrDefault();
- return firstError == null ? null : firstError.Message;
- }
-
- }
-
static class ExceptionExtensions
{
///
diff --git a/src/GitHub.Api/Git/RepositoryManager.cs b/src/GitHub.Api/Git/RepositoryManager.cs
index 119a62ea1..9e3566e7f 100644
--- a/src/GitHub.Api/Git/RepositoryManager.cs
+++ b/src/GitHub.Api/Git/RepositoryManager.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
-using System.Threading.Tasks;
-using Octokit;
using GitHub.Logging;
namespace GitHub.Unity
diff --git a/src/GitHub.Api/GitHub.Api.csproj b/src/GitHub.Api/GitHub.Api.csproj
index 54b6aaf55..7be58db4a 100644
--- a/src/GitHub.Api/GitHub.Api.csproj
+++ b/src/GitHub.Api/GitHub.Api.csproj
@@ -96,7 +96,6 @@
-
diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs
index 29d1505cc..1258bc54b 100644
--- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs
+++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Octokit;
using UnityEditor;
using UnityEngine;
@@ -163,11 +162,7 @@ public override void OnGUI()
var cleanRepoDescription = repoDescription.Trim();
cleanRepoDescription = string.IsNullOrEmpty(cleanRepoDescription) ? null : cleanRepoDescription;
- Client.CreateRepository(new NewRepository(repoName)
- {
- Private = togglePrivate,
- Description = cleanRepoDescription
- }, (repository, ex) =>
+ Client.CreateRepository(repoName, cleanRepoDescription, togglePrivate, (repository, ex) =>
{
if (ex != null)
{
diff --git a/src/tests/IntegrationTests/BasePlatformIntegrationTest.cs b/src/tests/IntegrationTests/BasePlatformIntegrationTest.cs
index 08c837fa7..d8e82f820 100644
--- a/src/tests/IntegrationTests/BasePlatformIntegrationTest.cs
+++ b/src/tests/IntegrationTests/BasePlatformIntegrationTest.cs
@@ -4,7 +4,6 @@
using System.Threading.Tasks;
using GitHub.Unity;
using NSubstitute;
-using Octokit;
namespace IntegrationTests
{
diff --git a/src/tests/UnitTests/Authentication/KeychainTests.cs b/src/tests/UnitTests/Authentication/KeychainTests.cs
index 292a92a4d..c15b6eb15 100644
--- a/src/tests/UnitTests/Authentication/KeychainTests.cs
+++ b/src/tests/UnitTests/Authentication/KeychainTests.cs
@@ -7,7 +7,6 @@
using NCrunch.Framework;
using NSubstitute;
using NUnit.Framework;
-using Octokit;
using TestUtils;
namespace UnitTests
@@ -183,10 +182,6 @@ public void ShouldLoadFromConnectionManager()
keychainAdapter.Credential.Token.Should().Be(token);
keychainAdapter.Credential.Host.Should().Be(hostUri);
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Basic);
- keychainAdapter.OctokitCredentials.Login.Should().Be(username);
- keychainAdapter.OctokitCredentials.Password.Should().Be(token);
-
credentialManager.Received(1).Load(hostUri);
credentialManager.DidNotReceive().HasCredentials();
credentialManager.DidNotReceive().Delete(Args.UriString);
@@ -231,10 +226,6 @@ public void ShouldDeleteFromCacheWhenLoadReturnsNullFromConnectionManager()
var keychainAdapter = keychain.Load(uriString).Result;
keychainAdapter.Credential.Should().BeNull();
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Anonymous);
- keychainAdapter.OctokitCredentials.Login.Should().BeNull();
- keychainAdapter.OctokitCredentials.Password.Should().BeNull();
-
fileSystem.DidNotReceive().FileExists(Args.String);
fileSystem.DidNotReceive().ReadAllText(Args.String);
fileSystem.DidNotReceive().FileDelete(Args.String);
@@ -294,10 +285,6 @@ public void ShouldConnectSetCredentialsTokenAndSave()
var keychainAdapter = keychain.Connect(hostUri);
keychainAdapter.Credential.Should().BeNull();
- keychainAdapter.OctokitCredentials.Should().NotBeNull();
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Anonymous);
- keychainAdapter.OctokitCredentials.Login.Should().BeNull();
- keychainAdapter.OctokitCredentials.Password.Should().BeNull();
keychain.SetCredentials(new Credential(hostUri, username, password));
@@ -305,9 +292,6 @@ public void ShouldConnectSetCredentialsTokenAndSave()
keychainAdapter.Credential.Host.Should().Be(hostUri);
keychainAdapter.Credential.Username.Should().Be(username);
keychainAdapter.Credential.Token.Should().Be(password);
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Basic);
- keychainAdapter.OctokitCredentials.Login.Should().Be(username);
- keychainAdapter.OctokitCredentials.Password.Should().Be(password);
keychain.SetToken(hostUri, token);
@@ -315,9 +299,6 @@ public void ShouldConnectSetCredentialsTokenAndSave()
keychainAdapter.Credential.Host.Should().Be(hostUri);
keychainAdapter.Credential.Username.Should().Be(username);
keychainAdapter.Credential.Token.Should().Be(token);
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Basic);
- keychainAdapter.OctokitCredentials.Login.Should().Be(username);
- keychainAdapter.OctokitCredentials.Password.Should().Be(token);
keychain.Save(hostUri).Wait();
@@ -379,10 +360,6 @@ public void ShouldConnectSetCredentialsAndClear()
var keychainAdapter = keychain.Connect(hostUri);
keychainAdapter.Credential.Should().BeNull();
- keychainAdapter.OctokitCredentials.Should().NotBeNull();
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Anonymous);
- keychainAdapter.OctokitCredentials.Login.Should().BeNull();
- keychainAdapter.OctokitCredentials.Password.Should().BeNull();
keychain.SetCredentials(new Credential(hostUri, username, password));
@@ -390,16 +367,10 @@ public void ShouldConnectSetCredentialsAndClear()
keychainAdapter.Credential.Host.Should().Be(hostUri);
keychainAdapter.Credential.Username.Should().Be(username);
keychainAdapter.Credential.Token.Should().Be(password);
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Basic);
- keychainAdapter.OctokitCredentials.Login.Should().Be(username);
- keychainAdapter.OctokitCredentials.Password.Should().Be(password);
keychain.Clear(hostUri, false).Wait();
keychainAdapter.Credential.Should().BeNull();
- keychainAdapter.OctokitCredentials.AuthenticationType.Should().Be(AuthenticationType.Anonymous);
- keychainAdapter.OctokitCredentials.Login.Should().BeNull();
- keychainAdapter.OctokitCredentials.Password.Should().BeNull();
fileSystem.DidNotReceive().FileExists(Args.String);
fileSystem.DidNotReceive().FileDelete(Args.String);