This commit is contained in:
2026-05-05 10:58:43 +02:00
parent 4fe072d837
commit 1ac93dae8d
17 changed files with 112 additions and 28 deletions
+7 -4
View File
@@ -1,6 +1,7 @@
using Knots; using Knots;
using FastEndpoints; using FastEndpoints;
using FastEndpoints.Swagger; using FastEndpoints.Swagger;
using Microsoft.OpenApi;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
@@ -12,23 +13,27 @@ builder.Services.AddCors(options =>
{ options.AddDefaultPolicy(policyBuilder => { options.AddDefaultPolicy(policyBuilder =>
{ {
policyBuilder policyBuilder
.WithOrigins("http://localhost:5250") .WithOrigins("http://localhost:5250/swagger")
.WithMethods("GET", "POST", "PUT", "PATCH", "DELETE") .WithMethods("GET", "POST", "PUT", "PATCH", "DELETE")
.AllowAnyHeader(); .AllowAnyHeader();
}); });
}); });
builder.Services.AddAutoMapper(cfg => { }, typeof(Program).Assembly);
builder.Services.AddFastEndpoints(); builder.Services.AddFastEndpoints();
builder.Services.SwaggerDocument();
builder.Services.AddAuthentication(); builder.Services.AddAuthentication();
builder.Services.AddAuthorization(); builder.Services.AddAuthorization();
builder.Services.AddAutoMapper(cfg => { }, typeof(Program).Assembly);
// On construit l'application en lui donnant vie // On construit l'application en lui donnant vie
WebApplication app = builder.Build(); WebApplication app = builder.Build();
app.UseCors(); app.UseCors();
app.UseSwaggerGen();
app.UseAuthentication() app.UseAuthentication()
.UseAuthorization() .UseAuthorization()
.UseFastEndpoints(options => .UseFastEndpoints(options =>
@@ -40,6 +45,4 @@ app.UseAuthentication()
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseCors();
app.Run(); app.Run();
+97 -19
View File
@@ -14,7 +14,8 @@
"Microsoft.AspNetCore.OpenApi": "8.0.25", "Microsoft.AspNetCore.OpenApi": "8.0.25",
"Microsoft.EntityFrameworkCore": "8.0.25", "Microsoft.EntityFrameworkCore": "8.0.25",
"Microsoft.EntityFrameworkCore.Design": "8.0.25", "Microsoft.EntityFrameworkCore.Design": "8.0.25",
"Microsoft.EntityFrameworkCore.SqlServer": "8.0.25" "Microsoft.EntityFrameworkCore.SqlServer": "8.0.25",
"Swashbuckle.AspNetCore": "10.1.7"
}, },
"runtime": { "runtime": {
"Knots.dll": {} "Knots.dll": {}
@@ -41,7 +42,7 @@
"System.Memory.Data": "1.0.2", "System.Memory.Data": "1.0.2",
"System.Numerics.Vectors": "4.5.0", "System.Numerics.Vectors": "4.5.0",
"System.Text.Encodings.Web": "8.0.0", "System.Text.Encodings.Web": "8.0.0",
"System.Text.Json": "4.7.2", "System.Text.Json": "8.0.5",
"System.Threading.Tasks.Extensions": "4.5.4" "System.Threading.Tasks.Extensions": "4.5.4"
}, },
"runtime": { "runtime": {
@@ -58,7 +59,7 @@
"Microsoft.Identity.Client.Extensions.Msal": "4.61.3", "Microsoft.Identity.Client.Extensions.Msal": "4.61.3",
"System.Memory": "4.5.4", "System.Memory": "4.5.4",
"System.Security.Cryptography.ProtectedData": "6.0.0", "System.Security.Cryptography.ProtectedData": "6.0.0",
"System.Text.Json": "4.7.2", "System.Text.Json": "8.0.5",
"System.Threading.Tasks.Extensions": "4.5.4" "System.Threading.Tasks.Extensions": "4.5.4"
}, },
"runtime": { "runtime": {
@@ -180,7 +181,7 @@
}, },
"Microsoft.AspNetCore.OpenApi/8.0.25": { "Microsoft.AspNetCore.OpenApi/8.0.25": {
"dependencies": { "dependencies": {
"Microsoft.OpenApi": "1.4.3" "Microsoft.OpenApi": "2.4.1"
}, },
"runtime": { "runtime": {
"lib/net8.0/Microsoft.AspNetCore.OpenApi.dll": { "lib/net8.0/Microsoft.AspNetCore.OpenApi.dll": {
@@ -542,6 +543,7 @@
} }
} }
}, },
"Microsoft.Extensions.ApiDescription.Server/8.0.0": {},
"Microsoft.Extensions.Caching.Abstractions/8.0.0": { "Microsoft.Extensions.Caching.Abstractions/8.0.0": {
"dependencies": { "dependencies": {
"Microsoft.Extensions.Primitives": "10.0.3" "Microsoft.Extensions.Primitives": "10.0.3"
@@ -774,11 +776,14 @@
} }
} }
}, },
"Microsoft.OpenApi/1.4.3": { "Microsoft.OpenApi/2.4.1": {
"dependencies": {
"System.Text.Json": "8.0.5"
},
"runtime": { "runtime": {
"lib/netstandard2.0/Microsoft.OpenApi.dll": { "lib/net8.0/Microsoft.OpenApi.dll": {
"assemblyVersion": "1.4.3.0", "assemblyVersion": "2.4.1.0",
"fileVersion": "1.4.3.0" "fileVersion": "2.4.1.0"
} }
} }
}, },
@@ -962,10 +967,48 @@
} }
} }
}, },
"Swashbuckle.AspNetCore/10.1.7": {
"dependencies": {
"Microsoft.Extensions.ApiDescription.Server": "8.0.0",
"Swashbuckle.AspNetCore.Swagger": "10.1.7",
"Swashbuckle.AspNetCore.SwaggerGen": "10.1.7",
"Swashbuckle.AspNetCore.SwaggerUI": "10.1.7"
}
},
"Swashbuckle.AspNetCore.Swagger/10.1.7": {
"dependencies": {
"Microsoft.OpenApi": "2.4.1"
},
"runtime": {
"lib/net8.0/Swashbuckle.AspNetCore.Swagger.dll": {
"assemblyVersion": "10.1.7.0",
"fileVersion": "10.1.7.2427"
}
}
},
"Swashbuckle.AspNetCore.SwaggerGen/10.1.7": {
"dependencies": {
"Swashbuckle.AspNetCore.Swagger": "10.1.7"
},
"runtime": {
"lib/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll": {
"assemblyVersion": "10.1.7.0",
"fileVersion": "10.1.7.2427"
}
}
},
"Swashbuckle.AspNetCore.SwaggerUI/10.1.7": {
"runtime": {
"lib/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll": {
"assemblyVersion": "10.1.7.0",
"fileVersion": "10.1.7.2427"
}
}
},
"System.ClientModel/1.0.0": { "System.ClientModel/1.0.0": {
"dependencies": { "dependencies": {
"System.Memory.Data": "1.0.2", "System.Memory.Data": "1.0.2",
"System.Text.Json": "4.7.2" "System.Text.Json": "8.0.5"
}, },
"runtime": { "runtime": {
"lib/net6.0/System.ClientModel.dll": { "lib/net6.0/System.ClientModel.dll": {
@@ -1110,7 +1153,7 @@
"System.Memory.Data/1.0.2": { "System.Memory.Data/1.0.2": {
"dependencies": { "dependencies": {
"System.Text.Encodings.Web": "8.0.0", "System.Text.Encodings.Web": "8.0.0",
"System.Text.Json": "4.7.2" "System.Text.Json": "8.0.5"
}, },
"runtime": { "runtime": {
"lib/netstandard2.0/System.Memory.Data.dll": { "lib/netstandard2.0/System.Memory.Data.dll": {
@@ -1186,7 +1229,7 @@
} }
}, },
"System.Text.Encodings.Web/8.0.0": {}, "System.Text.Encodings.Web/8.0.0": {},
"System.Text.Json/4.7.2": {}, "System.Text.Json/8.0.5": {},
"System.Threading.Channels/6.0.0": {}, "System.Threading.Channels/6.0.0": {},
"System.Threading.Tasks.Extensions/4.5.4": {}, "System.Threading.Tasks.Extensions/4.5.4": {},
"System.Windows.Extensions/6.0.0": { "System.Windows.Extensions/6.0.0": {
@@ -1427,6 +1470,13 @@
"path": "microsoft.entityframeworkcore.sqlserver/8.0.25", "path": "microsoft.entityframeworkcore.sqlserver/8.0.25",
"hashPath": "microsoft.entityframeworkcore.sqlserver.8.0.25.nupkg.sha512" "hashPath": "microsoft.entityframeworkcore.sqlserver.8.0.25.nupkg.sha512"
}, },
"Microsoft.Extensions.ApiDescription.Server/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-jDM3a95WerM8g6IcMiBXq1qRS9dqmEUpgnCk2DeMWpPkYtp1ia+CkXabOnK93JmhVlUmv8l9WMPsCSUm+WqkIA==",
"path": "microsoft.extensions.apidescription.server/8.0.0",
"hashPath": "microsoft.extensions.apidescription.server.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Caching.Abstractions/8.0.0": { "Microsoft.Extensions.Caching.Abstractions/8.0.0": {
"type": "package", "type": "package",
"serviceable": true, "serviceable": true,
@@ -1574,12 +1624,12 @@
"path": "microsoft.identitymodel.tokens/8.14.0", "path": "microsoft.identitymodel.tokens/8.14.0",
"hashPath": "microsoft.identitymodel.tokens.8.14.0.nupkg.sha512" "hashPath": "microsoft.identitymodel.tokens.8.14.0.nupkg.sha512"
}, },
"Microsoft.OpenApi/1.4.3": { "Microsoft.OpenApi/2.4.1": {
"type": "package", "type": "package",
"serviceable": true, "serviceable": true,
"sha512": "sha512-rURwggB+QZYcSVbDr7HSdhw/FELvMlriW10OeOzjPT7pstefMo7IThhtNtDudxbXhW+lj0NfX72Ka5EDsG8x6w==", "sha512": "sha512-u7QhXCISMQuab3flasb1hoaiERmUqyWsW7tmQODyILoQ7mJV5IRGM+2KKZYo0QUfC13evEOcHAb6TPWgqEQtrw==",
"path": "microsoft.openapi/1.4.3", "path": "microsoft.openapi/2.4.1",
"hashPath": "microsoft.openapi.1.4.3.nupkg.sha512" "hashPath": "microsoft.openapi.2.4.1.nupkg.sha512"
}, },
"Microsoft.SqlServer.Server/1.0.0": { "Microsoft.SqlServer.Server/1.0.0": {
"type": "package", "type": "package",
@@ -1686,6 +1736,34 @@
"path": "nswag.generation.aspnetcore/14.6.3", "path": "nswag.generation.aspnetcore/14.6.3",
"hashPath": "nswag.generation.aspnetcore.14.6.3.nupkg.sha512" "hashPath": "nswag.generation.aspnetcore.14.6.3.nupkg.sha512"
}, },
"Swashbuckle.AspNetCore/10.1.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-vgef8DPT411JU5JjHiDbr0WOxsIVuAvegPGtqmm4Na4JRl/264dfBJcGkiPHsAr5P+Vda+qN1rZKRtBl1rF9aA==",
"path": "swashbuckle.aspnetcore/10.1.7",
"hashPath": "swashbuckle.aspnetcore.10.1.7.nupkg.sha512"
},
"Swashbuckle.AspNetCore.Swagger/10.1.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-EjLibt/d/QuRv170GoihTbcPUpgzSFm2WKHhnGJFZQ03JYzfuitsM79azaAR8NBwRunU7yScSX6HRE5JUlrEMQ==",
"path": "swashbuckle.aspnetcore.swagger/10.1.7",
"hashPath": "swashbuckle.aspnetcore.swagger.10.1.7.nupkg.sha512"
},
"Swashbuckle.AspNetCore.SwaggerGen/10.1.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-PuubO9BjvNn6U3D9kLpuWKY1JtziWw7SsGBq0age1E50uQjQ8Fzl8s0EwzrLfANqYJNgDnJi9l7N1QxcGVB2Zw==",
"path": "swashbuckle.aspnetcore.swaggergen/10.1.7",
"hashPath": "swashbuckle.aspnetcore.swaggergen.10.1.7.nupkg.sha512"
},
"Swashbuckle.AspNetCore.SwaggerUI/10.1.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-iJo3ODyUb/M8Vm8AH1r9y9iAba0w95xsCn3zFVl96ISRHbTDWxi+l7oFVCZqUEdjd97B8VMDPnMliWAdomR8uw==",
"path": "swashbuckle.aspnetcore.swaggerui/10.1.7",
"hashPath": "swashbuckle.aspnetcore.swaggerui.10.1.7.nupkg.sha512"
},
"System.ClientModel/1.0.0": { "System.ClientModel/1.0.0": {
"type": "package", "type": "package",
"serviceable": true, "serviceable": true,
@@ -1882,12 +1960,12 @@
"path": "system.text.encodings.web/8.0.0", "path": "system.text.encodings.web/8.0.0",
"hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512" "hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512"
}, },
"System.Text.Json/4.7.2": { "System.Text.Json/8.0.5": {
"type": "package", "type": "package",
"serviceable": true, "serviceable": true,
"sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", "sha512": "sha512-0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
"path": "system.text.json/4.7.2", "path": "system.text.json/8.0.5",
"hashPath": "system.text.json.4.7.2.nupkg.sha512" "hashPath": "system.text.json.8.0.5.nupkg.sha512"
}, },
"System.Threading.Channels/6.0.0": { "System.Threading.Channels/6.0.0": {
"type": "package", "type": "package",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Knots")] [assembly: System.Reflection.AssemblyCompanyAttribute("Knots")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c6914f401ccc044276844a616faf4eab3ed4e706")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4b4609e13be85d17843b2b64e6dac351bdf487bd")]
[assembly: System.Reflection.AssemblyProductAttribute("Knots")] [assembly: System.Reflection.AssemblyProductAttribute("Knots")]
[assembly: System.Reflection.AssemblyTitleAttribute("Knots")] [assembly: System.Reflection.AssemblyTitleAttribute("Knots")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
bfbdc003ba7092f8bfb2662d1caeb4e417330406c68574a615ad62a4b78ca32e c139ae2436615f82d1172564030b16c07e4097b8ade986b6c3e2a3ab0601f7c7
@@ -1 +1 @@
48f22ff764b6fb55ab707d3173f08b77b56e040a0fb550a321d3513cebce58eb 3e4597637442b46b0be206679a34e6ba21c254305e06275850330213f4a53f34
@@ -167,3 +167,6 @@
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/obj/Debug/net8.0/Knots.genruntimeconfig.cache /home/carteronm@stsio.lan/RiderProjects/Knots/Knots/obj/Debug/net8.0/Knots.genruntimeconfig.cache
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/obj/Debug/net8.0/ref/Knots.dll /home/carteronm@stsio.lan/RiderProjects/Knots/Knots/obj/Debug/net8.0/ref/Knots.dll
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/bin/Debug/net8.0/AutoMapper.dll /home/carteronm@stsio.lan/RiderProjects/Knots/Knots/bin/Debug/net8.0/AutoMapper.dll
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/bin/Debug/net8.0/Swashbuckle.AspNetCore.Swagger.dll
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/bin/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll
/home/carteronm@stsio.lan/RiderProjects/Knots/Knots/bin/Debug/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
17779732663562446 17779706991543275
+1 -1
View File
@@ -1 +1 @@
17779733015682447 17779706998783275