This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
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 #376 from NuGet/dev
[ReleasePrep][2018.10.22]FI of master into dev
- Loading branch information
Showing
29 changed files
with
595 additions
and
45 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
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
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
34 changes: 34 additions & 0 deletions
34
...uGet.Services.Metadata.Catalog.Monitoring/Providers/PackageBaseAddressResourceProvider.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,34 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using NuGet.Protocol.Core.Types; | ||
|
||
namespace NuGet.Services.Metadata.Catalog.Monitoring | ||
{ | ||
/// <summary> | ||
/// The resource provider that creates instances of <see cref="PackageBaseAddressResource"/>. | ||
/// </summary> | ||
public class PackageBaseAddressResourceProvider : ResourceProvider | ||
{ | ||
private readonly string _packageBaseAddress; | ||
|
||
public PackageBaseAddressResourceProvider(string packageBaseAddress) : | ||
base(typeof(PackageBaseAddressResource)) | ||
{ | ||
if (string.IsNullOrEmpty(packageBaseAddress)) | ||
{ | ||
throw new ArgumentException("Package base address is required", nameof(packageBaseAddress)); | ||
} | ||
|
||
_packageBaseAddress = packageBaseAddress; | ||
} | ||
|
||
public override Task<Tuple<bool, INuGetResource>> TryCreate(SourceRepository source, CancellationToken token) | ||
{ | ||
return Task.FromResult(new Tuple<bool, INuGetResource>(true, new PackageBaseAddressResource(_packageBaseAddress))); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageBaseAddressResource.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,30 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using NuGet.Protocol.Core.Types; | ||
|
||
namespace NuGet.Services.Metadata.Catalog.Monitoring | ||
{ | ||
/// <summary> | ||
/// Gets the base URL for the Package Content resource. For more information, | ||
/// see: https://docs.microsoft.com/en-us/nuget/api/package-base-address-resource | ||
/// </summary> | ||
public class PackageBaseAddressResource : INuGetResource | ||
{ | ||
public PackageBaseAddressResource(string packageBaseAddress) | ||
{ | ||
if (string.IsNullOrEmpty(packageBaseAddress)) | ||
{ | ||
throw new ArgumentException("Package base address is required", nameof(packageBaseAddress)); | ||
} | ||
|
||
PackageBaseAddress = packageBaseAddress.TrimEnd('/'); | ||
} | ||
|
||
/// <summary> | ||
/// The base URL for the Package Content resource. | ||
/// </summary> | ||
public string PackageBaseAddress { get; } | ||
} | ||
} |
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
Oops, something went wrong.