Skip to content

Commit 0a12ee7

Browse files
authored
Merge pull request #181 from LBHackney-IT/DOC-1399
DOC-1399 - Allow Access To Group_Id Endpoint
2 parents 929271d + 585908e commit 0a12ee7

File tree

13 files changed

+20
-214
lines changed

13 files changed

+20
-214
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ S3_API_ENDPOINT=http://localhost:5555
55
BUCKET_NAME=testBucketName
66
AWS_ACCESS_KEY_ID=remote-identity
77
AWS_SECRET_ACCESS_KEY=remote-credential
8-
GET_CLAIMS_ALLOWED_GOOGLE_GROUPS=allowed-google-groups

DocumentsApi.Tests/V1/Authorization/AuthorizeByGroupsTests.cs

Lines changed: 0 additions & 105 deletions
This file was deleted.

DocumentsApi.Tests/V1/E2ETests/ClaimsTest.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -669,17 +669,5 @@ public async Task Returns400WhenUnableToDecodeBeforeToken()
669669

670670
response.StatusCode.Should().Be(400);
671671
}
672-
673-
[Test]
674-
public async Task Returns401WhenNotAuthorizedToGetClaimsByGroupId()
675-
{
676-
var groupId = "c585f2d3-69c8-4a5e-b74f-c0570665c2d8";
677-
678-
var uri = new Uri($"api/v1/claims?groupId={groupId}", UriKind.Relative);
679-
680-
var response = await Client.GetAsync(uri);
681-
682-
response.StatusCode.Should().Be(401);
683-
}
684672
}
685673
}

DocumentsApi.Tests/compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services:
1111
S3_API_ENDPOINT: http://s3-mock:80
1212
AWS_ACCESS_KEY_ID: remote-identity
1313
AWS_SECRET_ACCESS_KEY: remote-credential
14-
GET_CLAIMS_ALLOWED_GOOGLE_GROUPS: e2e-testing
1514
depends_on:
1615
migrate:
1716
condition: service_completed_successfully

DocumentsApi/DocumentsApi.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<PackageReference Include="AWSSDK.S3" Version="3.5.7.10" />
2323
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.3" />
2424
<PackageReference Include="Hackney.Core.Enums" Version="1.77.0" />
25-
<PackageReference Include="Hackney.Core.Http" Version="1.70.0" />
26-
<PackageReference Include="Hackney.Core.JWT" Version="1.72.0" />
2725
<PackageReference Include="Jering.Javascript.NodeJS" Version="6.3.0" />
2826
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
2927
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />

DocumentsApi/ServiceConfigurator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using Amazon;
23
using Amazon.S3;
34
using Jering.Javascript.NodeJS;
@@ -23,6 +24,8 @@ public static void ConfigureServices(IServiceCollection services)
2324
// var serviceProvider = services.BuildServiceProvider();
2425
// var nodeJSService = serviceProvider.GetRequiredService<INodeJSService>();
2526

27+
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
28+
2629
// Database Context
2730
services.AddDbContext<DocumentsContext>(
2831
opt => opt.UseLazyLoadingProxies().UseNpgsql(options.DatabaseConnectionString));

DocumentsApi/Startup.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
using Microsoft.Extensions.Hosting;
1919
using Microsoft.OpenApi.Models;
2020
using Swashbuckle.AspNetCore.SwaggerGen;
21-
using Hackney.Core.Http;
22-
using Hackney.Core.JWT;
2321

2422
namespace DocumentsApi
2523
{
@@ -126,9 +124,6 @@ public static void ConfigureServices(IServiceCollection services)
126124

127125
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
128126

129-
services.AddTokenFactory()
130-
.AddHttpContextWrapper();
131-
132127
ServiceConfigurator.ConfigureServices(services);
133128
}
134129

DocumentsApi/V1/Authorization/AuthorizeByGroups.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

DocumentsApi/V1/Authorization/EnvironmentVariableNullException.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

DocumentsApi/V1/Controllers/ClaimsController.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.AspNetCore.Mvc;
77
using Amazon.S3;
88
using System.Threading.Tasks;
9-
using DocumentsApi.V1.Authorization;
109

1110
namespace DocumentsApi.V1.Controllers
1211
{
@@ -193,7 +192,6 @@ public IActionResult GeneratePreSignedDownloadUrl([FromRoute] Guid claimId)
193192
/// <response code="400">Request contains invalid parameters</response>
194193
/// <response code="401">Request lacks valid API token</response>
195194
[HttpGet]
196-
[AuthorizeByGroups("GET_CLAIMS_ALLOWED_GOOGLE_GROUPS")]
197195
public IActionResult GetClaimsByGroupId([FromQuery] PaginatedClaimRequest request)
198196
{
199197
try

0 commit comments

Comments
 (0)