tenant fixes
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using StellaOps.Remediation.Core.Abstractions;
|
||||
using StellaOps.Remediation.WebService.Contracts;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Remediation.WebService.Endpoints;
|
||||
|
||||
@@ -12,7 +13,8 @@ public static class RemediationMatchEndpoints
|
||||
public static IEndpointRouteBuilder MapRemediationMatchEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var match = app.MapGroup("/api/v1/remediation/match")
|
||||
.WithTags("Remediation");
|
||||
.WithTags("Remediation")
|
||||
.RequireTenant();
|
||||
|
||||
match.MapGet(string.Empty, async Task<IResult>(
|
||||
IRemediationMatcher matcher,
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Routing;
|
||||
using StellaOps.Remediation.Core.Abstractions;
|
||||
using StellaOps.Remediation.Core.Models;
|
||||
using StellaOps.Remediation.WebService.Contracts;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Remediation.WebService.Endpoints;
|
||||
|
||||
@@ -16,7 +17,8 @@ public static class RemediationRegistryEndpoints
|
||||
public static IEndpointRouteBuilder MapRemediationRegistryEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var templates = app.MapGroup("/api/v1/remediation/templates")
|
||||
.WithTags("Remediation");
|
||||
.WithTags("Remediation")
|
||||
.RequireTenant();
|
||||
|
||||
templates.MapGet(string.Empty, async Task<IResult>(
|
||||
IRemediationRegistry registry,
|
||||
@@ -69,7 +71,8 @@ public static class RemediationRegistryEndpoints
|
||||
.RequireAuthorization("remediation.submit");
|
||||
|
||||
var submissions = app.MapGroup("/api/v1/remediation/submissions")
|
||||
.WithTags("Remediation");
|
||||
.WithTags("Remediation")
|
||||
.RequireTenant();
|
||||
|
||||
submissions.MapGet(string.Empty, async Task<IResult>(
|
||||
IRemediationRegistry registry,
|
||||
@@ -136,7 +139,8 @@ public static class RemediationRegistryEndpoints
|
||||
.RequireAuthorization("remediation.read");
|
||||
|
||||
var contributors = app.MapGroup("/api/v1/remediation/contributors")
|
||||
.WithTags("Remediation");
|
||||
.WithTags("Remediation")
|
||||
.RequireTenant();
|
||||
|
||||
contributors.MapGet(string.Empty, () =>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Remediation.WebService.Endpoints;
|
||||
|
||||
@@ -9,7 +10,8 @@ public static class RemediationSourceEndpoints
|
||||
public static IEndpointRouteBuilder MapRemediationSourceEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var sources = app.MapGroup("/api/v1/remediation/sources")
|
||||
.WithTags("Remediation");
|
||||
.WithTags("Remediation")
|
||||
.RequireTenant();
|
||||
|
||||
sources.MapGet(string.Empty, () =>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using StellaOps.Remediation.Core.Abstractions;
|
||||
using StellaOps.Remediation.Core.Services;
|
||||
using StellaOps.Remediation.Persistence.Repositories;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
using StellaOps.Remediation.WebService.Endpoints;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -15,6 +16,7 @@ builder.Services.AddAuthorization(options =>
|
||||
options.AddPolicy("remediation.manage", policy => policy.RequireAssertion(_ => true));
|
||||
});
|
||||
builder.Services.AddAuthentication();
|
||||
builder.Services.AddStellaOpsTenantServices();
|
||||
|
||||
// Core services
|
||||
builder.Services.AddSingleton<IContributorTrustScorer, ContributorTrustScorer>();
|
||||
@@ -38,6 +40,7 @@ var app = builder.Build();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.UseStellaOpsTenantMiddleware();
|
||||
|
||||
app.MapHealthChecks("/healthz").AllowAnonymous();
|
||||
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.Remediation.Core\StellaOps.Remediation.Core.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Remediation.Persistence\StellaOps.Remediation.Persistence.csproj" />
|
||||
<ProjectReference Include="..\..\Authority\StellaOps.Authority\StellaOps.Auth.ServerIntegration\StellaOps.Auth.ServerIntegration.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user