Moved .RequireAuthentication() to endpoints, removed it from EndpointGroup
This commit is contained in:
@@ -23,6 +23,7 @@ public class ApproveDisbursementEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems()),
|
||||
})
|
||||
.WithDescription("Approve disbursement and release payment (M06)")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(ApproveDisbursementEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
@@ -24,6 +24,7 @@ public class CreateDisbursementEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems()),
|
||||
})
|
||||
.WithDescription("Create a new disbursement schedule (M06)")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(CreateDisbursementEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
@@ -24,6 +24,7 @@ public class CreateRiskEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Add risk to risk register (M09)")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(CreateRiskEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
@@ -24,6 +24,7 @@ public sealed class GetDisbursementEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Get a specific disbursement")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(GetDisbursementEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces<Disbursement>(StatusCodes.Status200OK)
|
||||
|
||||
@@ -22,6 +22,7 @@ public class GetDisbursementsEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Get a list of disbursements")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(GetDisbursementsEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces<Disbursement[]>(StatusCodes.Status200OK)
|
||||
|
||||
@@ -24,6 +24,7 @@ public sealed class GetRiskEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Get a specific risk")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(GetRiskEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces<Risk>(StatusCodes.Status200OK)
|
||||
|
||||
@@ -21,6 +21,7 @@ public class GetRisksEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Get a list of all risks")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(GetRisksEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
@@ -23,6 +23,7 @@ public sealed class UpdateDisbursementEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Update the details of a specific disbursement")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(UpdateDisbursementEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
@@ -23,6 +23,7 @@ public sealed class UpdateRiskEndpoint : IEndpoint
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
.WithDescription("Update the details of a specific risk")
|
||||
.RequireAuthorization(Constants.MainScope)
|
||||
.WithName(typeof(UpdateRiskEndpoint).ToEndpointName())
|
||||
.MapToApiVersion(new ApiVersion(1))
|
||||
.Produces(StatusCodes.Status200OK)
|
||||
|
||||
Reference in New Issue
Block a user