tenant fixes
This commit is contained in:
@@ -5,6 +5,7 @@ using StellaOps.Timeline.Core;
|
||||
using StellaOps.Timeline.Core.Export;
|
||||
using StellaOps.HybridLogicalClock;
|
||||
using StellaOps.Timeline.WebService.Security;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Timeline.WebService.Endpoints;
|
||||
|
||||
@@ -20,7 +21,8 @@ public static class ExportEndpoints
|
||||
{
|
||||
var group = app.MapGroup("/api/v1/timeline")
|
||||
.WithTags("Export")
|
||||
.RequireAuthorization(TimelinePolicies.Write);
|
||||
.RequireAuthorization(TimelinePolicies.Write)
|
||||
.RequireTenant();
|
||||
|
||||
group.MapPost("/{correlationId}/export", ExportTimelineAsync)
|
||||
.WithName("ExportTimeline")
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using StellaOps.HybridLogicalClock;
|
||||
using StellaOps.Timeline.Core.Replay;
|
||||
using StellaOps.Timeline.WebService.Security;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Timeline.WebService.Endpoints;
|
||||
|
||||
@@ -20,7 +21,8 @@ public static class ReplayEndpoints
|
||||
{
|
||||
var group = app.MapGroup("/api/v1/timeline")
|
||||
.WithTags("Replay")
|
||||
.RequireAuthorization(TimelinePolicies.Write);
|
||||
.RequireAuthorization(TimelinePolicies.Write)
|
||||
.RequireTenant();
|
||||
|
||||
group.MapPost("/{correlationId}/replay", InitiateReplayAsync)
|
||||
.WithName("InitiateReplay")
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using StellaOps.HybridLogicalClock;
|
||||
using StellaOps.Timeline.Core;
|
||||
using StellaOps.Timeline.WebService.Security;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.Timeline.WebService.Endpoints;
|
||||
|
||||
@@ -19,7 +20,8 @@ public static class TimelineEndpoints
|
||||
{
|
||||
var group = app.MapGroup("/api/v1/timeline")
|
||||
.WithTags("Timeline")
|
||||
.RequireAuthorization(TimelinePolicies.Read);
|
||||
.RequireAuthorization(TimelinePolicies.Read)
|
||||
.RequireTenant();
|
||||
|
||||
group.MapGet("/{correlationId}", GetTimelineAsync)
|
||||
.WithName("GetTimeline")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using StellaOps.Auth.Abstractions;
|
||||
using StellaOps.Auth.ServerIntegration;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
using StellaOps.Eventing;
|
||||
using StellaOps.Router.AspNet;
|
||||
using StellaOps.Timeline.Core;
|
||||
@@ -28,6 +29,7 @@ builder.Services.AddHealthChecks()
|
||||
|
||||
// Authentication and authorization
|
||||
builder.Services.AddStellaOpsResourceServerAuthentication(builder.Configuration);
|
||||
builder.Services.AddStellaOpsTenantServices();
|
||||
builder.Services.AddAuthorization(options =>
|
||||
{
|
||||
options.AddStellaOpsScopePolicy(TimelinePolicies.Read, StellaOpsScopes.TimelineRead);
|
||||
@@ -57,6 +59,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