From d635313907c3c58d7a3c511e80c0d53b72ed5829 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 24 Apr 2021 22:37:20 +0300 Subject: [PATCH] authorize attribute for api --- src/api/NetworkResurrector.Api/Controllers/NetworkController.cs | 2 ++ src/api/NetworkResurrector.Api/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/NetworkResurrector.Api/Controllers/NetworkController.cs b/src/api/NetworkResurrector.Api/Controllers/NetworkController.cs index 93b31e1..aadda5d 100644 --- a/src/api/NetworkResurrector.Api/Controllers/NetworkController.cs +++ b/src/api/NetworkResurrector.Api/Controllers/NetworkController.cs @@ -1,4 +1,5 @@ using MediatR; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using NetworkResurrector.Api.Application.Queries; using System.Threading.Tasks; @@ -6,6 +7,7 @@ using System.Threading.Tasks; namespace NetworkResurrector.Api.Controllers { [ApiController] + [Authorize] [Route("network")] public class NetworkController : ControllerBase { diff --git a/src/api/NetworkResurrector.Api/Dockerfile b/src/api/NetworkResurrector.Api/Dockerfile index d4bc488..2a52bdf 100644 --- a/src/api/NetworkResurrector.Api/Dockerfile +++ b/src/api/NetworkResurrector.Api/Dockerfile @@ -27,7 +27,7 @@ COPY --from=publish /app/publish . ENV urls="http://*:80" ENV ConnectionStrings__DatabaseConnection="***REMOVED***" -ENV IdentityServer__BaseAddress="https://toodle.ddns.net/identity-server-api/" +ENV IdentityServer__BaseAddress="http://***REMOVED***/" #Workaround to lower the TLS level in container for old sql server version RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf