Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion deploy/helm/cgen-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ env:
values:
- name: ConnectionString
value: Server=tcp:mssql-data;Initial Catalog=O2Bionics.O2NextGen.CGenDb;User ID=sa;Password=yourStrong(!)Password;Connection Timeout=30;

- name: DatabaseInitializerSettings__Initialize
value: false
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 25.0.1704.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.Sdk.NetCore.Extensions", "O2NextGen.Sdk.NetCore.Extensions.csproj", "{73C6B6D2-413C-444C-A8D8-9C51A45669B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{73C6B6D2-413C-444C-A8D8-9C51A45669B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73C6B6D2-413C-444C-A8D8-9C51A45669B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73C6B6D2-413C-444C-A8D8-9C51A45669B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73C6B6D2-413C-444C-A8D8-9C51A45669B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28AD8BAB-FD1C-46E6-9F11-6F4DA2FCC91E}
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions src/SDKs/O2NextGen.Sdk.NetCore.Extensions/UnixDateExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
namespace O2NextGen.Sdk.NetCore.Extensions
{
public class UnixDateExtensions
{
public UnixDateExtensions()
{
}
}
}

36 changes: 23 additions & 13 deletions src/Services/c-gen/O2NextGen.CGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.O2NextGen.Certificate
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.O2NextGen.CertificateManagement.Impl", "Tests\Tests.O2NextGen.CertificateManagement.Impl\Tests.O2NextGen.CertificateManagement.Impl.csproj", "{6FB50F98-47E7-4960-80F0-58562914ADDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.CertificateManagement.Api", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Api\IntegrationTests.O2NextGen.CertificateManagement.Api.csproj", "{094FF4EB-0351-44BF-9739-4F3A62721DFC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.O2NextGen.CertificateManagement.Api", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Api\IntegrationTests.O2NextGen.CertificateManagement.Api.csproj", "{094FF4EB-0351-44BF-9739-4F3A62721DFC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SDKs", "SDKs", "{54AADF48-C069-49F7-B8A8-3B72F5FC3F14}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.Sdk.NetCore.Models", "..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj", "{AFA64E01-DA06-4432-9BEA-34D0F4AD6A54}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.Sdk.NetCore.Models", "..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj", "{AFA64E01-DA06-4432-9BEA-34D0F4AD6A54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Domain", "O2NextGen.CertificateManagement.Domain\O2NextGen.CertificateManagement.Domain.csproj", "{30072535-9AFD-45CE-8258-87BF3CAA2EC2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Domain", "O2NextGen.CertificateManagement.Domain\O2NextGen.CertificateManagement.Domain.csproj", "{30072535-9AFD-45CE-8258-87BF3CAA2EC2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.StartupTasks", "O2NextGen.CertificateManagement.StartupTasks\O2NextGen.CertificateManagement.StartupTasks.csproj", "{9BE85DEE-293B-4E57-BD0F-01E3B48F7A61}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.StartupTasks", "O2NextGen.CertificateManagement.StartupTasks\O2NextGen.CertificateManagement.StartupTasks.csproj", "{9BE85DEE-293B-4E57-BD0F-01E3B48F7A61}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Infrastructure", "O2NextGen.CertificateManagement.Infrastructure\O2NextGen.CertificateManagement.Infrastructure.csproj", "{125F9B7B-1508-4F01-A9AA-2EBC01BE0C19}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Infrastructure", "O2NextGen.CertificateManagement.Infrastructure\O2NextGen.CertificateManagement.Infrastructure.csproj", "{125F9B7B-1508-4F01-A9AA-2EBC01BE0C19}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CQRS", "CQRS", "{716B7603-CDF7-460D-A869-20FE90F84EC2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skeleton", "Skeleton", "{2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Application", "O2NextGen.CertificateManagement.Application\O2NextGen.CertificateManagement.Application.csproj", "{BC6D2691-1006-4B6D-B661-81157E493F3B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Application", "O2NextGen.CertificateManagement.Application\O2NextGen.CertificateManagement.Application.csproj", "{BC6D2691-1006-4B6D-B661-81157E493F3B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.CertificateManagement.Application", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Application\IntegrationTests.O2NextGen.CertificateManagement.Application.csproj", "{58CC0839-863D-4708-A6D4-42F245593538}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.O2NextGen.CertificateManagement.Application", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Application\IntegrationTests.O2NextGen.CertificateManagement.Application.csproj", "{58CC0839-863D-4708-A6D4-42F245593538}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CQRS", "CQRS", "{0835E199-8062-45E0-899E-38ECAD9437CD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.CertificateManagement.Infrastructure", "Tests\Tests.O2NextGen.CertificateManagement.Infrastructure\Tests.O2NextGen.CertificateManagement.Infrastructure.csproj", "{EC5B79FF-4A87-4740-B5EC-2778861EB017}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -95,24 +99,30 @@ Global
{58CC0839-863D-4708-A6D4-42F245593538}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58CC0839-863D-4708-A6D4-42F245593538}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58CC0839-863D-4708-A6D4-42F245593538}.Release|Any CPU.Build.0 = Release|Any CPU
{EC5B79FF-4A87-4740-B5EC-2778861EB017}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC5B79FF-4A87-4740-B5EC-2778861EB017}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC5B79FF-4A87-4740-B5EC-2778861EB017}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC5B79FF-4A87-4740-B5EC-2778861EB017}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{EA540B06-8A73-49C7-A799-49423B316458} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{C6E0B2A5-6349-4C1D-8E14-82249AF8F58A} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{01805439-2954-49CE-93D2-5EB06B82146C} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{B8C8A05D-0D30-40FF-8BDD-B2FBA2ED7AB0} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{CEA7184F-87D5-4141-A4BC-A983BF257AC6} = {12E83C2A-23C7-4E71-B137-AC56CE28F9E4}
{6FB50F98-47E7-4960-80F0-58562914ADDE} = {12E83C2A-23C7-4E71-B137-AC56CE28F9E4}
{094FF4EB-0351-44BF-9739-4F3A62721DFC} = {12E83C2A-23C7-4E71-B137-AC56CE28F9E4}
{AFA64E01-DA06-4432-9BEA-34D0F4AD6A54} = {54AADF48-C069-49F7-B8A8-3B72F5FC3F14}
{EA540B06-8A73-49C7-A799-49423B316458} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{C6E0B2A5-6349-4C1D-8E14-82249AF8F58A} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{B8C8A05D-0D30-40FF-8BDD-B2FBA2ED7AB0} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{01805439-2954-49CE-93D2-5EB06B82146C} = {2561455C-AAF2-4B6F-BA84-DA8AD57EB3E4}
{30072535-9AFD-45CE-8258-87BF3CAA2EC2} = {716B7603-CDF7-460D-A869-20FE90F84EC2}
{125F9B7B-1508-4F01-A9AA-2EBC01BE0C19} = {716B7603-CDF7-460D-A869-20FE90F84EC2}
{9BE85DEE-293B-4E57-BD0F-01E3B48F7A61} = {716B7603-CDF7-460D-A869-20FE90F84EC2}
{125F9B7B-1508-4F01-A9AA-2EBC01BE0C19} = {716B7603-CDF7-460D-A869-20FE90F84EC2}
{BC6D2691-1006-4B6D-B661-81157E493F3B} = {716B7603-CDF7-460D-A869-20FE90F84EC2}
{58CC0839-863D-4708-A6D4-42F245593538} = {12E83C2A-23C7-4E71-B137-AC56CE28F9E4}
{58CC0839-863D-4708-A6D4-42F245593538} = {0835E199-8062-45E0-899E-38ECAD9437CD}
{0835E199-8062-45E0-899E-38ECAD9437CD} = {12E83C2A-23C7-4E71-B137-AC56CE28F9E4}
{EC5B79FF-4A87-4740-B5EC-2778861EB017} = {0835E199-8062-45E0-899E-38ECAD9437CD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A6DFC9F0-3FA7-492B-ACE9-3EFBF3477712}
Expand Down
7 changes: 7 additions & 0 deletions src/Services/c-gen/O2NextGen.CGen.v3.ncrunchsolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>True</AllowParallelTestExecution>
<HotSpotsExclusionList />
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using O2NextGen.CertificateManagement.Api.Setup;
using O2NextGen.CertificateManagement.Business.Services;
using Microsoft.AspNetCore.Mvc;
using O2NextGen.CertificateManagement.Api.Mappings;
using O2NextGen.Sdk.NetCore.Models.c_gen;
using O2NextGen.CertificateManagement.Api.Setup;
using O2NextGen.CertificateManagement.Api.ViewModels;
using O2NextGen.CertificateManagement.Business.Services;
using System.Threading;
using System.Threading.Tasks;

namespace O2NextGen.CertificateManagement.Api.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using O2NextGen.CertificateManagement.Api.Mappings;
using O2NextGen.CertificateManagement.Api.Setup;
using O2NextGen.CertificateManagement.Business.Services;
using O2NextGen.CertificateManagement.Api.Mappings;
using O2NextGen.Sdk.NetCore.Models.c_gen;
using O2NextGen.CertificateManagement.Impl.Services;
using MediatR;
using O2NextGen.CertificateManagement.Domain.UseCases.Certificate.CreateCertificate;
using System.Threading;
using System.Threading.Tasks;

namespace O2NextGen.CertificateManagement.Api.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Reflection;

namespace O2NextGen.CertificateManagement.Api.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace O2NextGen.CertificateManagement.Api.Filters
{
public class ApiExceptionFilter: IExceptionFilter
public class ApiExceptionFilter : IExceptionFilter

{
public void OnException(ExceptionContext context)
{
if (context.ExceptionHandled is DbUpdateConcurrencyException)
{
context.Result =
new ConflictObjectResult(new {Message = "Entity was updated, please refresh your copy."});
new ConflictObjectResult(new { Message = "Entity was updated, please refresh your copy." });
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -9,6 +7,7 @@
using O2NextGen.CertificateManagement.Business.Services;
using O2NextGen.CertificateManagement.Data;
using O2NextGen.CertificateManagement.Impl.Services;
using System;

namespace O2NextGen.CertificateManagement.Api.IoC
{
Expand All @@ -18,10 +17,10 @@ public static class ServiceCollectionExtensions
public static TConfig ConfigurePOCO<TConfig>(this IServiceCollection services, IConfiguration configuration)
where TConfig : class, new()
{
if (services == null)
throw new ArgumentNullException(nameof(services));
if (configuration == null)
if (services == null)
throw new ArgumentNullException(nameof(services));
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));

var config = new TConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Serilog.Events;
using Serilog.Formatting;
using Serilog.Formatting.Json;
using System.IO;

namespace O2NextGen.CertificateManagement.Api.Logging
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using O2NextGen.CertificateManagement.Api.ViewModels;
using O2NextGen.CertificateManagement.Business.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using O2NextGen.CertificateManagement.Api.ViewModels;
using O2NextGen.CertificateManagement.Business.Models;

namespace O2NextGen.CertificateManagement.Api.Mappings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using O2NextGen.CertificateManagement.Business.Models;
using O2NextGen.Sdk.NetCore.Models.c_gen;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using O2NextGen.CertificateManagement.Business.Models;
using O2NextGen.Sdk.NetCore.Models.c_gen;

namespace O2NextGen.CertificateManagement.Api.Mappings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ProjectConfiguration>
<Settings>
<IgnoredTests>
<AllTestsSelector />
</IgnoredTests>
</Settings>
</ProjectConfiguration>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Serilog;
using System;
using System.Threading.Tasks;

namespace O2NextGen.CertificateManagement.Api
{
Expand All @@ -11,11 +11,11 @@ public class Program
public static readonly string Namespace = typeof(Program).Namespace;

public static readonly string AppName =
Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
public static async Task<int> Main(string[] args)
{
{
try
{
var host = CreateHostBuilder(args);
Expand Down Expand Up @@ -44,6 +44,6 @@ public static IWebHost CreateHostBuilder(string[] args) =>
configuration.ReadFrom.Configuration(context.Configuration);
})
.UseStartup<Startup>()
.Build();
.Build();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using System;

namespace O2NextGen.CertificateManagement.Api.Services
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace O2NextGen.CertificateManagement.Api.Setup
{
public class UrlsConfig
{
public string Auth { get; set; }
public string Auth { get; set; }
}
}
21 changes: 10 additions & 11 deletions src/Services/c-gen/O2NextGen.CertificateManagement.Api/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using O2NextGen.CertificateManagement.Api.Setup;
using O2NextGen.CertificateManagement.Api.Helpers;
using O2NextGen.CertificateManagement.Api.IoC;
using Swashbuckle.AspNetCore.Swagger;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using O2NextGen.CertificateManagement.Api.Helpers;
using O2NextGen.CertificateManagement.Api.IoC;
using O2NextGen.CertificateManagement.Api.Setup;
using System.Net;
using System.Threading.Tasks;

[assembly: ApiController]
namespace O2NextGen.CertificateManagement.Api
Expand All @@ -35,7 +34,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddSwaggerGen(options =>
{
options.DescribeAllParametersInCamelCase();
options.SwaggerDoc("v1",new OpenApiInfo()
options.SwaggerDoc("v1", new OpenApiInfo()
{
Title = "O2NextGen Platform. C-Gen HTTP API",
Version = "v1",
Expand All @@ -59,7 +58,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
builder.Run(async context =>
{
context.Response.StatusCode = (int) HttpStatusCode.InternalServerError;
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;

var error = context.Features.Get<IExceptionHandlerFeature>();

Expand All @@ -70,8 +69,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}
});
});
}
}
app.UseStaticFiles();
app.UseSwagger()
.UseSwaggerUI(c =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using O2NextGen.CertificateManagement.Data;
using System.Threading.Tasks;

// ReSharper disable once CheckNamespace
namespace Microsoft.AspNetCore.Hosting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
namespace O2NextGen.CertificateManagement.Api.ViewModels
namespace O2NextGen.CertificateManagement.Api.ViewModels
{
public class CategoryViewModel
{
Expand Down
Loading