Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Added support for storing PAT tokens to Azure KeyVault #846

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
084a5ca
Added support for storing PAT tokens to Azure KeyVault
denislevin Apr 23, 2019
41b8f79
Set up CI with Azure Pipelines
denislevin Feb 5, 2021
9584410
Update azure-pipelines.yml for Azure Pipelines
denislevin Feb 5, 2021
9a8d5c2
Update azure-pipelines.yml for Azure Pipelines
denislevin Feb 5, 2021
19d8019
Update azure-pipelines.yml for Azure Pipelines
denislevin Feb 5, 2021
ae8d2ab
Update azure-pipelines.yml for Azure Pipelines
denislevin Feb 5, 2021
db0cddb
Update azure-pipelines.yml for Azure Pipelines
denislevin Feb 9, 2021
63479c5
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
1e91a94
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
887276f
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
dedfdc1
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
f37e040
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
30e506f
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
4714596
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
c405e1e
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
8258baf
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
e9bf0e8
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 12, 2021
04fcbac
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
ba9cfd9
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
3a992d7
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
afbb56c
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
fc4bd79
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
893bb70
Set up CI with Azure Pipelines
denislevin Oct 16, 2021
aae4bf3
Update azure-pipelines.yml for Azure Pipelines
denislevin Oct 16, 2021
c89b5ae
Update azure-pipelines.yml for Azure Pipelines
denislevin Nov 4, 2021
e33d74f
Update azure-pipelines.yml for Azure Pipelines
denislevin Nov 4, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AzureDevOps.Authentication.Test</RootNamespace>
<AssemblyName>AzureDevOps.Authentication.Proxy</AssemblyName>
<NuGetPackageImportStamp />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="..\..\Proxy.props" />
<ItemGroup>
Expand All @@ -31,8 +34,8 @@
<Reference Include="Moq, Version=4.8.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\packages\Moq.4.8.2\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand All @@ -56,7 +59,9 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
2 changes: 1 addition & 1 deletion AzureDevOps.Authentication/Proxy/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Castle.Core" version="4.2.1" targetFramework="net472" />
<package id="Microsoft.Net.Compilers" version="2.8.0" targetFramework="net472" developmentDependency="true" />
<package id="Moq" version="4.8.2" targetFramework="net472" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.4.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
<ProjectGuid>{19770407-D7D8-4A37-914C-F552FF4B90D4}</ProjectGuid>
<ProjectName>AzureDevOps.Authentication</ProjectName>
<RootNamespace>AzureDevOps.Authentication</RootNamespace>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="..\..\build.props" />
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
<OutputPath>$(ProjectDir)$(OutputPath)</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.4.11002, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.4.5.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.4.11002, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Bitbucket.Authentication.Test</RootNamespace>
<AssemblyName>Bitbucket.Authentication.Proxy</AssemblyName>
<NuGetPackageImportStamp />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="..\..\Proxy.props" />
<ItemGroup>
Expand All @@ -31,8 +34,8 @@
<Reference Include="Moq, Version=4.8.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\packages\Moq.4.8.2\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down
3 changes: 2 additions & 1 deletion Bitbucket.Authentication/Src/Bitbucket.Authentication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<ProjectGuid>{EE663736-5BAD-4CA6-A4F8-99978925AD8A}</ProjectGuid>
<ProjectName>Bitbucket.Authentication</ProjectName>
<RootNamespace>Atlassian.Bitbucket.Authentication</RootNamespace>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="..\..\build.props" />
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="..\..\test.props" />
<PropertyGroup>
Expand Down
23 changes: 22 additions & 1 deletion Cli/Manager/Cli-Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>git-credential-manager</AssemblyName>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<OutputType>Exe</OutputType>
<ProjectGuid>{19770407-63D4-40A8-A9DF-F1C4B473308A}</ProjectGuid>
<ProjectName>Cli-Manager</ProjectName>
Expand All @@ -24,10 +25,25 @@
<StartArguments Condition=" '$(StartArguments)' == '' OR '$(StartArguments)' == '*Undefined*' ">get</StartArguments>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Services.AppAuthentication, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\lib\net452\Microsoft.Azure.Services.AppAuthentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.4.5.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Bitbucket.Authentication\Src\Bitbucket.Authentication.csproj">
Expand Down Expand Up @@ -57,6 +73,9 @@
<None Include="app.config">
<InProject>false</InProject>
</None>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand All @@ -67,5 +86,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Net.Compilers.2.8.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Net.Compilers.2.8.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets" Condition="Exists('..\..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets')" />
</Project>
21 changes: 19 additions & 2 deletions Cli/Manager/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.11002" newVersion="3.19.4.11002" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
2 changes: 2 additions & 0 deletions Cli/Manager/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.Services.AppAuthentication" version="1.0.3" targetFramework="net452" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="4.5.0" targetFramework="net452" />
<package id="Microsoft.Net.Compilers" version="2.8.0" targetFramework="net452" developmentDependency="true" />
<package id="Pandoc.Windows" version="2.1.0" developmentDependency="true" />
<package id="Tools.InnoSetup" version="5.5.9" targetFramework="net452" />
Expand Down
4 changes: 2 additions & 2 deletions Cli/Test/ProgramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using Microsoft.Alm.Authentication;
using Moq;
using Xunit;
using Azure = AzureDevOps.Authentication;
using AzureDev = AzureDevOps.Authentication;
using Git = Microsoft.Alm.Authentication.Git;

namespace Microsoft.Alm.Cli.Test
Expand Down Expand Up @@ -108,7 +108,7 @@ public async Task LoadOperationArgumentsTest()

Assert.NotNull(opargs.DevOpsTokenScope);

var expectedScope = Azure.TokenScope.BuildAccess | Azure.TokenScope.CodeWrite;
var expectedScope = AzureDev.TokenScope.BuildAccess | AzureDev.TokenScope.CodeWrite;
Assert.Equal(expectedScope, opargs.DevOpsTokenScope);
}

Expand Down
12 changes: 12 additions & 0 deletions Cli/Test/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.11002" newVersion="3.19.4.11002" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<Reference Include="Moq, Version=4.8.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\packages\Moq.4.8.2\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down
2 changes: 1 addition & 1 deletion GitHub.Authentication/Src/GitHub.Authentication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ProjectName>GitHub.Authentication</ProjectName>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<RootNamespace>GitHub.Authentication</RootNamespace>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="..\..\build.props" />
<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions GitHub.Authentication/Test/AuthenticationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task GetSetCredentialsNormalizesGistUrls(string writeUriString, str
new Authentication.AcquireAuthenticationCodeDelegate(prompts.AuthenticationCodeModalPrompt),
null);

await authentication.SetCredentials(new Uri(writeUriString), new Credential("haacked"));
await authentication.SetCredentials(new Uri(writeUriString), new Credential("haacked", string.Empty));
var credentials = await authentication.GetCredentials(retrieveUri);
Assert.Equal("haacked", credentials.Username);
}
Expand All @@ -48,7 +48,7 @@ public async Task GetSetCredentialsDoesNotReturnCredentialForRandomUrl()
new Authentication.AcquireAuthenticationCodeDelegate(prompts.AuthenticationCodeModalPrompt),
null);

await authentication.SetCredentials(new Uri("https://github.com/"), new Credential("haacked"));
await authentication.SetCredentials(new Uri("https://github.com/"), new Credential("haacked", string.Empty));

Assert.Null(await authentication.GetCredentials(retrieveUri));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<Reference Include="Moq, Version=4.8.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\..\packages\Moq.4.8.2\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
22 changes: 7 additions & 15 deletions Microsoft.Alm.Authentication/Src/Credential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,17 @@ public sealed class Credential : Secret, IEquatable<Credential>
/// <summary>
/// Creates a credential object with a username and password pair.
/// </summary>
/// <param name="username">The username value of the `<see cref="Credential"/>`.</param>
/// <param name="password">The password value of the `<see cref="Credential"/>`.</param>
public Credential(string username, string password)
/// <param name="Username">The username value of the `<see cref="Credential"/>`.</param>
/// <param name="Password">The password value of the `<see cref="Credential"/>`.</param>
public Credential(string Username, string Password)
{
if (username is null)
throw new ArgumentNullException(nameof(username));
if (Username is null)
throw new ArgumentNullException(nameof(Username));

_password = password ?? string.Empty;
_username = username;
_password = Password ?? string.Empty;
_username = Username;
}

/// <summary>
/// Creates a credential object with only a username.
/// </summary>
/// <param name="username">The username value of the `<see cref="Credential"/>`.</param>
public Credential(string username)
: this(username, string.Empty)
{ }

private readonly string _password;
private readonly string _username;

Expand Down
Loading