Compare commits
2 Commits
f060641e97
...
802624e7ea
| Author | SHA1 | Date | |
|---|---|---|---|
| 802624e7ea | |||
| b2bccc34f5 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -264,4 +264,5 @@ src/KonSoft.Admin.Blazor.Server.Tiered/Logs/*
|
|||||||
# Use abp install-libs to restore.
|
# Use abp install-libs to restore.
|
||||||
**/wwwroot/libs/*
|
**/wwwroot/libs/*
|
||||||
|
|
||||||
**/Logs/*
|
**/Logs/*
|
||||||
|
**/logs.txt
|
||||||
@ -25,6 +25,8 @@ namespace KonSoft.InternalGateway.Extensions
|
|||||||
.Select(t => t.First())
|
.Select(t => t.First())
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
var gatewayUrl = configuration["GatewayUrl"];
|
||||||
|
|
||||||
foreach (var clusterGroup in groupedClusters)
|
foreach (var clusterGroup in groupedClusters)
|
||||||
{
|
{
|
||||||
var routeConfig = yarpConfig.Routes.FirstOrDefault(q =>
|
var routeConfig = yarpConfig.Routes.FirstOrDefault(q =>
|
||||||
@ -36,7 +38,7 @@ namespace KonSoft.InternalGateway.Extensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API");
|
// options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API");
|
||||||
options.SwaggerEndpoint(new Uri(new Uri(clusterGroup.Value.Address), "/swagger/v1/swagger.json").AbsoluteUri, $"{routeConfig.RouteId} API");
|
options.SwaggerEndpoint(new Uri(new Uri(!string.IsNullOrWhiteSpace(gatewayUrl)? gatewayUrl: clusterGroup.Value.Address), "/swagger/v1/swagger.json").AbsoluteUri, $"{routeConfig.RouteId} API");
|
||||||
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
|
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
|
||||||
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
|
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ using KonSoft.InternalGateway;
|
|||||||
using KonSoft.InternalGateway.Extensions;
|
using KonSoft.InternalGateway.Extensions;
|
||||||
using KonSoft.Shared.Hosting.AspNetCore;
|
using KonSoft.Shared.Hosting.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Rewrite;
|
using Microsoft.AspNetCore.Rewrite;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
@ -21,7 +22,11 @@ try
|
|||||||
.UseAutofac()
|
.UseAutofac()
|
||||||
.UseSerilog();
|
.UseSerilog();
|
||||||
|
|
||||||
builder.Services.AddSwaggerGen(options =>
|
builder.Services.AddAbpSwaggerGenWithOAuth(builder.Configuration["AuthServer:Authority"]!,
|
||||||
|
new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "Clean", "Clean API" }
|
||||||
|
}, options =>
|
||||||
{
|
{
|
||||||
options.SwaggerDoc("v1", new OpenApiInfo
|
options.SwaggerDoc("v1", new OpenApiInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,5 +4,10 @@
|
|||||||
"name": "KonSoft.InternalGateway",
|
"name": "KonSoft.InternalGateway",
|
||||||
"nodes": "https://config.konsoft.top/",
|
"nodes": "https://config.konsoft.top/",
|
||||||
"secret": "DBE31703-14F9-4B01-893D-900B8380CE04"
|
"secret": "DBE31703-14F9-4B01-893D-900B8380CE04"
|
||||||
|
},
|
||||||
|
"AuthServer": {
|
||||||
|
"Authority": "https://localhost:44322",
|
||||||
|
"RequireHttpsMetadata": true,
|
||||||
|
"SwaggerClientId": "Gateway_Swagger"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user