WIP /search

This commit is contained in:
2024-03-24 16:53:12 +00:00
parent e229439174
commit aeecc524a4
34 changed files with 1188 additions and 391 deletions

View File

@ -2,3 +2,9 @@ https://api.nuget.org/v3/registration5-gz-semver2/yavsc.abstract/index.json
https://api.nuget.org/v3/catalog0/data/2019.09.17.10.18.17/yavsc.abstract.1.0.6-rc07.json
http://localhost:5000/v3/index
http://localhost:5000/v3/registration/isn.abst/index.json
https://isn.pschneider.fr/v3/registration5-gz-semver2/isn.abst/index.json
https://isn.pschneider.fr/v3/content/isn.abst/index.json
http://localhost:5000/v3/registration5-gz-semver2/isn.abst/index.json
http://localhost:5000/v3/registration/isn.abst/index.json
http://localhost:5000/v3/content/isn.abst/index.json

View File

@ -1,12 +1,12 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using isn.Abstract;
using System.Linq;
using Xunit;
using isn.abst;
using System.Security.Cryptography;
namespace isn.tests
{
@ -42,6 +42,18 @@ namespace isn.tests
var pub = model.Resources.FirstOrDefault((r) => r.Type.StartsWith("PackagePublish/"));
Assert.True(pub != null);
}
[Fact]
public void TestSetApiKey()
{
string source = "http://localhost:3002/v3/index.json";
var setting = Settings.Create();
setting.Sources[source] = new SourceSettings{ Url=source };
string testingKey = "CfDJ8LF3SbIJ4FJAgs7uIQKhdCAYCNVXRwU6TEoaXOo1_ZpG2u8TCGFP2z13hw9xR0LC0gdbr1QGwNndiXUl4DI74nxyBi-T1oC33PWtE-5vgiJWeCH223PYtoSEdzDiWovwJZWJbQON0WqoG8vSfbrBXTmicD6oxF4ghwXXexY0RiRR";
var rsa = RSA.Create(setting.RSAParameters);
setting.Sources[source].SetApiKey(rsa,testingKey);
Assert.Equal(testingKey, setting.Sources[source].GetClearApiKey(rsa));
}
}
}

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>NETSDK1138</NoWarn>
<AssemblyVersion>1.0.7.0</AssemblyVersion>
@ -9,12 +9,13 @@
<Version>1.0.7</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.runner.reporters" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
<PackageToolReference Include="xunit.runner.console" Version="2.4.2" PrivateAssets="All" />
<PackageReference Include="xunit.runner.reporters" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageToolReference Include="xunit.runner.console" Version="2.5.7" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\isn\isn.csproj" />

View File

@ -151,10 +151,9 @@ namespace isnd.host.tests
{
ILogger logger = new TestLogger();
CancellationToken cancellationToken = CancellationToken.None;
SourceRepository repository = Repository.Factory.GetCoreV3(SPIIndexURI);
repository.PackageSource.AllowInsecureConnections=true;
PackageSearchResource resource = await repository.GetResourceAsync<PackageSearchResource>();
SearchFilter searchFilter = new SearchFilter(includePrerelease: true);
@ -184,6 +183,15 @@ namespace isnd.host.tests
await pushRes.Push(new List<string>{ "../../../../../src/isnd/bin/Release/isnd.1.1.4.nupkg" }, null,
5000, false, GetApiKey, GetSymbolsApiKey, false, false, symbolPackageResource, logger);
}
[Fact]
public void TestDepedency()
{
PackageDependencyGroup g = new PackageDependencyGroup
{
TargetFramework="net7.0"
};
}
private string GetSymbolsApiKey(string apiUrl)
{

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<UserSecretsId>d7144e46-4e63-4391-ba86-64b61f6e7be4</UserSecretsId>
<NoWarn>NETSDK1138</NoWarn>
@ -12,10 +12,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="XunitXml.TestLogger" Version="3.1.20" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.runner.reporters" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageReference Include="xunit.runner.reporters" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageToolReference Include="xunit.runner.console" Version="2.4.2" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>