tenant fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user