tenant fixes

This commit is contained in:
master
2026-02-23 23:44:50 +02:00
parent bdb1438654
commit 4f947a8b61
159 changed files with 1064 additions and 556 deletions

View File

@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
using StellaOps.Unknowns.Core.Models;
using StellaOps.Unknowns.Core.Repositories;
using StellaOps.Unknowns.WebService.Security;
using StellaOps.Auth.ServerIntegration.Tenancy;
namespace StellaOps.Unknowns.WebService.Endpoints;
@@ -24,7 +25,8 @@ public static class GreyQueueEndpoints
{
var group = routes.MapGroup("/api/grey-queue")
.WithTags("GreyQueue")
.RequireAuthorization(UnknownsPolicies.Read);
.RequireAuthorization(UnknownsPolicies.Read)
.RequireTenant();
// List and query
group.MapGet("/", ListEntries)

View File

@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc;
using StellaOps.Unknowns.Core.Models;
using StellaOps.Unknowns.Core.Repositories;
using StellaOps.Unknowns.WebService.Security;
using StellaOps.Auth.ServerIntegration.Tenancy;
namespace StellaOps.Unknowns.WebService.Endpoints;
@@ -25,7 +26,8 @@ public static class UnknownsEndpoints
{
var group = routes.MapGroup("/api/unknowns")
.WithTags("Unknowns")
.RequireAuthorization(UnknownsPolicies.Read);
.RequireAuthorization(UnknownsPolicies.Read)
.RequireTenant();
// WS-004: GET /api/unknowns - List with pagination
group.MapGet("/", ListUnknowns)

View File

@@ -7,6 +7,7 @@
using StellaOps.Auth.Abstractions;
using StellaOps.Auth.ServerIntegration;
using StellaOps.Auth.ServerIntegration.Tenancy;
using StellaOps.Router.AspNet;
using StellaOps.Unknowns.WebService;
using StellaOps.Unknowns.WebService.Endpoints;
@@ -27,6 +28,7 @@ builder.Services.AddHealthChecks()
// Authentication and authorization
builder.Services.AddStellaOpsResourceServerAuthentication(builder.Configuration);
builder.Services.AddStellaOpsTenantServices();
builder.Services.AddAuthorization(options =>
{
options.AddStellaOpsScopePolicy(UnknownsPolicies.Read, StellaOpsScopes.UnknownsRead);
@@ -55,6 +57,7 @@ if (app.Environment.IsDevelopment())
app.UseStellaOpsCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseStellaOpsTenantMiddleware();
app.TryUseStellaRouter(routerEnabled);
// Map endpoints