Compare commits
No commits in common. "d996fd025489383bce58976a00f8419eb63a1f96" and "c963c4d9e979a021137d9e92cfd16edf64cafccc" have entirely different histories.
d996fd0254
...
c963c4d9e9
5 changed files with 1 additions and 37 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,7 +2,6 @@
|
||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
publish/
|
publish/
|
||||||
*.zip
|
|
||||||
|
|
||||||
# Skripte aus publish/ im Root behalten
|
# Skripte aus publish/ im Root behalten
|
||||||
!install-service.ps1
|
!install-service.ps1
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SelfContained>true</SelfContained>
|
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
||||||
<!-- Version aus Git-Tag lesen: git tag v1.2.3 → Version 1.2.3 -->
|
<!-- Version aus Git-Tag lesen: git tag v1.2.3 → Version 1.2.3 -->
|
||||||
<GitVersion Condition="'$(GitVersion)' == ''">$([System.String]::Copy('1.0.0'))</GitVersion>
|
<GitVersion Condition="'$(GitVersion)' == ''">$([System.String]::Copy('1.0.0'))</GitVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,6 @@
|
||||||
<RootNamespace>MailPrint</RootNamespace>
|
<RootNamespace>MailPrint</RootNamespace>
|
||||||
<AssemblyName>MailPrint</AssemblyName>
|
<AssemblyName>MailPrint</AssemblyName>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<SelfContained>true</SelfContained>
|
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
|
||||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -51,34 +51,7 @@ try
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen(c =>
|
builder.Services.AddSwaggerGen(c =>
|
||||||
{
|
c.SwaggerDoc("v1", new() { Title = "MailPrint API", Version = "v1" }));
|
||||||
c.SwaggerDoc("v1", new() { Title = "MailPrint API", Version = "v1" });
|
|
||||||
|
|
||||||
// XML-Doku aus /// Kommentaren in OpenAPI uebernehmen
|
|
||||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, "MailPrint.xml");
|
|
||||||
if (File.Exists(xmlPath))
|
|
||||||
c.IncludeXmlComments(xmlPath);
|
|
||||||
|
|
||||||
// API-Key-Security im Schema dokumentieren -> generierte Clients
|
|
||||||
// setzen den Header automatisch, Swagger UI hat Authorize-Button
|
|
||||||
var scheme = new Microsoft.OpenApi.Models.OpenApiSecurityScheme
|
|
||||||
{
|
|
||||||
Name = "X-Api-Key",
|
|
||||||
Type = Microsoft.OpenApi.Models.SecuritySchemeType.ApiKey,
|
|
||||||
In = Microsoft.OpenApi.Models.ParameterLocation.Header,
|
|
||||||
Description = "API-Key fuer alle /api/* Endpunkte. Konfiguriert in MailPrintConfig.",
|
|
||||||
Reference = new Microsoft.OpenApi.Models.OpenApiReference
|
|
||||||
{
|
|
||||||
Type = Microsoft.OpenApi.Models.ReferenceType.SecurityScheme,
|
|
||||||
Id = "ApiKey"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
c.AddSecurityDefinition("ApiKey", scheme);
|
|
||||||
c.AddSecurityRequirement(new Microsoft.OpenApi.Models.OpenApiSecurityRequirement
|
|
||||||
{
|
|
||||||
[scheme] = Array.Empty<string>()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<RootNamespace>MailPrintConfig</RootNamespace>
|
<RootNamespace>MailPrintConfig</RootNamespace>
|
||||||
<AssemblyName>MailPrintConfig</AssemblyName>
|
<AssemblyName>MailPrintConfig</AssemblyName>
|
||||||
<SelfContained>true</SelfContained>
|
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue