Skip to content

Commit

Permalink
enable XML comments
Browse files Browse the repository at this point in the history
  • Loading branch information
romanett committed Nov 9, 2023
1 parent 3d5a05b commit 52aacb7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
3 changes: 3 additions & 0 deletions GDSwithREST/Controllers/ApplicationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace GDSwithREST.Controllers
{
/// <summary>
/// API Rout for getting Applications registered at the GDS
/// </summary>
[Route("[controller]")]
[ApiController]
public class ApplicationsController : ControllerBase
Expand Down
4 changes: 3 additions & 1 deletion GDSwithREST/Controllers/CertificateGroupsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace GDSwithREST.Controllers
{
/// <summary>
/// API Route to return Information about Certificate Groups
/// </summary>
[Route("[controller]")]
[ApiController]
public class CertificateGroupsController : ControllerBase
Expand Down Expand Up @@ -87,7 +90,6 @@ from cert in trustedCertificatesCollection
/// Regenerate the CA Certificate of the specified Certificate Group
/// </summary>
/// <param name="id"></param>
/// <param name="subjectNameRaw"></param>
/// <returns></returns>
// POST: /CertificateGroup/5/ca
// To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754
Expand Down
23 changes: 19 additions & 4 deletions GDSwithREST/Data/Models/ApiModels/ApplicationApiModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,40 @@

namespace GDSwithREST.Data.Models.ApiModels
{
/// <summary>
/// A GDS registered Application
/// </summary>
public class ApplicationApiModel
{
/// <summary>
/// The Guid identifying the Application
/// </summary>
public Guid ApplicationId { get; set; }
/// <summary>
/// The Uri of the Application
/// </summary>
public string ApplicationUri { get; set; } = null!;
/// <summary>
/// The name of the Application
/// </summary>
public string ApplicationName { get; set; } = null!;
public int ApplicationType { get; set; }
public string ProductUri { get; set; } = null!;
/// <summary>
/// The gds signed certificate of the Application
/// </summary>
public X509CertificateApiModel? Certificate { get;set; }

public string? Certificate { get;set; }

//Certificate?

public ApplicationApiModel(Applications application)
{
ApplicationId = application.ApplicationId;
ApplicationUri = application.ApplicationUri;
ApplicationName = application.ApplicationName;
ProductUri = application.ProductUri;
ApplicationType = application.ApplicationType;
Certificate = new X509Certificate2(application.Certificate).ExportCertificatePem();
if(application.Certificate.Length > 0)
Certificate = new X509CertificateApiModel(new X509Certificate2(application.Certificate));
}
[JsonConstructor]
public ApplicationApiModel(Guid applicationId, string applicationUri, string applicationName, int applicationType, string productUri)
Expand Down
3 changes: 3 additions & 0 deletions GDSwithREST/Data/Models/ApiModels/CertificateGroupApiModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace GDSwithREST.Data.Models.ApiModels
{
/// <summary>
/// Certificate Group of the GDS
/// </summary>
public class CertificateGroupApiModel
{
public CertificateGroupApiModel(CertificateGroup certificateGroup)
Expand Down
6 changes: 6 additions & 0 deletions GDSwithREST/Data/Models/ApiModels/X509CertificateApiModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace GDSwithREST.Data.Models.ApiModels
{
/// <summary>
/// A X509 Certificate
/// </summary>
public class X509CertificateApiModel
{
public string Subject { get; set; }
Expand All @@ -15,6 +18,8 @@ public class X509CertificateApiModel

public string Certificate { get; set; }

public string Issuer { get; set; }

public X509CertificateApiModel(X509Certificate2 certificate)
{
Certificate = certificate.ExportCertificatePem();
Expand All @@ -23,6 +28,7 @@ public X509CertificateApiModel(X509Certificate2 certificate)
NotBefore = certificate.NotBefore;
NotAfter = certificate.NotAfter;
Subject = certificate.Subject;
Issuer = certificate.Issuer;
}

public X509Certificate2 ToServiceModel()
Expand Down
8 changes: 6 additions & 2 deletions GDSwithREST/GDSwithREST.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
<GenerateDocumentationFile>False</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702</NoWarn>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702</NoWarn>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>


Expand Down
1 change: 0 additions & 1 deletion GDSwithREST/Services/GdsBackgroundService/IGdsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public interface IGdsService
/// <summary>
/// returns the Endpoints of the OPC UA GDS Server
/// </summary>
/// <returns cref="EndpointDescriptionCollection"><<returns>
public IEnumerable<String> GetEndpointURLs();

public Task StartServer(CancellationToken stoppingToken);
Expand Down

0 comments on commit 52aacb7

Please sign in to comment.