Skip to content

Commit

Permalink
Remove read only mode (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Sep 19, 2023
1 parent c53eb91 commit 66712c2
Show file tree
Hide file tree
Showing 16 changed files with 3 additions and 94 deletions.

This file was deleted.

2 changes: 0 additions & 2 deletions TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public static void Main(string[] args)
options.Filters.Add(new CrmServiceProtectionFaultExceptionFilter());
options.Filters.Add(new DefaultErrorExceptionFilter(statusCode: StatusCodes.Status400BadRequest));
options.Filters.Add(new ValidationExceptionFilter());
options.Filters.Add(new ReadOnlyModeFilterFactory());

options.Conventions.Add(new ApiVersionConvention());
options.Conventions.Add(new AuthorizationPolicyConvention());
Expand Down Expand Up @@ -179,7 +178,6 @@ public static void Main(string[] args)
services.AddSingleton<ICurrentClientProvider, ClaimsPrincipalCurrentClientProvider>();
services.AddSingleton<IClock, Clock>();
services.AddMemoryCache();
services.AddSingleton<ReadOnlyModeFilter>();

services.AddHttpClient("EvidenceFiles", client =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.Infrastructure.Logging;
using TeachingRecordSystem.Api.V1.Requests;
using TeachingRecordSystem.Api.V1.Responses;
Expand All @@ -10,7 +9,6 @@ namespace TeachingRecordSystem.Api.V1.Controllers;

[ApiController]
[Route("teachers")]
[SupportsReadOnlyMode]
public class TeachersController : ControllerBase
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.V2.Requests;
using TeachingRecordSystem.Api.V2.Responses;

namespace TeachingRecordSystem.Api.V2.Controllers;

[ApiController]
[Route("itt-providers")]
[SupportsReadOnlyMode]
public class IttProvidersController : ControllerBase
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace TeachingRecordSystem.Api.V2.Controllers;

[ApiController]
[Route("npq-qualifications")]
[SupportsReadOnlyMode]
public class NpqQualificationsController : ControllerBase
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public TeachersController(IMediator mediator)
summary: "Find teachers",
description: "Returns teachers matching the specified criteria")]
[ProducesResponseType(typeof(FindTeachersResponse), StatusCodes.Status200OK)]
[SupportsReadOnlyMode]
public async Task<IActionResult> FindTeachers(FindTeachersRequest request)
{
var response = await _mediator.Send(request);
Expand All @@ -38,7 +37,6 @@ public async Task<IActionResult> FindTeachers(FindTeachersRequest request)
summary: "Get teacher",
description: "Gets an individual teacher by their TRN")]
[ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)]
[SupportsReadOnlyMode]
public async Task<IActionResult> GetTeacher([FromRoute] GetTeacherRequest request)
{
var response = await _mediator.Send(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.V2.Requests;
using TeachingRecordSystem.Api.V2.Responses;

namespace TeachingRecordSystem.Api.V2.Controllers;

[ApiController]
[Route("unlock-teacher")]
[SupportsReadOnlyMode]
public class UnlockTeacherController : ControllerBase
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.Infrastructure.Security;
using TeachingRecordSystem.Api.V3.Requests;

Expand All @@ -13,7 +12,6 @@ namespace TeachingRecordSystem.Api.V3.Controllers;
[ApiController]
[Route("certificates")]
[Authorize(AuthorizationPolicies.IdentityUserWithTrn)]
[SupportsReadOnlyMode]
public class CertificatesController : Controller
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.Infrastructure.ModelBinding;
using TeachingRecordSystem.Api.Infrastructure.Security;
using TeachingRecordSystem.Api.V3.Requests;
Expand All @@ -14,7 +13,6 @@ namespace TeachingRecordSystem.Api.V3.Controllers;

[ApiController]
[Route("teacher")]
[SupportsReadOnlyMode]
public class TeacherController : Controller
{
private readonly IMediator _mediator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using TeachingRecordSystem.Api.Infrastructure.Filters;
using TeachingRecordSystem.Api.Infrastructure.ModelBinding;
using TeachingRecordSystem.Api.Infrastructure.Security;
using TeachingRecordSystem.Api.V3.Requests;
Expand All @@ -14,7 +13,6 @@ namespace TeachingRecordSystem.Api.V3.Controllers;
[ApiController]
[Route("teachers")]
[Authorize(AuthorizationPolicies.ApiKey)]
[SupportsReadOnlyMode]
public class TeachersController : ControllerBase
{
private readonly IMediator _mediator;
Expand Down
1 change: 0 additions & 1 deletion terraform/aks/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ module "api_application_configuration" {
DistributedLockContainerName = azurerm_storage_container.locks.name
DqtReporting__RunService = var.run_dqt_reporting_service
RecurringJobs__Enabled = var.run_recurring_jobs
ReadOnlyMode = var.readonly_mode
DataProtectionKeysContainerName = azurerm_storage_container.keys.name
}

Expand Down
3 changes: 0 additions & 3 deletions terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ variable "run_recurring_jobs" {
type = bool
}

variable "readonly_mode" {
type = bool
}
variable "api_replicas" {
type = number
default = 1
Expand Down
3 changes: 1 addition & 2 deletions terraform/aks/workspace_variables/dev.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"enable_monitoring": false,
"deploy_dqt_reporting_server": true,
"run_dqt_reporting_service": true,
"run_recurring_jobs": false,
"readonly_mode": true
"run_recurring_jobs": false
}
3 changes: 1 addition & 2 deletions terraform/aks/workspace_variables/pre-production.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"enable_monitoring": false,
"deploy_dqt_reporting_server": false,
"run_dqt_reporting_service": true,
"run_recurring_jobs": true,
"readonly_mode": false
"run_recurring_jobs": true
}
1 change: 0 additions & 1 deletion terraform/aks/workspace_variables/production.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"deploy_dqt_reporting_server": false,
"run_dqt_reporting_service": true,
"run_recurring_jobs": true,
"readonly_mode": false,
"api_replicas": 2,
"ui_replicas": 2,
"postgres_flexible_server_sku": "GP_Standard_D2ds_v4",
Expand Down
3 changes: 1 addition & 2 deletions terraform/aks/workspace_variables/test.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"enable_monitoring": false,
"deploy_dqt_reporting_server": true,
"run_dqt_reporting_service": true,
"run_recurring_jobs": false,
"readonly_mode": false
"run_recurring_jobs": false
}

0 comments on commit 66712c2

Please sign in to comment.