Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • coscine/backend/apis/rdmstandardswrapper
1 result
Select Git revision
Loading items
Show changes
Commits on Source (2)
......@@ -43,25 +43,25 @@ namespace RdmStandardsWrapper.Controllers
[HttpPut("{*path}")]
public async Task Put(string? path)
{
await ForwardRequestAsync(HttpMethod.Put, path);
await Task.Run(() => Response.StatusCode = 403);
}
[HttpPost("{*path}")]
public async Task Post(string? path)
{
await ForwardRequestAsync(HttpMethod.Post, path);
await Task.Run(() => Response.StatusCode = 403);
}
[HttpPatch("{*path}")]
public async Task Patch(string? path)
{
await ForwardRequestAsync(HttpMethod.Patch, path);
await Task.Run(() => Response.StatusCode = 403);
}
[HttpDelete("{*path}")]
public async Task Delete(string? path)
{
await ForwardRequestAsync(HttpMethod.Delete, path);
await Task.Run(() => Response.StatusCode = 403);
}
[HttpOptions("{*path}")]
......@@ -72,10 +72,7 @@ namespace RdmStandardsWrapper.Controllers
private async Task ForwardRequestAsync(HttpMethod method, string? path)
{
if (path == null)
{
path = "";
}
path ??= "";
var pathSplit = path.Split('/');
var identiferPart = "";
......
using Swashbuckle.AspNetCore.Swagger;
using NSwag;
using NSwag.Generation.Processors.Security;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOpenApiDocument((settings) =>
{
settings.Title = "RDM Standards Wrapper";
settings.Version = "1.0.0";
settings.OperationProcessors.Add(new OperationSecurityScopeProcessor("JWT token"));
settings.DocumentProcessors.Add(new SecurityDefinitionAppender("JWT token", new OpenApiSecurityScheme
{
Type = OpenApiSecuritySchemeType.ApiKey,
Name = "Authorization",
Description = "Copy 'Bearer ' + valid JWT token into field",
In = OpenApiSecurityApiKeyLocation.Header
}));
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
//if (app.Environment.IsDevelopment())
//{
app.UseOpenApi(config =>
{
app.UseSwagger((SwaggerOptions options) =>
if (!app.Environment.IsDevelopment())
{
});
app.UseSwaggerUI();
config.PostProcess = (document, _) => document.Schemes = new[] { OpenApiSchema.Https };
}
}); // serve OpenAPI/Swagger documents
app.UseSwaggerUi3(); // serve Swagger UI
app.UseReDoc(); // serve ReDoc UI
//}
app.UseHttpsRedirection();
......
......@@ -6,20 +6,20 @@
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>56347797-1954-4583-a8c8-261b422aae46</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>1.0.0</Version></PropertyGroup>
<Version>1.0.1</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.ApiCommons" Version="2.2.2" />
<PackageReference Include="Coscine.JwtHandler" Version="2.2.0" />
<PackageReference Include="Coscine.Metadata" Version="2.4.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.7">
<PackageReference Include="Coscine.Metadata" Version="2.6.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.7" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.12" />
<PackageReference Include="NSwag.AspNetCore" Version="13.18.2" />
</ItemGroup>
</Project>