catalog impl
parent
fa9a12ad49
commit
14206ac477
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<apikeys>
|
||||||
|
</apikeys>
|
||||||
|
<packageSources>
|
||||||
|
<add key="myIsnDev" value="http://localhost:5000/index.json" protocolVersion="3" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
@ -0,0 +1,2 @@
|
|||||||
|
nuget install -Verbosity detailed -Source http://localhost:5000/index.json -Prerelease Yavsc.Abstract
|
||||||
|
nuget locals all -clear
|
@ -0,0 +1,4 @@
|
|||||||
|
= URL's
|
||||||
|
|
||||||
|
<http://localhost:5000/v3.4.0/registration/yavsc.abstract/index.json>
|
||||||
|
|
@ -1,11 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# compiler tout
|
# compiler tout
|
||||||
dotnet publish -c Release
|
dotnet build -c Release
|
||||||
|
dotnet publish -c Release -f netcoreapp2.1 src/isnd
|
||||||
# MAJ du serveur
|
# MAJ du serveur
|
||||||
sudo systemctl stop isnd
|
sudo systemctl stop isnd
|
||||||
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
|
sudo cp -a src/isnd/bin/Release/netcoreapp2.1/publish/* /srv/www/isnd
|
||||||
sudo systemctl start isnd
|
sudo systemctl start isnd
|
||||||
# MAJ du client
|
# MAJ du client
|
||||||
sudo cp -a src/isn/bin/Release/net472/* /usr/local/lib/isn
|
sudo cp -a src/isn/bin/Release/netcoreapp2.1/* /usr/local/lib/isn
|
||||||
sudo chmod +x /usr/local/lib/isn/isn.exe
|
sudo chown -R root.root /usr/local/lib/isn
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
using NuGet.Versioning;
|
||||||
|
|
||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class AlternatePackage
|
||||||
|
{
|
||||||
|
public string id { get ; set; }
|
||||||
|
public VersionRange range { get ; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class CatalogEntry
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The URL to the document used to produce this object
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
[Key][Required]
|
||||||
|
[StringLength(1024)]
|
||||||
|
[JsonProperty("@id")]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Authors
|
||||||
|
/// </summary>
|
||||||
|
/// <value>string or array of strings</value>
|
||||||
|
public string authors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The dependencies of the package, grouped by target framework
|
||||||
|
/// </summary>
|
||||||
|
/// <value>array of objects</value>
|
||||||
|
public DependencyGroup[] dependencyGroups { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The deprecation associated with the package
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public Deprecation deprecation { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("description")]
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string iconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The ID of the package
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string idp { get; set; }
|
||||||
|
public string licenseUrl { get; set; }
|
||||||
|
public string licenseExpression { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Should be considered as listed if absent
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public bool listed { get; set; }
|
||||||
|
public string minClientVersion { get; set; }
|
||||||
|
public string projectUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A string containing a ISO 8601 timestamp of when the package was published
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string published { get; set; }
|
||||||
|
public bool requireLicenseAcceptance { get; set; }
|
||||||
|
public string summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The tags
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string tags { get; set; }
|
||||||
|
public string title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The full version string after normalization
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
[Required]
|
||||||
|
public string version { get; set; } // string yes
|
||||||
|
/// <summary>
|
||||||
|
/// The security vulnerabilities of the package
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public Vulnerabilitie[] vulnerabilities { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class DependencyGroup
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class Deprecation
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Legacy The package is no longer maintained
|
||||||
|
CriticalBugs The package has bugs which make it unsuitable for usage
|
||||||
|
Other The package is deprecated due to a reason not on this list
|
||||||
|
*/
|
||||||
|
public string[] reasons { get; set; } // array of strings yes The reasons why the package was deprecated
|
||||||
|
public string message { get; set; } // The additional details about this deprecation
|
||||||
|
public AlternatePackage alternatePackage { get; set; } // object no The alternate package that should be used instead
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,14 @@
|
|||||||
using isnd.Data;
|
|
||||||
using isnd.Data.Packages;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace isnd.ViewModels
|
namespace isnd.Data.Catalog
|
||||||
{
|
{
|
||||||
public class PackageIndexViewModel
|
public class PackageRegistrationIndexViewModel
|
||||||
{
|
{
|
||||||
[JsonProperty("prerelease")]
|
[JsonProperty("prerelease")]
|
||||||
public bool Prerelease { get; set; }
|
public bool Prerelease { get; set; }
|
||||||
|
|
||||||
[JsonProperty("data")]
|
[JsonProperty("data")]
|
||||||
public Package[] Data {get; set;}
|
public RegistrationLeaf[] Data {get; set;}
|
||||||
|
|
||||||
[JsonProperty("query")]
|
[JsonProperty("query")]
|
||||||
public string Query { get; set; }
|
public string Query { get; set; }
|
@ -0,0 +1,36 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class RegistrationLeaf
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@id string yes
|
||||||
|
catalogEntry object yes
|
||||||
|
packageContent string yes
|
||||||
|
*/
|
||||||
|
[JsonProperty("@id")]
|
||||||
|
[Key][Required]
|
||||||
|
[StringLength(1024)]
|
||||||
|
/// <summary>
|
||||||
|
/// The URL to the registration leaf
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The catalog entry containing the package metadata
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
[JsonProperty("catalogEntry")]
|
||||||
|
public CatalogEntry Entry { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The URL to the package content (.nupkg)
|
||||||
|
/// </summary>
|
||||||
|
/// <value></value>
|
||||||
|
[JsonProperty("packageContent")]
|
||||||
|
public string PackageContent { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class RegistrationPage
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@id string yes The URL to the registration page
|
||||||
|
count integer yes The number of registration leaves in the page
|
||||||
|
items array of objects no The array of registration leaves and their associate metadata
|
||||||
|
lower string yes The lowest SemVer 2.0.0 version in the page (inclusive)
|
||||||
|
parent string no The URL to the registration index
|
||||||
|
upper string yes The highest SemVer 2.0.0 version in the page (inclusive) */
|
||||||
|
[JsonProperty("@id")]
|
||||||
|
public string Id { get; set; }
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("items")]
|
||||||
|
|
||||||
|
public RegistrationLeaf[] Items { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("upper")]
|
||||||
|
public Version Upper { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lower")]
|
||||||
|
public Version Lower { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parent")]
|
||||||
|
public string Parent { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace isnd.Data.Catalog
|
||||||
|
{
|
||||||
|
public class Vulnerabilitie
|
||||||
|
{
|
||||||
|
public string advisoryUrl { get; set; } // string yes Location of security advisory for the package
|
||||||
|
public string severity { get; set; } // string yes Severity of advisory: "0" = Low, "1" = Moderate, "2" = High, "3" = Critical
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
using isnd.Data.Packages;
|
||||||
|
|
||||||
|
namespace isnd.ViewModels
|
||||||
|
{
|
||||||
|
public class RegistrationLeaf
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@id string yes The URL to the registration leaf
|
||||||
|
catalogEntry object yes The catalog entry containing the package metadata
|
||||||
|
packageContent string yes The URL to the package content (.nupkg)
|
||||||
|
*/
|
||||||
|
public static RegistrationLeaf FromPackage(Package p)
|
||||||
|
{
|
||||||
|
RegistrationLeaf v = new RegistrationLeaf
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class CatalogEntry
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
@id string yes The URL to the document used to produce this object
|
||||||
|
authors string or array of strings no
|
||||||
|
dependencyGroups array of objects no The dependencies of the package, grouped by target framework
|
||||||
|
deprecation object no The deprecation associated with the package
|
||||||
|
description string no
|
||||||
|
iconUrl string no
|
||||||
|
id string yes The ID of the package
|
||||||
|
licenseUrl string no
|
||||||
|
licenseExpression string no
|
||||||
|
listed boolean no Should be considered as listed if absent
|
||||||
|
minClientVersion string no
|
||||||
|
projectUrl string no
|
||||||
|
published string no A string containing a ISO 8601 timestamp of when the package was published
|
||||||
|
requireLicenseAcceptance boolean no
|
||||||
|
summary string no
|
||||||
|
tags string or array of string no
|
||||||
|
title string no
|
||||||
|
version string yes The full version string after normalization
|
||||||
|
vulnerabilities array of objects no The security vulnerabilities of the package
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
@using isnd.Data
|
@using isnd.Data
|
||||||
@using isnd.ViewModels
|
@using isnd.ViewModels
|
||||||
@using isnd.Helpers
|
@using isnd.Helpers
|
||||||
|
@using isnd.Data.Catalog;
|
||||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
|
Loading…
Reference in New Issue