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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Services/c-gen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:2.2 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:2.2 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj", "O2NextGen.CertificateManagement.Api/"]
COPY ["../../SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj", "../../SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/"]
Expand Down
22 changes: 8 additions & 14 deletions src/Services/c-gen/O2NextGen.CGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Api", "O2NextGen.CertificateManagement.Api\O2NextGen.CertificateManagement.Api.csproj", "{EA540B06-8A73-49C7-A799-49423B316458}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Api", "O2NextGen.CertificateManagement.Api\O2NextGen.CertificateManagement.Api.csproj", "{EA540B06-8A73-49C7-A799-49423B316458}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Business", "O2NextGen.CertificateManagement.Business\O2NextGen.CertificateManagement.Business.csproj", "{C6E0B2A5-6349-4C1D-8E14-82249AF8F58A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Business", "O2NextGen.CertificateManagement.Business\O2NextGen.CertificateManagement.Business.csproj", "{C6E0B2A5-6349-4C1D-8E14-82249AF8F58A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Impl", "O2NextGen.CertificateManagement.Impl\O2NextGen.CertificateManagement.Impl.csproj", "{01805439-2954-49CE-93D2-5EB06B82146C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Impl", "O2NextGen.CertificateManagement.Impl\O2NextGen.CertificateManagement.Impl.csproj", "{01805439-2954-49CE-93D2-5EB06B82146C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{12E83C2A-23C7-4E71-B137-AC56CE28F9E4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.CertificateManagement.Data", "O2NextGen.CertificateManagement.Data\O2NextGen.CertificateManagement.Data.csproj", "{B8C8A05D-0D30-40FF-8BDD-B2FBA2ED7AB0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.CertificateManagement.Data", "O2NextGen.CertificateManagement.Data\O2NextGen.CertificateManagement.Data.csproj", "{B8C8A05D-0D30-40FF-8BDD-B2FBA2ED7AB0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.O2NextGen.CertificateManagement.Api", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Api\IntegrationTests.O2NextGen.CertificateManagement.Api.csproj", "{454CB1E8-8060-49CB-9752-140F93E7829C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.CertificateManagement.Api", "Tests\IntegrationTests.O2NextGen.CertificateManagement.Api\IntegrationTests.O2NextGen.CertificateManagement.Api.csproj", "{454CB1E8-8060-49CB-9752-140F93E7829C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.O2NextGen.CertificateManagement.Api", "Tests\Tests.O2NextGen.CertificateManagement.Api\Tests.O2NextGen.CertificateManagement.Api.csproj", "{CEA7184F-87D5-4141-A4BC-A983BF257AC6}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.CertificateManagement.Api", "Tests\Tests.O2NextGen.CertificateManagement.Api\Tests.O2NextGen.CertificateManagement.Api.csproj", "{CEA7184F-87D5-4141-A4BC-A983BF257AC6}"
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}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.CertificateManagement.Impl", "Tests\Tests.O2NextGen.CertificateManagement.Impl\Tests.O2NextGen.CertificateManagement.Impl.csproj", "{6FB50F98-47E7-4960-80F0-58562914ADDE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SDKs", "SDKs", "{629874CA-6688-43CA-9716-48FB42D41150}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "O2NextGen.Sdk.NetCore.Models", "..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj", "{8C88AA87-9C8E-42D7-BAF1-28401C563FDF}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{24414F70-A58D-4802-A437-B15D9F98AC8E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.Sdk.NetCore.Models", "..\..\SDKs\O2NG.Sdk.NetCore\O2NG.Sdk.NetCore.Models\O2NextGen.Sdk.NetCore.Models.csproj", "{8C88AA87-9C8E-42D7-BAF1-28401C563FDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -63,10 +61,6 @@ Global
{8C88AA87-9C8E-42D7-BAF1-28401C563FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C88AA87-9C8E-42D7-BAF1-28401C563FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C88AA87-9C8E-42D7-BAF1-28401C563FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{24414F70-A58D-4802-A437-B15D9F98AC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24414F70-A58D-4802-A437-B15D9F98AC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24414F70-A58D-4802-A437-B15D9F98AC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24414F70-A58D-4802-A437-B15D9F98AC8E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public class VersionController:ControllerBase
{
#region Fields

private readonly IHostingEnvironment _environment;
private readonly IWebHostEnvironment _environment;
private readonly ILogger<VersionController> _logger;

#endregion


#region Ctors

public VersionController(IHostingEnvironment environment, ILogger<VersionController> logger)
public VersionController(IWebHostEnvironment environment, ILogger<VersionController> logger)
{
_environment = environment;
_logger = logger;
Expand Down
25 changes: 25 additions & 0 deletions src/Services/c-gen/O2NextGen.CertificateManagement.Api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj", "O2NextGen.CertificateManagement.Api/"]
COPY ["../../SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/O2NextGen.Sdk.NetCore.Models.csproj", "../../SDKs/O2NG.Sdk.NetCore/O2NG.Sdk.NetCore.Models/"]
COPY ["O2NextGen.CertificateManagement.Business/O2NextGen.CertificateManagement.Business.csproj", "O2NextGen.CertificateManagement.Business/"]
COPY ["O2NextGen.CertificateManagement.Data/O2NextGen.CertificateManagement.Data.csproj", "O2NextGen.CertificateManagement.Data/"]
COPY ["O2NextGen.CertificateManagement.Impl/O2NextGen.CertificateManagement.Impl.csproj", "O2NextGen.CertificateManagement.Impl/"]
RUN dotnet restore "O2NextGen.CertificateManagement.Api/O2NextGen.CertificateManagement.Api.csproj"
COPY . .
WORKDIR "/src/O2NextGen.CertificateManagement.Api"
RUN dotnet build "O2NextGen.CertificateManagement.Api.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "O2NextGen.CertificateManagement.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "O2NextGen.CertificateManagement.Api.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static IServiceCollection AddRequiredMvcComponents(this IServiceCollectio
});

mvcBuilder.AddApiExplorer(); //for swagger
mvcBuilder.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
//mvcBuilder.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
mvcBuilder.AddNewtonsoftJson(o =>
{
o.SerializerSettings.Converters.Add(new StringEnumConverter());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>e238f36a-3514-4436-b624-9b4f799bb82d</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..</DockerfileContext>
<DockerComposeProjectPath>../docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(RunConfiguration)' == 'O2NextGen.CertificateManagement.Web' " />
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0">
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1">
</PackageReference>
<PackageReference Include="Serilog.Settings.Configuration" Version="2.2.0">
</PackageReference>
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0">
</PackageReference>
<PackageReference Include="Serilog.Sinks.Console" Version="2.1.0">
</PackageReference>
<PackageReference Include="Serilog.Sinks.File" Version="2.2.0">
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.31" />

<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.11" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -59,9 +49,19 @@
<ItemGroup>
<None Remove="Logs\**" />
<None Remove="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
<None Remove="Serilog.AspNetCore" />
<None Remove="Serilog.Sinks.File" />
<None Remove="Serilog.Sinks.Console" />
<None Remove="Serilog.Sinks.Async" />
<None Remove="Newtonsoft.Json" />
<None Remove="Swashbuckle.AspNetCore" />
</ItemGroup>

<ItemGroup>
<Content Remove="Logs\**" />
<Content Remove="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\launchSettings.json" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
{
"profiles": {
"O2NextGen.CertificateManagement.Web": {
"O2NextGen.CertificateManagement.Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:10002;http://localhost:5002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"environmentVariables": {}
},
"O2NextGen.CertificateManagement.Api": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:8166;http://localhost:59600",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
using O2NextGen.CertificateManagement.Api.Helpers;
using O2NextGen.CertificateManagement.Api.IoC;
using Swashbuckle.AspNetCore.Swagger;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;

[assembly: ApiController]
namespace O2NextGen.CertificateManagement.Api
{
public class Startup
{
public IHostingEnvironment HostingEnvironment { get; private set; }
public IWebHostEnvironment HostingEnvironment { get; private set; }
public IConfiguration AppConfiguration { get; private set; }

public Startup(IConfiguration appConfiguration, IHostingEnvironment env)
public Startup(IConfiguration appConfiguration, IWebHostEnvironment env)
{
this.HostingEnvironment = env;
this.AppConfiguration = appConfiguration;
Expand All @@ -31,20 +33,20 @@ public void ConfigureServices(IServiceCollection services)
services.AddBusiness();
services.AddSwaggerGen(options =>
{
options.DescribeAllEnumsAsStrings();
options.SwaggerDoc("v1",new Info()
options.DescribeAllParametersInCamelCase();
options.SwaggerDoc("v1",new OpenApiInfo()
{
Title = "O2NextGen Platform. C-Gen HTTP API",
Version = "v1",
Description = "C-Gen API Service. The service allows you to create certificates",
TermsOfService = "Terms of Service"
//TermsOfService = "Terms of Service"
});
});
services.AddConfigEf(AppConfiguration);
services.ConfigurePOCO<UrlsConfig>(AppConfiguration.GetSection("Urls"));
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ConnectionString": "Server=localhost;Initial Catalog=O2NextGen.CertificateDb;Persist Security Info=False;User ID=sa;Password=your@Password;Connection Timeout=30;",
"ConnectionString": "Server=20.112.192.201;Initial Catalog=O2NextGen.CertificateDb;Persist Security Info=False;User ID=sa;Password=yourStrong(!)Password;Connection Timeout=30;",
"Urls": {
"Auth": "http://localhost:10001"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void ConfigureCertificateEntity(EntityTypeBuilder<CertificateEntity> bui

builder.Property(ci => ci.Id)
.HasColumnType("bigint")
.ForSqlServerUseSequenceHiLo("certificate_hilo")
.UseHiLo("certificate_hilo")
.IsRequired();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.1">
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1">
</PackageReference>
<None Remove="Microsoft.EntityFrameworkCore" />
<None Remove="Microsoft.EntityFrameworkCore.SqlServer" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Services/c-gen/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
image: ${DOCKER_REGISTRY-}o2nextgencertificatemanagement
build:
context: .
dockerfile: O2NextGen.CertificateManagement.Api/Dockerfile
dockerfile: Dockerfile