Skip to content

Commit 613a793

Browse files
Remove unused code
1 parent a55b9f7 commit 613a793

17 files changed

Lines changed: 8 additions & 604 deletions

backend/api/Configurations/ConfigurationBuilderExtensions.cs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,6 @@
22
{
33
public static class ConfigurationBuilderExtensions
44
{
5-
/// <summary>
6-
/// Creates the AZURE_CLIENT_ID and AZURE_TENANT_ID configuration values for the
7-
/// <see href="https://docs.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet">Environment Credentials</see>
8-
/// used by the application when dockerized.
9-
/// </summary>
10-
/// <param name="builder"></param>
11-
/// <returns></returns>
12-
public static void AddAppSettingsEnvironmentVariables(this WebApplicationBuilder builder)
13-
{
14-
string? clientId = builder
15-
.Configuration.GetSection("AzureAd")
16-
.GetValue<string?>("ClientId");
17-
if (clientId is not null)
18-
{
19-
Environment.SetEnvironmentVariable("AZURE_CLIENT_ID", clientId);
20-
Console.WriteLine("'AZURE_CLIENT_ID' set to " + clientId);
21-
}
22-
23-
string? tenantId = builder
24-
.Configuration.GetSection("AzureAd")
25-
.GetValue<string?>("TenantId");
26-
if (tenantId is not null)
27-
{
28-
Environment.SetEnvironmentVariable("AZURE_TENANT_ID", tenantId);
29-
Console.WriteLine("'AZURE_TENANT_ID' set to " + tenantId);
30-
}
31-
}
32-
33-
/// <summary>
34-
/// Creates if don't already exist/sets all the configuration variables present on the .env file for the
35-
/// <see href="https://docs.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet">Environment Credentials</see>
36-
/// used by the application when dockerized.
37-
/// </summary>
38-
/// <param name="builder"></param>
39-
/// <param name="filePath"></param>
40-
/// <returns></returns>
41-
public static void AddDotEnvironmentVariables(
42-
this WebApplicationBuilder builder,
43-
string filePath
44-
)
45-
{
46-
if (!File.Exists(filePath))
47-
return;
48-
49-
foreach (string line in File.ReadAllLines(filePath))
50-
{
51-
string[] parts = line.Split('=', StringSplitOptions.RemoveEmptyEntries);
52-
53-
if (parts.Length == 0 || parts[0].StartsWith('#'))
54-
continue;
55-
56-
Environment.SetEnvironmentVariable(parts[0], parts[1]);
57-
}
58-
59-
builder.Configuration.AddEnvironmentVariables();
60-
}
61-
625
/// <summary>
636
/// Configures the logger used by the application
647
/// </summary>

backend/api/Database/Models/Pointilla.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,4 @@ public struct PointillaMapResponse
1616
public int ZoomMax { get; set; }
1717
public int TileSize { get; set; }
1818
}
19-
20-
public struct PointillaMapQuery
21-
{
22-
public string PlantCode { get; set; }
23-
public int FloorId { get; set; }
24-
}
25-
26-
public struct PointillaMapTilesQuery
27-
{
28-
public string PlantCode { get; set; }
29-
public int FloorId { get; set; }
30-
public int ZoomLevel { get; set; }
31-
public int X { get; set; }
32-
public int Y { get; set; }
33-
}
3419
}

backend/api/Database/Models/TransformationMatrices.cs

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

backend/api/Options/AzureAdOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ public class AzureAdOptions
55
public string ClientId { get; set; } = "";
66
public string ClientSecret { get; set; } = "";
77
public string TenantId { get; set; } = "";
8-
public string StorageAccount { get; set; } = "";
98
}
109
}

backend/api/Utilities/Exceptions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,12 @@ public class MissionNotFoundException(string message) : Exception(message) { }
6868

6969
public class InspectionNotFoundException(string message) : Exception(message) { }
7070

71-
public class InspectionNotAvailableYetException(string message) : Exception(message) { }
72-
7371
public class MissionTaskNotFoundException(string message) : Exception(message) { }
7472

7573
public class MissionRunNotFoundException(string message) : Exception(message) { }
7674

7775
public class RobotNotFoundException(string message) : Exception(message) { }
7876

79-
public class RobotInformationNotAvailableException(string message) : Exception(message) { }
80-
8177
public class RobotPreCheckFailedException(string message) : Exception(message) { }
8278

8379
public class InspectionAreaExistsException(string message) : Exception(message) { }

backend/api/Utilities/HttpContextExtensions.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
using System.Security.Claims;
2-
3-
namespace Api.Utilities
1+
namespace Api.Utilities
42
{
53
public static class HttpContextExtensions
64
{
7-
public static List<System.Security.Claims.Claim> GetRequestedRoles(this HttpContext context)
8-
{
9-
return context.User?.Claims.Where(c => c.Type == ClaimTypes.Role).ToList()
10-
?? new List<Claim>();
11-
}
12-
13-
public static List<Claim> GetRequestedClaims(this HttpContext context)
14-
{
15-
return context.User?.Claims.ToList() ?? new List<Claim>();
16-
}
17-
185
public static string? GetUserObjectId(this HttpContext context)
196
{
207
return context.User?.FindFirst("oid")?.Value;

backend/api/api.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</PropertyGroup>
1212
<ItemGroup>
1313
<PackageReference Include="AdaptiveCards.Templating" Version="2.0.5" />
14-
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
1514
<PackageReference Include="DotEnv.Core" Version="3.1.0" />
1615
<!-- To prevent Hangfire from defaulting to vulnerable Newtonsoft version -->
1716
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
@@ -48,11 +47,9 @@
4847
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.0" />
4948
<PackageReference Include="Microsoft.OpenApi" Version="2.9.0" />
5049
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.0" />
51-
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.1" />
5250
<PackageReference Include="MQTTnet" Version="4.3.7.1207" />
5351
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="4.3.7.1207" />
5452
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.7.1" />
55-
<PackageReference Include="NCrontab" Version="3.4.0" />
5653
</ItemGroup>
5754
<ItemGroup>
5855
<InternalsVisibleTo Include="api" />

backend/api/appsettings.Development.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"ClientId": "ea4c7b92-47b3-45fb-bd25-a8070f0c495c",
44
"ClientSecret": "Fill in ASP.NET Secret Manager"
55
},
6-
"ManagedIdentity": {
7-
"ClientId": "12242230-9788-467d-938e-84caafd25b22"
8-
},
96
"KeyVault": {
107
"VaultUri": "https://robotics-dev-kv.vault.azure.net/"
118
},
@@ -33,8 +30,7 @@
3330
"User": "FlotillaBackendAuthDev"
3431
},
3532
"OpenTelemetry": {
36-
"Enabled": true,
37-
"AzureMonitorExportEnabled": true
33+
"Enabled": true
3834
},
3935
"Redis": {
4036
"HostName": "robotics-dev-redis.northeurope.redis.azure.net"

backend/api/appsettings.Production.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"ClientId": "9eb21071-0895-4097-b0d3-dab03c9de8ac",
44
"ClientSecret": "Fill in ASP.NET Secret Manager"
55
},
6-
"ManagedIdentity": {
7-
"ClientId": "3def0261-2f46-45e1-bd2b-7dc5c52b724f"
8-
},
96
"KeyVault": {
107
"VaultUri": "https://robotics-prod-kv.vault.azure.net/"
118
},

backend/api/appsettings.Staging.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"ClientId": "d89ab07a-3552-4a1f-9a18-9c819c13f2b8",
44
"ClientSecret": "Fill in ASP.NET Secret Manager"
55
},
6-
"ManagedIdentity": {
7-
"ClientId": "d5d5ea06-4952-4843-899c-64aeb4e52240"
8-
},
96
"KeyVault": {
107
"VaultUri": "https://robotics-staging-kv.vault.azure.net/"
118
},

0 commit comments

Comments
 (0)