Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move Organizations Authorize attributes to endpoint instead of c… #1584

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ services:
localstack:
image: localstack/localstack
container_name: localstack
restart: always
ports:
- 4566:4566
- 4510-4559:4510-4559
Expand Down Expand Up @@ -68,7 +67,6 @@ services:
seq:
image: datalust/seq:latest
container_name: seq
restart: always
ports:
- 5341:80
environment:
Expand All @@ -79,7 +77,6 @@ services:
kafka:
image: confluentinc/cp-kafka:7.0.1
container_name: kafka
restart: always
ports:
- 9092:9092
depends_on:
Expand All @@ -96,15 +93,13 @@ services:
kafka-admin:
image: confluentinc/cp-zookeeper:7.0.1
container_name: kafka-admin
restart: always
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

postgresql:
build: ./postgresql
container_name: postgresql
restart: always
environment:
POSTGRES_USER: sa
POSTGRES_PASSWORD: E@syP@ssw0rd
Expand All @@ -114,7 +109,6 @@ services:
postgresql-admin:
image: adminer
container_name: postgresql-admin
restart: always
ports:
- 8081:8080

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ namespace RoadRegistry.BackOffice.Api.Infrastructure.Authentication;
using Configuration;
using Controllers.Attributes;
using IdentityModel.AspNetCore.OAuth2Introspection;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ namespace RoadRegistry.BackOffice.Api.Organizations;

using System.Threading;
using System.Threading.Tasks;
using Be.Vlaanderen.Basisregisters.Auth.AcmIdm;
using FluentValidation;
using Framework;
using Infrastructure.Authentication;
using Messages;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;

Expand All @@ -24,6 +27,7 @@ public partial class OrganizationsController
/// </param>
/// <returns>IActionResult.</returns>
[HttpPatch(ChangeRoute, Name = nameof(Change))]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.AllSchemes, Policy = PolicyNames.WegenUitzonderingen.Beheerder)]
[SwaggerOperation(OperationId = nameof(Change), Description = "")]
public async Task<IActionResult> Change(
[FromBody] OrganizationChangeParameters parameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace RoadRegistry.BackOffice.Api.Organizations;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading;
using System.Threading.Tasks;
using Be.Vlaanderen.Basisregisters.Auth.AcmIdm;
using Infrastructure.Authentication;
using Microsoft.AspNetCore.Authorization;

public partial class OrganizationsController
{
Expand All @@ -23,6 +26,7 @@ public partial class OrganizationsController
/// </param>
/// <returns>IActionResult.</returns>
[HttpPost(CreateRoute, Name = nameof(Create))]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.AllSchemes, Policy = PolicyNames.WegenUitzonderingen.Beheerder)]
[SwaggerOperation(OperationId = nameof(Create), Description = "")]
public async Task<IActionResult> Create(
[FromBody] OrganizationCreateParameters parameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace RoadRegistry.BackOffice.Api.Organizations;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading;
using System.Threading.Tasks;
using Be.Vlaanderen.Basisregisters.Auth.AcmIdm;
using Infrastructure.Authentication;
using Microsoft.AspNetCore.Authorization;

public partial class OrganizationsController
{
Expand All @@ -23,6 +26,7 @@ public partial class OrganizationsController
/// </param>
/// <returns>IActionResult.</returns>
[HttpDelete(DeleteRoute, Name = nameof(Delete))]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.AllSchemes, Policy = PolicyNames.WegenUitzonderingen.Beheerder)]
[SwaggerOperation(OperationId = nameof(Delete), Description = "")]
public async Task<IActionResult> Delete(
[FromRoute] string id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public partial class OrganizationsController
/// </param>
/// <returns>IActionResult.</returns>
[HttpGet(GetRoute, Name = nameof(Get))]
[AllowAnonymous]
[ProducesResponseType(typeof(GetOrganizationsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(GetOrganizationsResponseResponseExamples))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace RoadRegistry.BackOffice.Api.Organizations;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading;
using System.Threading.Tasks;
using Be.Vlaanderen.Basisregisters.Auth.AcmIdm;
using Infrastructure.Authentication;
using Microsoft.AspNetCore.Authorization;

public partial class OrganizationsController
{
Expand All @@ -24,6 +27,7 @@ public partial class OrganizationsController
/// </param>
/// <returns>IActionResult.</returns>
[HttpPatch(RenameRoute, Name = nameof(Rename))]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.AllSchemes, Policy = PolicyNames.WegenUitzonderingen.Beheerder)]
[SwaggerOperation(OperationId = nameof(Rename), Description = "")]
public async Task<IActionResult> Rename(
[FromBody] OrganizationRenameParameters parameters,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
namespace RoadRegistry.BackOffice.Api.Organizations;

using Asp.Versioning;
using Be.Vlaanderen.Basisregisters.Auth.AcmIdm;
using Be.Vlaanderen.Basisregisters.Api;
using Infrastructure;
using Infrastructure.Authentication;
using Infrastructure.Controllers;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlStreamStore;

[ApiVersion(Version.Current)]
[AdvertiseApiVersions(Version.CurrentAdvertised)]
[ApiRoute("organizations")]
[ApiExplorerSettings(GroupName = "Organisaties")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.AllSchemes, Policy = PolicyNames.WegenUitzonderingen.Beheerder)]
public partial class OrganizationsController : BackofficeApiController
{
public OrganizationsController(
Expand Down
Loading