diff --git a/.vscode/settings.json b/.vscode/settings.json index b16f17c..12b34b3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { - "omnisharp.msbuild": false, - "dotnet-test-explorer.testProjectPath": "**/*.sln", + "omnisharp.msbuild": true, + "dotnet-test-explorer.testProjectPath": "**/*Tests.csproj", "dotnet-test-explorer.runInParallel": false, "dotnet-test-explorer.showCodeLens": true, "dotnet-test-explorer.testArguments": "", @@ -46,5 +46,7 @@ "database": "isnd", "username": "paul" } - ] + ], + "omnisharp.disableMSBuildDiagnosticWarning": true, + "omnisharp.enableRoslynAnalyzers": false } diff --git a/README.md b/README.md index cd19d2a..a0d7201 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,50 @@ sudo chown -R root.root /usr/local/lib/isn ```` ## TODO + +```json +{ + + "@id": "https://api.nuget.org/v3/registration5-semver1/", + "@type": "RegistrationsBaseUrl", + "comment": "Base URL of Azure storage where NuGet package registration info is stored" + +}, +{ + + "@id": "https://api.nuget.org/v3-flatcontainer/", + "@type": "PackageBaseAddress/3.0.0", + "comment": "Base URL of where NuGet packages are stored, in the format https://api.nuget.org/v3-flatcontainer/{id-lower}/{version-lower}/{id-lower}.{version-lower}.nupkg" + +}, +{ + + "@id": "https://api.nuget.org/v3/registration5-semver1/", + "@type": "RegistrationsBaseUrl/3.0.0-rc", + "comment": "Base URL of Azure storage where NuGet package registration info is stored used by RC clients. This base URL does not include SemVer 2.0.0 packages." + +}, +{ + + "@id": "https://api.nuget.org/v3/registration5-semver1/", + "@type": "RegistrationsBaseUrl/3.0.0-beta", + "comment": "Base URL of Azure storage where NuGet package registration info is stored used by Beta clients. This base URL does not include SemVer 2.0.0 packages." + +}, +{ + + "@id": "https://www.nuget.org/packages/{id}/{version}?_src=template", + "@type": "PackageDetailsUriTemplate/5.1.0", + "comment": "URI template used by NuGet Client to construct details URL for packages" + +}, +{ + + "@id": "https://api.nuget.org/v3/registration5-gz-semver2/", + "@type": "RegistrationsBaseUrl/3.6.0", + "comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." + +}, + +```` + diff --git a/src/isnd/Entities/ApiConfig.cs b/src/isn.abst/ApiConfig.cs similarity index 100% rename from src/isnd/Entities/ApiConfig.cs rename to src/isn.abst/ApiConfig.cs diff --git a/src/isnd/Controllers/HomeController.cs b/src/isnd/Controllers/HomeController.cs index 3b7bca5..c5bbf1c 100644 --- a/src/isnd/Controllers/HomeController.cs +++ b/src/isnd/Controllers/HomeController.cs @@ -25,10 +25,8 @@ namespace isnd.Controllers public IActionResult Index() { - return View(new HomeIndexViewModel{ PkgCount = _dbContext.Packages - .Include(p => p.Versions) .Where(p => p.Versions.Count > 0) .Count(), UnleashClient = _unleashĈlient diff --git a/src/isnd/Controllers/Packages/Catalog.cs b/src/isnd/Controllers/Packages/Catalog.cs index 2fb1388..dfa303e 100644 --- a/src/isnd/Controllers/Packages/Catalog.cs +++ b/src/isnd/Controllers/Packages/Catalog.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Threading.Tasks; -using isnd.Data.Catalog; using isnd.Helpers; using isnd.Services; using isnd.Entities; @@ -20,7 +19,7 @@ namespace isnd.Controllers { return Ok(PackageManager.CurrentCatalogIndex); } - + [HttpGet(_pkgRootPrefix + ApiConfig.CatalogPage + "-{id}")] public IActionResult Index(string id) { @@ -28,21 +27,20 @@ namespace isnd.Controllers return Ok(PackageManager.CurrentCatalogPages[int.Parse(id)]); } - [HttpGet(_pkgRootPrefix + ApiConfig.Registration + "/{id}/{*lower}")] - public async Task CatalogRegistrationAsync(string id, string lower) + [HttpGet(_pkgRootPrefix + "{apiVersion}/" + ApiConfig.Registration + "/{id}/{*lower}")] + public async Task CatalogRegistrationAsync(string apiVersion, string id, string lower) { + bool askForindex = lower != null && lower.EndsWith(ApiConfig.Base); + if (askForindex) + { + lower = lower.Substring(0, lower.Length - ApiConfig.Base.Length); + } string pkgType = ParamHelpers.Optional(ref lower); - var pkgVersion = await dbContext.PackageVersions - .Include(v => v.LatestCommit) - .SingleOrDefaultAsync( - v => v.PackageId == id && - v.FullString == lower && - v.Type == pkgType - ); - if (pkgVersion == null) return NotFound(); - return Ok(); - } - + var pkgFromname = packageManager.SearchByName(id, 0, 1); + if (pkgFromname == null) return NotFound(); + return Ok(pkgFromname); + } + [HttpGet(_pkgRootPrefix + ApiConfig.CatalogLeaf + "/{id}/{version}/{*lower}")] public async Task CatalogLeafAsync(string id, string version, string lower) @@ -50,25 +48,27 @@ namespace isnd.Controllers var pkgvs = this.packageManager.GetCatalogLeaf(id, version, lower) .ToArray(); - if (pkgvs.Count()==0) return NotFound(); + if (pkgvs.Count() == 0) return NotFound(); - List types = pkgvs.Select( + List types = pkgvs.Select( v => v.Type ?? "Dependency" ).Distinct().ToList(); if (!types.Contains("PackageDelete")) - types.Add("PackageDetails"); - var pub = pkgvs.Last().Package.CommitTimeStamp; + types.Add("PackageDetails"); + + var last = pkgvs.Last(); + var pub = last.Package.CommitTimeStamp; var firstpub = pkgvs.First().Package.CommitTimeStamp; - return Ok(new CatalogLeaf + return Ok(new Data.Packages.Catalog.CatalogLeaf { - CommitId = id, + CommitId = last.CommitId, Id = id, - CommitTimeStamp = firstpub, - Version = version, + CommitTimeStamp = pub, + Version = last.FullString, Published = pub, RefType = types.ToArray(), - + }); } diff --git a/src/isnd/Controllers/Packages/Files.cs b/src/isnd/Controllers/Packages/Files.cs index 668fa85..3de8c81 100644 --- a/src/isnd/Controllers/Packages/Files.cs +++ b/src/isnd/Controllers/Packages/Files.cs @@ -32,7 +32,7 @@ namespace isnd.Controllers } // Web get spec - [HttpGet(_pkgRootPrefix + ApiConfig.GetNuspec + "/{id}/{lower}/{idf}-{lowerf}." + [HttpGet(_pkgRootPrefix + Constants.SpecFileEstension + "/{id}/{lower}/{idf}-{lowerf}." + Constants.SpecFileEstension)] public IActionResult GetNuspec( [FromRoute][SafeName][Required] string id, diff --git a/src/isnd/Controllers/Packages/GetVersions.cs b/src/isnd/Controllers/Packages/GetVersions.cs index 8f93e15..8fcd84e 100644 --- a/src/isnd/Controllers/Packages/GetVersions.cs +++ b/src/isnd/Controllers/Packages/GetVersions.cs @@ -6,7 +6,7 @@ namespace isnd.Controllers { public partial class PackagesController { - [HttpGet(_pkgRootPrefix + ApiConfig.GetVersion + "/{id}/{lower}/index.json")] + [HttpGet(_pkgRootPrefix + ApiConfig.GetVersion + "/{id}/{lower}/" + ApiConfig.Base)] public IActionResult GetVersions( string id, string lower, diff --git a/src/isnd/Controllers/Packages/Put.cs b/src/isnd/Controllers/Packages/Put.cs index 461d34f..103f82a 100644 --- a/src/isnd/Controllers/Packages/Put.cs +++ b/src/isnd/Controllers/Packages/Put.cs @@ -15,8 +15,8 @@ using isnd.Data; using isnd.Helpers; using isnd.Entities; using Microsoft.AspNetCore.Http; -using isnd.Data.Catalog; using isn.abst; +using isnd.Data.Packages; namespace isnd.Controllers { diff --git a/src/isnd/Data/ApplicationDbContext.cs b/src/isnd/Data/ApplicationDbContext.cs index 1a3756d..5fa9ea0 100644 --- a/src/isnd/Data/ApplicationDbContext.cs +++ b/src/isnd/Data/ApplicationDbContext.cs @@ -6,8 +6,7 @@ using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using isnd.Data; using isnd.Data.ApiKeys; -using isnd.Data.Catalog; -using isnd.Data.Historic; +using isnd.Data.Packages; namespace isnd.Data { diff --git a/src/isnd/Data/Catalog/PageRef.cs b/src/isnd/Data/Catalog/PageRef.cs index db5032d..3bb77da 100644 --- a/src/isnd/Data/Catalog/PageRef.cs +++ b/src/isnd/Data/Catalog/PageRef.cs @@ -1,7 +1,8 @@ using System; +using isnd.Interfaces; using Newtonsoft.Json; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { public class PageRef : IObject { diff --git a/src/isnd/Data/Historic/PackageVersionCommit.cs b/src/isnd/Data/Historic/PackageVersionCommit.cs index 0ebb55b..5857a6e 100644 --- a/src/isnd/Data/Historic/PackageVersionCommit.cs +++ b/src/isnd/Data/Historic/PackageVersionCommit.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using isnd.Data.Catalog; +using isnd.Data.Packages; +using isnd.Data.Packages.Catalog; namespace isnd.Data.Historic { diff --git a/src/isnd/Data/Catalog/CatalogIndex.cs b/src/isnd/Data/Packages/Catalog/CatalogIndex.cs similarity index 88% rename from src/isnd/Data/Catalog/CatalogIndex.cs rename to src/isnd/Data/Packages/Catalog/CatalogIndex.cs index 1890351..4043ee5 100644 --- a/src/isnd/Data/Catalog/CatalogIndex.cs +++ b/src/isnd/Data/Packages/Catalog/CatalogIndex.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using Newtonsoft.Json; +using isnd.Interfaces; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { public class CatalogIndex : IObject { diff --git a/src/isnd/Data/Catalog/CatalogLeaf.cs b/src/isnd/Data/Packages/Catalog/CatalogLeaf.cs similarity index 91% rename from src/isnd/Data/Catalog/CatalogLeaf.cs rename to src/isnd/Data/Packages/Catalog/CatalogLeaf.cs index 8719ecc..3bfc68c 100644 --- a/src/isnd/Data/Catalog/CatalogLeaf.cs +++ b/src/isnd/Data/Packages/Catalog/CatalogLeaf.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; +using isnd.Interfaces; using Newtonsoft.Json; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { public class CatalogLeaf : IObject { diff --git a/src/isnd/Data/Catalog/IObject.cs b/src/isnd/Data/Packages/Catalog/IObject.cs similarity index 88% rename from src/isnd/Data/Catalog/IObject.cs rename to src/isnd/Data/Packages/Catalog/IObject.cs index 0ec1c22..5b74ac2 100644 --- a/src/isnd/Data/Catalog/IObject.cs +++ b/src/isnd/Data/Packages/Catalog/IObject.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace isnd.Data.Catalog +namespace isnd.Interfaces { public interface IObject { diff --git a/src/isnd/Data/Catalog/PackageDetail.cs b/src/isnd/Data/Packages/Catalog/PackageDetail.cs similarity index 64% rename from src/isnd/Data/Catalog/PackageDetail.cs rename to src/isnd/Data/Packages/Catalog/PackageDetail.cs index 0ccadee..215bc45 100644 --- a/src/isnd/Data/Catalog/PackageDetail.cs +++ b/src/isnd/Data/Packages/Catalog/PackageDetail.cs @@ -1,4 +1,4 @@ -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { public class PackageDetail : CatalogLeaf { diff --git a/src/isnd/Data/Catalog/PackageRef.cs b/src/isnd/Data/Packages/Catalog/PackageRef.cs similarity index 95% rename from src/isnd/Data/Catalog/PackageRef.cs rename to src/isnd/Data/Packages/Catalog/PackageRef.cs index 6895222..4fb93ed 100644 --- a/src/isnd/Data/Catalog/PackageRef.cs +++ b/src/isnd/Data/Packages/Catalog/PackageRef.cs @@ -1,8 +1,9 @@ using System; using System.ComponentModel.DataAnnotations.Schema; +using isnd.Interfaces; using Newtonsoft.Json; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { /// /// An presence of package in a catalog, diff --git a/src/isnd/Data/Catalog/Page.cs b/src/isnd/Data/Packages/Catalog/Page.cs similarity index 88% rename from src/isnd/Data/Catalog/Page.cs rename to src/isnd/Data/Packages/Catalog/Page.cs index c1781c8..f5e00e7 100644 --- a/src/isnd/Data/Catalog/Page.cs +++ b/src/isnd/Data/Packages/Catalog/Page.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; +using isnd.Interfaces; using Newtonsoft.Json; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages.Catalog { public class Page : IObject { diff --git a/src/isnd/Data/Catalog/Commit.cs b/src/isnd/Data/Packages/Commit.cs similarity index 94% rename from src/isnd/Data/Catalog/Commit.cs rename to src/isnd/Data/Packages/Commit.cs index 1f87670..e024d11 100644 --- a/src/isnd/Data/Catalog/Commit.cs +++ b/src/isnd/Data/Packages/Commit.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; +using isnd.Interfaces; -namespace isnd.Data.Catalog +namespace isnd.Data.Packages { public enum PackageAction { diff --git a/src/isnd/Data/Package.cs b/src/isnd/Data/Packages/Package.cs similarity index 92% rename from src/isnd/Data/Package.cs rename to src/isnd/Data/Packages/Package.cs index eb792d3..36e8bd9 100644 --- a/src/isnd/Data/Package.cs +++ b/src/isnd/Data/Packages/Package.cs @@ -2,16 +2,16 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using isnd.Data.Catalog; +using isnd.Interfaces; using Newtonsoft.Json; -namespace isnd.Data +namespace isnd.Data.Packages { public class Package : IObject { [Key][Required] [StringLength(1024)] - public string Id { get; set; } + public string Id { get; set; } [Required] [ForeignKey("Owner")] diff --git a/src/isnd/Data/PackageVersion.cs b/src/isnd/Data/Packages/PackageVersion.cs similarity index 95% rename from src/isnd/Data/PackageVersion.cs rename to src/isnd/Data/Packages/PackageVersion.cs index 21f8bb1..a774123 100644 --- a/src/isnd/Data/PackageVersion.cs +++ b/src/isnd/Data/Packages/PackageVersion.cs @@ -1,7 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using isn.abst; -using isnd.Data.Catalog; +using isnd.Data.Packages; +using isnd.Data.Packages.Catalog; using Newtonsoft.Json; namespace isnd.Data diff --git a/src/isnd/Controllers/Packages/CatalogRegistration.cs b/src/isnd/Entities/CatalogRegistration.cs similarity index 100% rename from src/isnd/Controllers/Packages/CatalogRegistration.cs rename to src/isnd/Entities/CatalogRegistration.cs diff --git a/src/isnd/Data/NewReleaseInfo.cs b/src/isnd/Entities/NewReleaseInfo.cs similarity index 100% rename from src/isnd/Data/NewReleaseInfo.cs rename to src/isnd/Entities/NewReleaseInfo.cs diff --git a/src/isnd/Interfaces/IPackageManager.cs b/src/isnd/Interfaces/IPackageManager.cs index 453a276..a036d45 100644 --- a/src/isnd/Interfaces/IPackageManager.cs +++ b/src/isnd/Interfaces/IPackageManager.cs @@ -3,7 +3,8 @@ using System.Threading.Tasks; using isn.Abstract; using isnd.Controllers; using isnd.Data; -using isnd.Data.Catalog; +using isnd.Data.Packages; +using isnd.Data.Packages.Catalog; using isnd.Services; using isnd.ViewModels; using NuGet.Versioning; diff --git a/src/isnd/Services/PackageManager.cs b/src/isnd/Services/PackageManager.cs index d9484e4..d0cd9e4 100644 --- a/src/isnd/Services/PackageManager.cs +++ b/src/isnd/Services/PackageManager.cs @@ -6,7 +6,8 @@ using System.Threading.Tasks; using isn.Abstract; using isnd.Controllers; using isnd.Data; -using isnd.Data.Catalog; +using isnd.Data.Packages; +using isnd.Data.Packages.Catalog; using isnd.Entities; using isnd.Helpers; using isnd.Interfaces; @@ -23,7 +24,7 @@ namespace isnd.Services public const string BASE_API_LEVEL = "3.5.0"; ApplicationDbContext dbContext; - + public PackageManager(ApplicationDbContext dbContext, IOptions siteConfigOptionsOptions) { @@ -48,15 +49,15 @@ namespace isnd.Services Comment = "Package Publish service" }); // under dev, only leash in release mode - if (unleashClient.IsEnabled("pkg-get", false)) + if (unleashClient.IsEnabled("pkg-get", true)) res.Add( new Resource { Id = extUrl + ApiConfig.GetPackage, - Type = "PackageBaseAddress/3.0.0" , + Type = "PackageBaseAddress/3.0.0", Comment = "Package Base Address service" }); - if (unleashClient.IsEnabled("pkg-autocomplete", false)) + if (unleashClient.IsEnabled("pkg-autocomplete", true)) res.Add( new Resource { @@ -72,22 +73,51 @@ namespace isnd.Services Type = "SearchQueryService/" + BASE_API_LEVEL, Comment = "Search Query service" }); - if (unleashClient.IsEnabled("pkg-catalog", false)) + if (unleashClient.IsEnabled("pkg-catalog", true)) res.Add( new Resource { Id = extUrl + ApiConfig.Catalog, - Type = "Catalog/"+ BASE_API_LEVEL, + Type = "Catalog/" + BASE_API_LEVEL, Comment = "Package Catalog Index" }); - - /* FIXME res.Add( + + /* FIXME */ + res.Add( new Resource { - Id = extUrl + ApiConfig.Registration, - Type = "RegistrationsBaseUrl/3.6.0", + Id = extUrl + "v" + BASE_API_LEVEL + "/" + ApiConfig.Registration, + Type = "RegistrationsBaseUrl", Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." - }); */ + }); + + res.Add( + new Resource + { + Id = extUrl + "v3.0.0-beta/" + ApiConfig.Registration, + Type = "RegistrationsBaseUrl/3.0.0-beta", + Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." + }); + res.Add( + new Resource + { + Id = extUrl + "v3.0.0-rc/" + ApiConfig.Registration, + Type = "RegistrationsBaseUrl/3.0.0-rc", + Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." + }); + res.Add(new Resource + { + Id = extUrl + "v3.4.0/" + ApiConfig.Registration, + Type = "RegistrationsBaseUrl/3.4.0", + Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." + }); + + res.Add(new Resource + { + Id = extUrl + "v3.6.0/" + ApiConfig.Registration, + Type = "RegistrationsBaseUrl/3.6.0", + Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages." + }); return res; } @@ -97,7 +127,6 @@ namespace isnd.Services { var scope = dbContext.Packages - .Include(p => p.Versions) .Where( p => (PackageIdHelpers.CamelCaseMatch(p.Id, query) || PackageIdHelpers.SeparatedByMinusMatch(p.Id, query)) && (prerelease || p.Versions.Any(v => !v.IsPrerelease)) @@ -171,8 +200,8 @@ namespace isnd.Services int p = 0; var oldIndex = CurrentCatalogIndex; var oldPages = CurrentCatalogPages; - string baseid= extUrl + ApiConfig.Catalog; - string basepageid= extUrl + ApiConfig.CatalogPage; + string baseid = extUrl + ApiConfig.Catalog; + string basepageid = extUrl + ApiConfig.CatalogPage; CurrentCatalogIndex = new CatalogIndex { Id = baseid, @@ -181,7 +210,7 @@ namespace isnd.Services CurrentCatalogPages = new List(); var scope = dbContext.Commits.OrderBy(c => c.TimeStamp); - + PageRef pageRef = null; Page page = null; i = isndSettings.CatalogPageLen; @@ -217,14 +246,14 @@ namespace isnd.Services foreach (var pkg in validPkgs) { var v = pkg.Versions. - Where (cv => cv.CommitId == commit.CommitId) + Where(cv => cv.CommitId == commit.CommitId) .OrderByDescending(vc => vc.CommitNId).First(); StringBuilder refid = new StringBuilder(extUrl); - refid.AppendFormat("{0}/{1}/{2}",ApiConfig.CatalogLeaf, v.PackageId + refid.AppendFormat("{0}/{1}/{2}", ApiConfig.CatalogLeaf, v.PackageId , v.FullString); - if (v.Type!=null) - refid.AppendFormat("/{0}",v.Type); + if (v.Type != null) + refid.AppendFormat("/{0}", v.Type); var pkgref = new PackageRef { @@ -258,7 +287,8 @@ namespace isnd.Services public async Task DeletePackageAsync(string pkgid, string version, string type) { // TODO deletion on disk - var commit = new Commit{ + var commit = new Commit + { Action = PackageAction.DeletePackage, TimeStamp = DateTime.Now }; @@ -270,12 +300,12 @@ namespace isnd.Services ); if (pkg == null) { - return new PackageDeletionReport{ Deleted = false }; + return new PackageDeletionReport { Deleted = false }; } dbContext.PackageVersions.Remove(pkg); await dbContext.SaveChangesAsync(); ÛpdateCatalogFor(commit); - return new PackageDeletionReport{ Deleted = true, DeletedVersion = pkg }; + return new PackageDeletionReport { Deleted = true, DeletedVersion = pkg }; } public async Task GetPackageAsync(string pkgid, string version, string type) @@ -301,7 +331,7 @@ namespace isnd.Services public IEnumerable GetCatalogLeaf(string id, string version, string lower) { return dbContext.PackageVersions - .Include(v=>v.Package) + .Include(v => v.Package) .Where(v => v.PackageId == id && v.FullString == version && (lower == null || lower == v.Type)); } diff --git a/src/isnd/Startup.cs b/src/isnd/Startup.cs index 40333bc..26fbd3c 100644 --- a/src/isnd/Startup.cs +++ b/src/isnd/Startup.cs @@ -109,13 +109,14 @@ namespace isnd Microsoft.AspNetCore.Hosting.IHostingEnvironment env, ApplicationDbContext dbContext) { - // app.UseForwardedHeaders(); - // .UseHttpsRedirection(); + app.UseForwardedHeaders(); + // if have a cert : app.UseHttpsRedirection(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseMigrationsEndPoint(); + app.UseBrowserLink(); } else { diff --git a/src/isnd/ViewModels/PackageIndexViewModel.cs b/src/isnd/ViewModels/PackageIndexViewModel.cs index 9af7942..c2b69a9 100644 --- a/src/isnd/ViewModels/PackageIndexViewModel.cs +++ b/src/isnd/ViewModels/PackageIndexViewModel.cs @@ -1,4 +1,5 @@ using isnd.Data; +using isnd.Data.Packages; using Newtonsoft.Json; namespace isnd.ViewModels diff --git a/src/isnd/ViewModels/SearchResult.cs b/src/isnd/ViewModels/SearchResult.cs index f7b1e4d..c36e9f0 100644 --- a/src/isnd/ViewModels/SearchResult.cs +++ b/src/isnd/ViewModels/SearchResult.cs @@ -1,4 +1,5 @@ using isnd.Data; +using isnd.Data.Packages; namespace isnd.Services { diff --git a/test/isn.tests/PushTest.cs b/test/isn.tests/PushTest.cs index 6057647..fa044a7 100644 --- a/test/isn.tests/PushTest.cs +++ b/test/isn.tests/PushTest.cs @@ -10,6 +10,7 @@ using isn.Abstract; using System.Linq; using Xunit; using isn.abst; +using isnd.Entities; namespace isn.tests { @@ -47,7 +48,7 @@ dataTable.Rows.Add(dataRow); [Fact] public async Task TestHttpClient() { - string url = "http://isn.pschneider.fr/index.json"; + string url = "http://isn.pschneider.fr/" + ApiConfig.Base; HttpClient client = new HttpClient(); // var json = await client.GetStringAsync(new System.Uri(url)); var response = await client.GetAsync(url);