Граф коммитов

409 Коммитов

Автор SHA1 Сообщение Дата
embetten 37f5d0859b
CVE-2024-43485 (#532)
- patching CVE-2024-43485
2024-11-19 12:54:34 -08:00
John Schmeichel a17d9a53f9
Add trigger to pipeline (#534) 2024-11-15 13:14:31 -08:00
Coby Allred b66855cc5c
Don't attempt to install .NET 8 without explicit variable (#528)
With v1.3.0 not being fully released yet, attempting download of Net8
bits may fail if not explicitly setting v1.3.0-alpha in
`installcredprovider.sh`. Update the variable check to avoid "default"
downloads of .NET 8.
2024-10-16 08:29:22 -07:00
Coby Allred 5115052c1f
Fix typo in installcredprovider.sh (#526)
Missed this commit in #524, adding it back now.
2024-10-10 13:37:23 -07:00
Coby Allred 2a2891c55c
.NET 8 installcredprovider scripts (#524)
Add support for the new .NET 8 and .NET Framework 4.8.1 versions in the
`installcredprovider` command line scripts.

Invoke using the `$InstallNet8` or `$AddNetfx48` switch parameters for
the `installcredprovider.ps1` script, or
`USE_NET8_ARTIFACTS_CREDENTIAL_PROVIDER` for `installcredprovider.sh`
2024-10-10 13:13:36 -07:00
Coby Allred 3e4f3cac77
Add .NET 8, FX 4.8.1 support (#520)
With the end of support for multiple .NET releases used by the artifacts
credential provider, it's time to migrate to supported .NET versions.
This includes a bump of .NET 6 -> .NET 8 and .NET Framework 4.6.1 to
.NET Framework 4.8.1.

For more info on end of support dates, see
https://github.com/dotnet/core/blob/main/releases.md

These new bits will not be set as the default version being installed
until the next major release as documented in the README. I'll also post
an announcement about the upcoming deprecation.

---------

Co-authored-by: Coby Allred <coallred@microsoft.com>
2024-10-08 08:38:36 -07:00
embetten 5016b3d9f3
revert vscode push and create 1.2.3 release (#519)
- revert unintentional vscode push
- create 1.2.3 release
2024-09-19 15:21:38 -07:00
embetten 0ba6c4e5f8
Add Program Context to UserAgent Header (#517)
Add Program context comment to user agent header to enable tracking of
usage across our credprovider wrappers (ex conda, artifacts-keyring)


example header with changes:
`(NuGet) CredentialProvider.Microsoft/1.2.1 (Windows; X64; Microsoft
Windows 10.0.22631) CLR/6.0.33 (.NETCoreApp,Version=v6.0; win10-x64;
.NET 6.0.33)`

before:
`CredentialProvider.Microsoft/1.2.1 (Windows; X64; Microsoft Windows
10.0.22631) CLR/6.0.33 (.NETCoreApp,Version=v6.0; win10-x64; .NET
6.0.33)`
2024-09-19 14:26:46 -07:00
embetten d6adc535de
Adding pem certificate support for dotnet 6 or higher (#518)
Adding support for .pem certificates to address [artifacts-keyring
issue](https://github.com/microsoft/artifacts-keyring/issues/60). Note
this is only targeting .net 6 or greater versions of the cred provider,
since the `CreateFromPemFile` is only available in .net 5 or greater.
Otherwise, we have to implement reading the pem ourselves.

Additional Considerations:
- Add certificate passwords for pfx files.
2024-09-19 14:26:39 -07:00
John Schmeichel c195c87a24
Create 1.2.2 release (#515) 2024-09-10 12:05:04 -07:00
Roberto Bortolussi f9565e058c
Update Microsoft.Identity.Client(.*) (#513) 2024-09-05 16:03:40 -07:00
embetten c1c72e66a4
Update readme with mi/sp configuration information (#507)
- Update description on how to use MI/SP environment variable
2024-08-14 09:51:45 -07:00
John Schmeichel 7fbb02b0c2
Pin System.Formats.Asn1 version to 6.0.1 (#506)
Fixes #505 by pinning System.Formats.Asn1 version to 6.0.1
2024-08-13 11:32:49 -07:00
John Schmeichel b2a274f693
Don't rebuild during pack (#504)
The build occurs in many phases and was relying on incremental builds
not re-building outputs, which is not deterministic. Properties were not
consistently passed at each step which results in outputs being flagged
as out-of-date, causing rebuilds and loosing signing. These properties
are now consistently passed, and --no-build used to ensure signed files
are not overridden.
2024-08-01 10:41:17 -07:00
Roberto Bortolussi 9ea706ebcc
Add parameterless constructor for Microsoft.Artifacts.Authentication.TokenRequest (#502)
The `Uri` property in TokenRequest is unused. Remove it to make it less
confusing.
2024-07-24 10:51:26 -07:00
Roberto Bortolussi 696b78e409
Add handling of integrated_windows_auth_not_supported_managed_user (#503)
Integrated Windows Auth is not supported for managed users. This needs
to be handled to prevent issues when a Windows user is not a federated
user.
2024-07-24 10:49:38 -07:00
embetten 62788bf32c
Create 1.2.0 Release (#498)
- Create 1.2.0 release for mI/SP support
2024-06-11 15:21:12 -07:00
embetten ae7cd592c5
Managed Identity and Service Principal Support (#492)
# Overview
- Added MSAL Managed Identity and Service Principal Token Providers to
Microsoft.Artifacts.Authentication Library.
- Created new endpoint `ARTIFACTS_CREDENTIALPROVIDER_FEED_ENDPOINTS`
environment variable with new json schema for MI/SP required fields.
- Updated VstsBuildTaskServiceEndpointCredentialProvider to call
Microsoft.Artifacts.Authentication for MI/SP token providers.
- Reverted #485 Changes to use system.text.json for de/serialization
everywhere except for the `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS`
environment variable.

## Design Decisions
- Intentionally not supporting SP secrets authentication to promote
security best practices.
- The new environment variable name and json schema were created instead
of reusing or extending the existing `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS`
to reduce password usage and clarify the environment variable will be
available to our other credproviders such as the
[artifacs-keyring](https://github.com/microsoft/artifacts-keyring) not
just NuGet.

## Environment Variable
 `ARTIFACTS_CREDENTIALPROVIDER_FEED_ENDPOINTS` 
```javascript
 {"endpointCredentials": [{"endpoint":"http://example.index.json", "clientId":"required", "clientCertificateSubjectName":"optional", "clientCertificateFilePath":"optional"}]}
```
- `endpoint`: required. Feed url to authenticate against. 
- `clientId`: required for both MI/SP. For user assigned managed
identities enter the Entra client id. For system assigned variables set
the value to `system`.
- `clientCertificateSubjectName`: Subject Name of the certificate
located in the My/ CurrentUser or LocalMachine certificate store.
Optional field. Only used by SP authentication.
- `clientCertificateFilePath`: File path location of the certificate on
the machine. Optional field. Only used by SP authentication.

Will throw error if both `clientCertificateSubjectName` or
`clientCertificateFilePath` are specified.
2024-06-10 11:45:29 -07:00
embetten 74fe273afe
Fix README Requirements (#493)
Update requirements setting to fix: #491
2024-05-02 13:02:23 -07:00
embetten 8464eedc68
Users/embetten/move publish steps (#489) 2024-03-08 12:49:01 -08:00
embetten 47039fbd4b
Removing Publishing Steps from public build (#488)
- Remove publishing symbols and nupkg package from public build to
internal release pipeline
2024-03-08 08:49:48 -08:00
embetten a7cbabff58
Create 1.1.1 release (#486) 2024-03-06 13:18:01 -08:00
embetten c045372127
Revert System.Text.Json change (#485)
- Reverting system.text.json #393 PR due to #484.
- Adding warning message for single quotes in endpoint message.
- Did not change swix/swr dependencies.

---------

Co-authored-by: Jonathan Myers <11822817+jmyersmsft@users.noreply.github.com>
2024-03-06 13:03:56 -08:00
amp-powell 057378f004
Changing away from MicroBuildUploadVstsDropFolder@2 (#469)
Using output method with microBuildVstsDrop instead of
MicroBuildUploadVstsDropFolder@2 task for compatibility

---------

Co-authored-by: Abby Powell (from Dev Box) <abpowell@microsoft.com>
2024-02-27 12:52:40 -05:00
John Schmeichel d61dbf04ae
Fix vsix package to include dependencies (#480) 2024-02-23 10:59:34 -08:00
embetten 6f12874aab
Correct NuGet.Protocol upgrade version (#478) 2024-02-22 13:53:28 -08:00
embetten b4d0b985a8
Revert "Update NuGet.Protocol and System.Text.Json Package Version" (#479)
Reverts microsoft/artifacts-credprovider#477
2024-02-22 08:59:59 -08:00
embetten d234c2dd8a
Update NuGet.Protocol and System.Text.Json Package Version (#477)
- update package dependencies due to CVE vulnerabilities
2024-02-21 13:51:29 -08:00
embetten 4e58b4c5b6
Update dockerfile.sample.txt image (#474)
- update docker sample image to use mcr registry
2024-02-08 14:32:04 -08:00
embetten 0c184451bb
Correct README dotnet runtime and sdk requirements (#471)
Correct README dotnet requirement prerequisite.
2024-02-08 11:51:09 -08:00
embetten 3bdd2579cb
Enable cross platform session token cache global locking (#470)
Bug fix #416 
- Move session token cache file lock to single wait handle.
- Add new session cache specific cancel message so the cancel message is
not printed twice.
- Pass cancellation token to credential request handler.
2024-02-07 14:54:25 -08:00
embetten 9b4778a32b
Update SessionTokenCache File Permissions (#467)
- Update SessionTokenCache file permissions for MacOs/Linux machines to
match MSAL/NuGet.
- Log error on cache file writes and return token instead of throwing
exception.
2024-01-31 11:48:21 -08:00
embetten 447da8a6c7
Fix Null Reference Exception (#468)
- Added a null check when accessing the token result which can be null
if there is an underlying MSAL or tokenprovider error.
- related to issue #455
2024-01-31 11:35:02 -08:00
amp-powell d6aba72dd3
Changed install script to make it compatible for sh on linux (#457)
Co-authored-by: Abby Powell (from Dev Box) <abpowell@microsoft.com>
2023-10-26 15:56:33 -04:00
John Schmeichel dc5f4a2da9
Create 1.1.0 release (#445)
Bumping the minor version as support for ADAL has been dropped.
2023-08-04 16:14:27 -07:00
John Schmeichel 47d2f4eade
Use latest version of NuGet.Protocol (#444) 2023-08-04 16:14:15 -07:00
John Schmeichel 5438e61e2a
Standardize versions in project files (#440)
Adds a target to output the computed version for each project, and
attempts to standardize how versions are composed. Specifically the
project system supports automatically computing
Version/PackageVersion/etc. with the right values if VersionPrefix and
VersionSuffix are specified (different outputs have separate
requirements for what formats are supported).
2023-07-25 14:04:56 -07:00
John Schmeichel 364639b41a
Put SBOM task behind publish flag (#439) 2023-07-21 15:16:15 -07:00
John Schmeichel ce5571bbed
Add publish parameter to build template (#438)
Add option to disable publishing artifacts
2023-07-19 08:46:10 -07:00
John Schmeichel b8b8facc72
Create 1.0.9 release (#435) 2023-07-12 15:16:26 -07:00
John Schmeichel cb98f0c844
MSAL cache env var should be interpreted as full file path (#434)
MSAL cache changes to align with GCM removed ability to customize the
full file path for the MSAL cache. Addresses #432
2023-07-12 10:51:19 -07:00
John Schmeichel ebafa53184
Onboard to central package management (#431)
Onboarding to Central Package Management:
https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management
2023-06-28 13:25:35 -07:00
John Schmeichel bab9e30c4b
Add explicit version for Newtonsoft.Json (#430)
NuGet brings in very old versions of Newtonsoft.Json. Need to look at
upgrading NuGet dependencies, but in the meantime, bring back the
explicit version.
2023-06-28 09:44:48 -07:00
John Schmeichel 4381c166f2
Bump NuGet.Protocol package version to 5.11.5 (#429)
Bumping NuGet.Protocol version and removing explicit dependency where
not required as dependabot doesn't update all projects at once.
2023-06-28 09:07:09 -07:00
John Schmeichel f7af268965
Use System.Text.Json for json (de)serialization (#393)
The serialization and deserialization cost for Newtonsoft.Json causes
significant slowdowns, especially in the cases of cached tokens where
the process is not long lived. Swapping in System.Text.Json improves
startup times.

BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.23430.1000)
Intel Xeon CPU E5-1650 v3 3.50GHz, 1 CPU, 12 logical and 6 physical
cores
 .NET SDK=8.0.100-preview.2.23157.25
   [Host]     : .NET 6.0.16 (6.0.1623.17311), X64 RyuJIT AVX2
   Job-KGDGIP : .NET 6.0.16 (6.0.1623.17311), X64 RyuJIT AVX2

System.Text.Json:

 IterationCount=1  RunStrategy=ColdStart  WarmupCount=0

 |             Method |       Mean | Error |  Allocated |
 |------------------- |-----------:|------:|-----------:|
 | CachedSessionToken |   460.5 ms |    NA |   519.3 KB |
 |    CachedMsalToken | 1,737.0 ms |    NA | 1979.85 KB |
 
  IterationCount=3  RunStrategy=ColdStart  WarmupCount=0

| Method | Mean | Error | StdDev | Median | Allocated |
|-------------------
|---------:|------------:|---------:|---------:|-----------:|
| CachedSessionToken | 254.9 ms | 2,957.7 ms | 162.1 ms | 163.6 ms |
481.46 KB |
| CachedMsalToken | 967.8 ms | 12,418.7 ms | 680.7 ms | 586.7 ms |
1889.65 KB |

Newtonsoft.Json:

 IterationCount=1  RunStrategy=ColdStart  WarmupCount=0

 |             Method |       Mean | Error | Allocated |
 |------------------- |-----------:|------:|----------:|
 | CachedSessionToken |   586.9 ms |    NA | 559.24 KB |
 |    CachedMsalToken | 2,074.3 ms |    NA |   2142 KB |
 
  IterationCount=3  RunStrategy=ColdStart  WarmupCount=0

| Method | Mean | Error | StdDev | Median | Allocated |
|-------------------
|-----------:|------------:|-----------:|---------:|-----------:|
| CachedSessionToken | 343.7 ms | 5,947.7 ms | 326.0 ms | 162.1 ms |
519.8 KB |
| CachedMsalToken | 1,277.7 ms | 20,494.6 ms | 1,123.4 ms | 660.3 ms |
2064.86 KB |
2023-06-27 16:50:48 -07:00
John Schmeichel 5177919a8c
Remove Azure Active Directory Authentication Library (ADAL) (#411)
This removes Azure Active Directory Authentication Library (ADAL)
support from the credential provider and all associated environment
variables.
2023-06-27 14:06:54 -07:00
John Schmeichel 2eaec110be
Update readme to link to .NET Core 3.1 removal (#428)
Ask from partner teams to include on the readme a link to the
deprecation announcement.
2023-06-27 12:56:22 -07:00
John Schmeichel 64ba044427
Include symbols for Microsoft.Artifacts.Authentication when publishing (#424) 2023-06-15 20:42:57 -07:00
John Schmeichel 184761b680
Upload VS manifest to correct organization (#423) 2023-06-15 13:20:54 -07:00
John Schmeichel 54e5949f33 Create 1.0.8 release 2023-06-06 08:59:25 -07:00