-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from microsoft/main
Cut new release with GHES OAuth support and x-platform UI
- Loading branch information
Showing
66 changed files
with
3,070 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ jobs: | |
steps: | ||
- id: update-winget | ||
name: Update winget repository | ||
uses: mjcheetham/[email protected].1 | ||
uses: mjcheetham/[email protected].2 | ||
with: | ||
id: Microsoft.GitCredentialManagerCore | ||
token: ${{ secrets.WINGET_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform"> | ||
<Canvas Name="svg815" Width="256" Height="256"> | ||
<Canvas.RenderTransform> | ||
<TranslateTransform X="0" Y="0"/> | ||
</Canvas.RenderTransform> | ||
<Canvas.Resources/> | ||
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path8" Fill="#FFF05033" StrokeThickness="2.24708056"> | ||
<Path.Data> | ||
<PathGeometry Figures="m 127.74219 0 c -4.21881 0 -8.43843 1.6093415 -11.65821 4.828125 L 92.875 28.041016 122.31445 57.482422 c 6.84425 -2.310946 14.68947 -0.761046 20.14258 4.693359 5.48141 5.488392 7.0192 13.400136 4.65039 20.267578 l 28.37696 28.376951 c 6.86492 -2.36579 14.78398 -0.83727 20.26562 4.6543 7.66374 7.66179 7.66374 20.07642 0 27.74023 -7.66486 7.66631 -20.07893 7.66631 -27.74805 0 -5.76254 -5.76724 -7.18821 -14.23373 -4.26953 -21.33398 l -26.46289 -26.464844 -0.002 69.640624 c 1.8684 0.92496 3.63248 2.16064 5.18945 3.71094 7.66148 7.6609 7.66148 20.07236 0 27.74609 -7.66374 7.66066 -20.08459 7.66066 -27.74023 0 -7.66262 -7.67305 -7.66262 -20.08452 0 -27.74609 1.89369 -1.89039 4.08382 -3.32218 6.42187 -4.28125 V 94.199219 c -2.33912 -0.955028 -4.52734 -2.375687 -6.42383 -4.28125 -5.80409 -5.799832 -7.20125 -14.319608 -4.22461 -21.447266 L 81.466797 39.443359 4.8300781 116.08203 c -6.4393305 6.44252 -6.4393305 16.88229 0 23.32031 L 42.5 177.07227 V 162.70508 C 35.078345 157.16403 29.678851 149.02425 27.328125 140.07617 19.76286 115.647 40.902921 87.908596 66.359375 88.345703 76.747705 88.003924 87.132367 91.94485 94.875 98.837891 c 18.78493 15.372969 17.87151 47.496839 -0.888672 62.484379 l -2.566406 1.3457 0.222656 12.46503 -8.160156 8.24395 v 34.67578 l 33.119138 33.11915 c 6.43505 6.43757 16.87041 6.43757 23.31446 0 L 251.17188 139.92969 c 6.43732 -6.4407 6.43732 -16.88336 0 -23.32227 l 0.002 -0.01 L 139.39453 4.828125 C 136.1788 1.6093415 131.96099 0 127.74219 0 Z" FillRule="NonZero"/> | ||
</Path.Data> | ||
</Path> | ||
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path831" Fill="#FF4D4D4D" StrokeThickness="4.12109041"> | ||
<Path.Data> | ||
<PathGeometry Figures="M 67.333984 94.333984 A 35.333332 35.333332 0 0 0 32 129.66602 A 35.333332 35.333332 0 0 0 48.5 159.54688 L 48.5 234.5 L 54.5 240 L 67 240 L 79 228 L 79 216.5 L 73 210 L 79 203.5 L 73 197 L 79 191 L 73 185.5 L 85.5 173 L 85.5 159.92188 A 35.333332 35.333332 0 0 0 102.66602 129.66602 A 35.333332 35.333332 0 0 0 67.333984 94.333984 z M 66.777344 109 A 9 9 0 0 1 75.777344 118 A 9 9 0 0 1 66.777344 127 A 9 9 0 0 1 57.777344 118 A 9 9 0 0 1 66.777344 109 z M 54.5 168 L 60.5 173 L 60.5 234.5 L 54.5 228 L 54.5 168 z " FillRule="NonZero"/> | ||
</Path.Data> | ||
</Path> | ||
</Canvas> | ||
</Viewbox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
src/shared/Atlassian.Bitbucket.UI/Atlassian.Bitbucket.UI.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<RuntimeIdentifiers>osx-x64;linux-x64</RuntimeIdentifiers> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Atlassian.Bitbucket\Atlassian.Bitbucket.csproj" /> | ||
<ProjectReference Include="..\Microsoft.Git.CredentialManager.UI\Microsoft.Git.CredentialManager.UI.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Controls\TesterWindow.axaml.cs"> | ||
<DependentUpon>TesterWindow.axaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<AvaloniaResource Include="Assets\**" /> | ||
</ItemGroup> | ||
|
||
</Project> |
49 changes: 49 additions & 0 deletions
49
src/shared/Atlassian.Bitbucket.UI/Commands/CredentialsCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.CommandLine; | ||
using System.CommandLine.Invocation; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Atlassian.Bitbucket.UI.ViewModels; | ||
using Atlassian.Bitbucket.UI.Views; | ||
using Microsoft.Git.CredentialManager; | ||
using Microsoft.Git.CredentialManager.UI; | ||
|
||
namespace Atlassian.Bitbucket.UI.Commands | ||
{ | ||
internal class CredentialsCommand : HelperCommand | ||
{ | ||
public CredentialsCommand(CommandContext context) | ||
: base(context, "userpass", "Show authentication prompt.") | ||
{ | ||
AddOption( | ||
new Option<string>("--username", "Username or email.") | ||
); | ||
|
||
Handler = CommandHandler.Create<string>(ExecuteAsync); | ||
} | ||
|
||
private async Task<int> ExecuteAsync(string userName) | ||
{ | ||
var viewModel = new CredentialsViewModel(Context.Environment) | ||
{ | ||
UserName = userName | ||
}; | ||
|
||
await AvaloniaUi.ShowViewAsync<CredentialsView>(viewModel, GetParentHandle(), CancellationToken.None); | ||
|
||
if (!viewModel.WindowResult) | ||
{ | ||
throw new Exception("User cancelled dialog."); | ||
} | ||
|
||
WriteResult(new Dictionary<string, string> | ||
{ | ||
["username"] = viewModel.UserName, | ||
["password"] = viewModel.Password, | ||
}); | ||
|
||
return 0; | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/shared/Atlassian.Bitbucket.UI/Commands/OAuthCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.CommandLine; | ||
using System.CommandLine.Invocation; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Atlassian.Bitbucket.UI.ViewModels; | ||
using Atlassian.Bitbucket.UI.Views; | ||
using Microsoft.Git.CredentialManager; | ||
using Microsoft.Git.CredentialManager.UI; | ||
|
||
namespace Atlassian.Bitbucket.UI.Commands | ||
{ | ||
internal class OAuthCommand : HelperCommand | ||
{ | ||
public OAuthCommand(CommandContext context) | ||
: base(context, "oauth", "Show OAuth required prompt.") | ||
{ | ||
Handler = CommandHandler.Create(ExecuteAsync); | ||
} | ||
|
||
private async Task<int> ExecuteAsync() | ||
{ | ||
var viewModel = new OAuthViewModel(Context.Environment); | ||
await AvaloniaUi.ShowViewAsync<OAuthView>(viewModel, GetParentHandle(), CancellationToken.None); | ||
|
||
if (!viewModel.WindowResult) | ||
{ | ||
throw new Exception("User cancelled dialog."); | ||
} | ||
|
||
WriteResult(new Dictionary<string, string> | ||
{ | ||
["continue"] = "true" | ||
}); | ||
|
||
return 0; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/shared/Atlassian.Bitbucket.UI/Controls/TesterWindow.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="Atlassian.Bitbucket.UI.Controls.TesterWindow" | ||
Title="Bitbucket Authentication Dialog Tester" | ||
Height="240" Width="420" CanResize="False"> | ||
<DockPanel> | ||
<Button Content="Show Credentials Dialog" Padding="10" Click="ShowCredentials" /> | ||
<Button Content="Show OAuth Dialog" Padding="10" Click="ShowOAuth" /> | ||
</DockPanel> | ||
</Window> |
Oops, something went wrong.