1
0
Форкнуть 0
Граф коммитов

112 Коммитов

Автор SHA1 Сообщение Дата
J Wyman 40cac28aec sln: clean up proxy project files.
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.
2018-07-27 23:51:46 -04:00
J Wyman ∞ b9ed7f13bd test: Fix theory iteration suport.
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.
2018-07-18 17:50:47 -04:00
J Wyman ∞ 99a831306b github: add capture and replay proxy.
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`.
2018-07-18 15:50:04 -04:00
J Wyman ∞ b4e066be5b github: add GUI abstraction layer.
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.
2018-07-18 15:49:34 -04:00
J Wyman ∞ 8859cbc9c0 alm: complete network abstraction.
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.
2018-07-18 10:38:18 -04:00
J Wyman ∞ 628bfc8ae7 alm: abstract settings.
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.
2018-07-18 10:34:51 -04:00
J Wyman ∞ d0f2aab457 build: enable artifact signing
- [x] Restore the MicroBuild tasks.
  - [x] Enable signing of artifacts.

The release build was somehow broken, this change should be sufficient to repair it.
2018-07-03 17:34:29 -04:00
J Wyman ∞ f7a726a5a3 github: conditionally append OTP header
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.
2018-05-25 12:31:09 -04:00
J Wyman ∞ 9634ab0d30 shared: collate all shared projects
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.
2018-05-17 16:11:59 -04:00
J Wyman ∞ 8bd2557579 cli-shared: read URL from git-remote-https process.
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.
2018-05-17 13:44:16 -04:00
J Wyman ∞ eea4b0e8f9 sln: restructure the project layout
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'
2018-05-14 16:10:36 -04:00
J Wyman ∞ f5cf1cd578 build: only emit one nupkg and sign it.
- 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.
2018-05-04 11:02:33 -04:00
J Wyman ∞ 42e0fa7716 vsts: better net failure tracing.
Improve the tracing for network failure by tracing the HTTP status code and reason.
2018-05-03 08:48:02 -04:00
J Wyman ∞ cd1798f25b build: update version numbers.
- alm: 4.3.0 -> 4.4.0
  - vsts: 4.3.0 -> 4.4.0
  - bitbucket: 1.2.0 -> 2.0.0
  - github: 1.4.0 -> 1.5.0
  - cli-manager: 1.15.0 -> 1.16.0
  - cli-askpass: 1.15.0 -> 1.16.0
2018-05-02 17:39:58 -04:00
J Wyman ∞ e93767f924 dependencies: update dependencies
- Microsoft.Net.Compilers: 2.7.0 -> 2.8.0
  - NuGet.CommandLine: 4.4.1 -> 4.6.2
  - xunit.analyzers: 0.7.0 -> 0.8.0
  - Castle.Core: 4.1.1 -> 4.2.1
  - Moq: 4.7.127 -> 4.8.2
  - System.Threading.Tasks.Extensions: 4.4.0
  - System.ValueTuple: 4.4.0
2018-05-02 17:35:25 -04:00
J Wyman ∞ c9558031ff analysis: clean up many of the warnings.
Clean up analyzer warnings and/or disable unnecissary analyzers.
2018-05-01 16:35:02 -04:00
J Wyman 5ecef13b36
Merge pull request #604 from chuckries/hwndParent
Add --ownerHwnd command line switch
2018-04-30 09:24:23 -04:00
J Wyman ∞ 904d7bd8d5 Update compiler for all projects.
Microsoft.Net.Compiler: 2.4.0 -> 2.7.0
2018-04-27 16:07:14 -04:00
J Wyman ∞ d61ac55806 cli: change parent hwnd to envvar.
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.
2018-04-26 01:13:31 -04:00
Chuck Ries f6b1adb24a Enable --ownerHwnd for git-credential-manager.exe
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.
2018-04-06 10:37:39 -07:00
J Wyman 71c7908120
Merge pull request #589 from simonech/patch-2
Timeout is in milliseconds
2018-03-15 23:38:18 -04:00
Simone Chiaretta 3812d2a3e9
Changed request uri to authority url
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
2018-03-16 01:56:38 +01:00
Simone Chiaretta 6bbaca548e
Timeout is in milliseconds
Timeout was set FromDays(15000) which resulted in exception
2018-03-15 23:58:40 +01:00
J Wyman 6bbf76f0b8 authentication: Adopt network-as-a-service.
Adopt `Network` as a service provided by `RuntimeContext`.
2018-03-08 15:17:16 -05:00
J Wyman ∞ 79f5b2acec authentication: Trace as a service.
Convert the `Trace` type into a service provided by `RuntimeContext`.
2018-03-08 11:30:54 -05:00
J Wyman ∞ 52881a8ae2 github: Adopt runtime-context service-provider model. 2018-03-06 12:07:30 -05:00
J Wyman ∞ 602a623f09 authentication: Add base class to all types.
All non-static classes now inherit from the base type `Base` which will enable service-provider like functionality.
2018-03-06 10:31:07 -05:00
J Wyman ∞ 72093af765 authentication: Adopt async model.
Adopt the async interface model for authentication and secret storage.
2018-03-06 00:03:55 -05:00
J Wyman 21f917821f authentication: Udpate assembly namespaces.
Now that the 'Microsoft.Alm.Git' assembly has been merged into the 'Microsoft.Alm.Authentication' assembly, the namespaces need to be updated accordingly.
2018-03-05 12:50:53 -05:00
J Wyman 61e584442f alm.git: Remove the 'Microsoft.Alm.Git' project from solution.
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.
2018-03-05 12:50:53 -05:00
J Wyman ∞ 34d634e70c cli-shared: Remove the concept to of actual vs query URI values.
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.
2018-02-15 17:37:53 -05:00
J Wyman 082a51f0e2 build: correct .csproj properties to make Visual Studio happy.
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.
2018-01-20 01:53:21 -05:00
J Wyman 084f0236e2 github.auth: clean up code and comments.
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.
2018-01-20 01:23:52 -05:00
J Wyman ∞ a8b6de4319 installer: add Installer project.
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.
2018-01-18 18:44:09 -05:00
J Wyman ∞ 82b2c47db9 Update version numbers:
Bitbucket 1.0.2 -> 1.1.0
Askpass: 1.12.0 -> 1.14.0
Credential-Helper: 1.12.0 -> 1.14.0
GitHub: 1.3.0 -> 1.4.0
MS.Alm.Authentication: 4.1.0 -> 4.2.0
MS.Alm.Git: 1.2.0 -> 1.3.0
MS.Vsts.Authentication: 4.1.0 -> 4.2.0
2017-11-16 11:47:41 -05:00
J Wyman ∞ 869eac9fd2 Update Nupkg dependencies:
Micorsoft.Net.Compilers: 2.3.2 -> 2.4.0
2017-11-16 11:47:38 -05:00
Phil Haack 42fb21e947 Allow using a PAT for password
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
2017-09-30 15:51:20 -07:00
Phil Haack 453e15699a Use DnsSafeHost
The existing code is probably just fine, but this follows the pattern used elsewhere.
2017-09-30 10:45:40 -07:00
Phil Haack 1d8ba598fa Simplify namespaces 2017-09-30 10:45:06 -07:00
Phil Haack a4c759fc0d C# 7 throw expressions for the win!
Just a tiny bit of code cleanup. No behavioral change.
2017-09-30 10:44:54 -07:00
Phil Haack f3798ffd28 Explicitly test the gist.github.com case 2017-09-29 08:38:12 -07:00
Phil Haack 6d45f43cca Only create the URI once
This is probably not a big deal, but it just feels better to not create a URI every time.
2017-09-28 15:06:22 -07:00
Phil Haack ef5b401dbd Authenticate gist repos properly
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
2017-09-28 15:04:08 -07:00
J Wyman fb9e88b7bc Update Microsoft.Net.Compiler version.
Version 2.2.0 -> 2.3.2
2017-09-20 11:22:21 -04:00
J Wyman 3b75464958 Clean up source code and licenses.
Ran CodeMaid, also corrected/added missing licenses.
2017-09-01 11:20:14 -04:00
J Wyman 00a8fb97bc Silence style-cop wrt `this.` usage. 2017-08-01 13:35:10 -04:00
J Wyman aa0d71bea6 Silence style-cop wrt `String` vs `string`. 2017-08-01 13:34:39 -04:00
J Wyman d8b7f09d64 Fix / suppress code analysis violations. 2017-06-23 17:27:49 -04:00
J Wyman 2fc45eaf52 Update dependencies (nupkg).
Castle.Core (aka Moq) -> 4.1.0
Microsoft.Identity.Client.ActiveDirectory -> 3.13.9
Microsoft.Net.Compilers -> 2.2.0
Xunit -> 2.2.0
2017-06-22 23:29:26 -04:00
J Wyman 239cf3062f Added Xunit framework to all Microsoft.*.Test projects. 2017-06-22 14:06:58 -04:00