Clean up the proxy project files by adding a 'proxy.props' file to the root of the repository with common properties for proxy projects.
Update all proxy projects to reference the common 'proxy.props' file and remove the common properties from the individual project files.
Xunit assumes all necissary test information is contained within the serialized data-member. Instead of calculating the iteration number, the value is explicitly added to the data-member rows.
Provide capture and reply proxy project for 'Github.Authentication'.
- [x] Provide capture proxy.
- [x] Provide replay proxy.
- [x] Extend `Microsoft.Alm.Authentication.Test.UnitTestBase` with specialized support for GitHub vua `IGui`.
In preparation for adopting the capture and reply framework, the GUI static, global interface needs to abstracted into a contextual service.
- [x] Provide `IRuntimeService` based service, encapsulating GUI API.
- [x] Provide an extention of the `MS.ALM.Base` type exposing the new runtime service.
- [x] Adopt contextual service provider based GUI API.
In preparation for adopting capture and replay framework, global static serices need to be replaced by contextual services.
- [x] Complete network abstraction service.
- [x] Provide types for data encapsulation handled by network service.
- [x] Adopt contextual network service.
In preparation for establishing capture and replay framework, global static services need to be replaced with context provided services.
- [x] Provide a settings service provider.
- [x] Abstract `System.Environment` functionality through service provider.
- [x] Adopt contextual service provider settings abstraction.
- [x] Restore the MicroBuild tasks.
- [x] Enable signing of artifacts.
The release build was somehow broken, this change should be sufficient to repair it.
Only append the "X-GitHub-OTP" header if there's a value to append with it. Including the header without a value appears cause github.com to emit 2FA SMS messages.
Group all of the shared projects under the same folder "Shared/", and update all referencing projects.
- Move "Shared/" -> "Shared/Win32/"
- Move "Cli/Shared/" -> "Shared/Cli/".
- Move "Gui-Shared/" -> "Shared/Gui/".
- Update project and solution files.
Add the ability to read the remote name and URL from the parent git-remote-http(s).exe process. The process must a parent of the current process.
Update `TargetUri` to accept a `commandUri` as part of its constructor; enabling the type to carry the URL read from the git-remote-http(s).exe process.
Add new `.CreateWith(...)` methods to `TargetUri` to more easily create new instances with only partial updates.
As the project has aged, its structure has not held up as well as one would hope over time. This changes the layout of the project to improve compactness, cleanliness, and understadability.
- Move all 'Cli-*' projects under a common 'Cli/' folder.
- Rename 'Cli-CredentialHelper' -> 'Cli/Manager'
- Rename 'Cli-Askpass' -> 'Cli/Askpass'
- Rename 'Cli-CredentialHelper.Test' -> 'Cli/Test'
- Compact library and dependency layouts
- Move 'Bitbucket.Authentication' -> 'Bitbucket.Authentication/Src'
- Move 'Bitbucket.Authentication.Test' -> 'Bitbucket.Authentication/Test'
- Move 'GitHub.Authentication' -> 'GitHub.Authentication/Src'
- Move 'GitHub.Authentication.Test' -> 'GitHub.Authentication/Test'
- Add 'ProjectName' values to all projects that the "Installer.proj" has a dependency on.
- Delete "Microsoft.Alm.Authentication.nuspec".
- Rename "Microsoft.Alm.Authentication.symbols.nuspec" to "Microsoft.Alm.Authentication.nuspec".
- Update the nupkg dependency to the correct 'Microsoft.IdentityModel.Clients.ActiveDirectory v3.19.4'.
- Add 'Microsoft.Alm.Authentication.{version}.nupkg' to the list of files to be signed.
- Add error checks to "Installer.proj" to ensure that the 'Condition' and 'Platform' properties are correctly set.
Instead of passing the parent window handle (aka hwnd) via the command line, the value ought to be passed via environment variable. This is because the primary use-case is for Git to invoke the GCM.
In the case of IDE invoking GIt, using environment variables provides a way for the IDE to specify which window ought to be the GCM's parent, despite Git being an intermediary.
Adds a new argument to git-credential-manager.exe to enable any UI shown
by gcm to parent itself to an existing window. This allows other
applications to more easily incorporate gcm's existing sign in UI.
1. For 'get' or 'fill' commands there is a new command line switch named
"--ownerHwnd" which takes a intgeger in either decimal or hexidecimal
(0x) format.
2. Parse the argument into an IntPtr stored in the RuntimeContext.
3. All Windows credential dialogs and WPF Windows use this hwnd value
as their parent.
During refactoring the endpoint called by the authorization request for Github was set to url of github.com while is should have been the authority url
Now that the 'Microsoft.Alm.Git' assembly has been merged into the 'Microsoft.Alm.Authentication' assembly, the namespaces need to be updated accordingly.
Since every assembly with a dependency on 'Microsoft.Alm.Authentication' also required a dependency on 'Microsoft.Alm.Git' (due to the sheer number of Git types in the Authentication API) there was a strong "code smell".
This change merges the 'Microsoft.Alm.Git' assembly into the 'Microsoft.Alm.Authentication' assembly. Reducing the number of assemblies produced by 2 (library & test).
Following commit will correct namespaces and usage.
At some point in the past, there was a valid reason to keep query and actual URI separate concepts within `TargetUri`. However, that time has passed and having both concepts is confusion. This patch remedies the confusion by removing the `ActualUri` concept, leaving `TargerUri` with `QueryUri` and `ProxyUri`.
Modify `OperationArguments` to track credentials as a `Credential` type field. Changed the logic so that `OperationArguments.Username` is set via initialization and no longer by `.SetCredentials`. This enables the GCM to differentiate between username passed in as an argument from Git (assume part of target URL) and arguments passed in by user as part of answering a prompt.
Having the `TargetFrameworkVersion` property contained in the shared build.props file confused Visual Studio.
Specifying the property in each .csproj help Visual Studio build the solution correctly.
Begin a round of code modernization.
* Start using constructs like `if (obj is null)` and `nameof(obj)`.
* Add missing comments where necessary.
* Clean up comments, and make them consistent across the solution.
* Clean up typos and misspellings.
Completes the initial effort to enable binary + installer signing support.
Using the MicroBuild solution, signing is now enabled for any environment which is setup to support it; and a pass-through operation for environments where it is not.
Final outputs will be in the Deploy/ folder, which will only contain the Microsoft.Alm.Authentication.{version}.nupkg, gcmw-v{version}.zip, and GCMW-{version}.exe files after a successful build.
If a user supplies a personal access token (PAT), we simply store that token after validating it. This takes advantage of a quirk of the API which returns an HTTP Forbidden response in this specific case.
Fixes#496
Gists are backed by git repositories hosted on GitHub.com, but the host name for these repos are "gist.github.com" and not "github.com".
This confuses the GCM as it tries to retrieve credentials for gist.github.com in this case. This change normalizes such URLs so that any operation against "gist.github.com" goes against "github.com".
This is special cased against gist.github.com rather than global because you never know if GitHub might use subdomains for other purposes in the future.
Fixes#495