From 96a43ddd3e5c502fd8b6ded67871555474456933 Mon Sep 17 00:00:00 2001 From: hasanrafique Date: Fri, 15 Jul 2022 01:29:42 +0100 Subject: [PATCH 1/4] MAC 18 MI related changes BEFORE Tasks Nuget package update --- src/SFA.DAS.EAS.Api/App_Start/WebApiConfig.cs | 1 - src/SFA.DAS.EAS.Web/DependencyResolution/IoC.cs | 1 - .../Configuration/ConfigurationKeys.cs | 1 - .../EmployerAccountsConfiguration.cs | 2 ++ .../Configuration/TasksClientApiConfiguration.cs | 10 ++++++++++ .../DependencyResolution/TasksRegistry.cs | 3 +-- .../Interfaces/ITasksClientApiConfiguration.cs | 8 ++++++++ .../DependencyResolution/TasksRegistry.cs | 15 --------------- .../SFA.DAS.EAS.Application.csproj | 1 - .../Configuration/ConfigurationKeys.cs | 1 - 10 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs create mode 100644 src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs delete mode 100644 src/SFA.DAS.EmployerApprenticeshipsService.Application/DependencyResolution/TasksRegistry.cs diff --git a/src/SFA.DAS.EAS.Api/App_Start/WebApiConfig.cs b/src/SFA.DAS.EAS.Api/App_Start/WebApiConfig.cs index 1b559241d5..58c858b736 100644 --- a/src/SFA.DAS.EAS.Api/App_Start/WebApiConfig.cs +++ b/src/SFA.DAS.EAS.Api/App_Start/WebApiConfig.cs @@ -38,7 +38,6 @@ public static void Register(HttpConfiguration config) c.AddRegistry(); c.AddRegistry(); c.AddRegistry(); - c.AddRegistry(); c.AddRegistry(); c.AddRegistry(); c.AddRegistry(); diff --git a/src/SFA.DAS.EAS.Web/DependencyResolution/IoC.cs b/src/SFA.DAS.EAS.Web/DependencyResolution/IoC.cs index 3d6d0ff3b0..bf4d5a2e27 100644 --- a/src/SFA.DAS.EAS.Web/DependencyResolution/IoC.cs +++ b/src/SFA.DAS.EAS.Web/DependencyResolution/IoC.cs @@ -27,7 +27,6 @@ public static IContainer Initialize() c.AddRegistry(); c.AddRegistry(); c.AddRegistry(); - c.AddRegistry(); c.AddRegistry(); c.AddRegistry(); }); diff --git a/src/SFA.DAS.EmployerAccounts/Configuration/ConfigurationKeys.cs b/src/SFA.DAS.EmployerAccounts/Configuration/ConfigurationKeys.cs index a599bae1c2..add2f877c1 100644 --- a/src/SFA.DAS.EmployerAccounts/Configuration/ConfigurationKeys.cs +++ b/src/SFA.DAS.EmployerAccounts/Configuration/ConfigurationKeys.cs @@ -4,7 +4,6 @@ public static class ConfigurationKeys { public const string EmployerAccounts = "SFA.DAS.EmployerAccounts"; public const string Features = "SFA.DAS.EmployerApprenticeshipsService.FeaturesV2"; - public const string TasksApi = "SFA.DAS.Tasks.Api"; public const string ReferenceDataApiClient = "SFA.DAS.ReferenceDataApiClient"; public const string NotificationsApiClient = "SFA.DAS.EmployerAccounts.Notifications"; public const string CommitmentsApiClient = "SFA.DAS.CommitmentsAPI"; diff --git a/src/SFA.DAS.EmployerAccounts/Configuration/EmployerAccountsConfiguration.cs b/src/SFA.DAS.EmployerAccounts/Configuration/EmployerAccountsConfiguration.cs index 7f7149e36e..1e6bed9a59 100644 --- a/src/SFA.DAS.EmployerAccounts/Configuration/EmployerAccountsConfiguration.cs +++ b/src/SFA.DAS.EmployerAccounts/Configuration/EmployerAccountsConfiguration.cs @@ -2,6 +2,7 @@ using SFA.DAS.EAS.Account.Api.Client; using SFA.DAS.Hmrc.Configuration; using SFA.DAS.Messaging.AzureServiceBus.StructureMap; +using SFA.DAS.Tasks.API.Client; using SFA.DAS.TokenService.Api.Client; using System; @@ -59,5 +60,6 @@ public class EmployerAccountsConfiguration : ITopicMessagePublisherConfiguration public int DefaultCacheExpirationInMinutes { get; set; } public string SupportConsoleUsers { get; set; } public DateTime? LastTermsAndConditionsUpdate { get; set; } + public TaskApiConfiguration TasksApi { get; set; } } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs b/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs new file mode 100644 index 0000000000..7801607228 --- /dev/null +++ b/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs @@ -0,0 +1,10 @@ +using SFA.DAS.EmployerAccounts.Interfaces; + +namespace SFA.DAS.EmployerAccounts.Configuration +{ + public class TasksClientApiConfiguration : ITasksClientApiConfiguration + { + public string ApiBaseUrl { get; set; } + public string IdentifierUri { get; set; } + } +} diff --git a/src/SFA.DAS.EmployerAccounts/DependencyResolution/TasksRegistry.cs b/src/SFA.DAS.EmployerAccounts/DependencyResolution/TasksRegistry.cs index a376f4ebaa..03d275f766 100644 --- a/src/SFA.DAS.EmployerAccounts/DependencyResolution/TasksRegistry.cs +++ b/src/SFA.DAS.EmployerAccounts/DependencyResolution/TasksRegistry.cs @@ -11,8 +11,7 @@ public class TasksRegistry : Registry { public TasksRegistry() { - For().Use(c => c.GetInstance().Get(ConfigurationKeys.TasksApi)).Singleton(); - + For().Use(c => c.GetInstance().TasksApi); For().Use(); } } diff --git a/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs b/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs new file mode 100644 index 0000000000..663aba6688 --- /dev/null +++ b/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs @@ -0,0 +1,8 @@ +using SFA.DAS.Http.Configuration; + +namespace SFA.DAS.EmployerAccounts.Interfaces +{ + public interface ITasksClientApiConfiguration : IManagedIdentityClientConfiguration + { + } +} diff --git a/src/SFA.DAS.EmployerApprenticeshipsService.Application/DependencyResolution/TasksRegistry.cs b/src/SFA.DAS.EmployerApprenticeshipsService.Application/DependencyResolution/TasksRegistry.cs deleted file mode 100644 index 3f9e6acc78..0000000000 --- a/src/SFA.DAS.EmployerApprenticeshipsService.Application/DependencyResolution/TasksRegistry.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SFA.DAS.AutoConfiguration; -using SFA.DAS.EAS.Domain.Configuration; -using SFA.DAS.Tasks.API.Client; -using StructureMap; - -namespace SFA.DAS.EAS.Application.DependencyResolution -{ - public class TasksRegistry : Registry - { - public TasksRegistry() - { - For().Use(c => c.GetInstance().Get(ConfigurationKeys.TaskApi)).Singleton(); - } - } -} \ No newline at end of file diff --git a/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj b/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj index 482dbe57bb..71af804803 100644 --- a/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj +++ b/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj @@ -80,7 +80,6 @@ - diff --git a/src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/ConfigurationKeys.cs b/src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/ConfigurationKeys.cs index 326a16cfe2..89e758465f 100644 --- a/src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/ConfigurationKeys.cs +++ b/src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/ConfigurationKeys.cs @@ -5,7 +5,6 @@ public static class ConfigurationKeys public const string LevyDeclarationProvider = "SFA.DAS.LevyAggregationProvider"; public const string PaymentProvider = "SFA.DAS.PaymentProvider"; public const string EmployerApprenticeshipsService = "SFA.DAS.EmployerApprenticeshipsService"; - public const string TaskApi = "SFA.DAS.Tasks.Api"; public const string ReferenceDataApi = "SFA.DAS.ReferenceDataApiClient"; public const string PaymentsApiClient = "SFA.DAS.PaymentsAPI"; public const string NotificationsApiClient = "SFA.DAS.EmployerApprenticeshipsService.Notifications"; From 3ad5091209157e910060df87828d40eb8da70d8d Mon Sep 17 00:00:00 2001 From: hasanrafique Date: Fri, 15 Jul 2022 15:42:35 +0100 Subject: [PATCH 2/4] MAC 18 Tasks Nuget package upgrade --- .../DependencyResolution/ReferenceDataRegistry.cs | 7 +------ .../SFA.DAS.EmployerAccounts.csproj | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/SFA.DAS.EmployerAccounts/DependencyResolution/ReferenceDataRegistry.cs b/src/SFA.DAS.EmployerAccounts/DependencyResolution/ReferenceDataRegistry.cs index eb15e8d444..567102605b 100644 --- a/src/SFA.DAS.EmployerAccounts/DependencyResolution/ReferenceDataRegistry.cs +++ b/src/SFA.DAS.EmployerAccounts/DependencyResolution/ReferenceDataRegistry.cs @@ -1,10 +1,7 @@ -using SFA.DAS.AutoConfiguration; -using SFA.DAS.Configuration; -using SFA.DAS.EmployerAccounts.Configuration; +using SFA.DAS.EmployerAccounts.Configuration; using SFA.DAS.EmployerAccounts.Interfaces; using SFA.DAS.EmployerAccounts.Services; using SFA.DAS.ReferenceData.Api.Client; -using SFA.DAS.Tasks.API.Client; using StructureMap; namespace SFA.DAS.EmployerAccounts.DependencyResolution @@ -14,8 +11,6 @@ public class ReferenceDataRegistry : Registry public ReferenceDataRegistry() { For().Use(c => c.GetInstance()); - For().Use(c => c.GetInstance().Get(ConfigurationKeys.ReferenceDataApiClient)).Singleton(); - For().Use().Singleton(); } } diff --git a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj index c7d19e07d8..6f0f86cd0b 100644 --- a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj +++ b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj @@ -62,7 +62,7 @@ - + From cb92d1d051057c84affb0889bc0e8ad22d500d12 Mon Sep 17 00:00:00 2001 From: hasanrafique Date: Thu, 21 Jul 2022 09:43:54 +0100 Subject: [PATCH 3/4] MAC 18 code review changes removed unused interface --- .../Configuration/TasksClientApiConfiguration.cs | 10 ---------- .../Interfaces/ITasksClientApiConfiguration.cs | 8 -------- 2 files changed, 18 deletions(-) delete mode 100644 src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs delete mode 100644 src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs diff --git a/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs b/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs deleted file mode 100644 index 7801607228..0000000000 --- a/src/SFA.DAS.EmployerAccounts/Configuration/TasksClientApiConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using SFA.DAS.EmployerAccounts.Interfaces; - -namespace SFA.DAS.EmployerAccounts.Configuration -{ - public class TasksClientApiConfiguration : ITasksClientApiConfiguration - { - public string ApiBaseUrl { get; set; } - public string IdentifierUri { get; set; } - } -} diff --git a/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs b/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs deleted file mode 100644 index 663aba6688..0000000000 --- a/src/SFA.DAS.EmployerAccounts/Interfaces/ITasksClientApiConfiguration.cs +++ /dev/null @@ -1,8 +0,0 @@ -using SFA.DAS.Http.Configuration; - -namespace SFA.DAS.EmployerAccounts.Interfaces -{ - public interface ITasksClientApiConfiguration : IManagedIdentityClientConfiguration - { - } -} From abc57b59700a10d0a09d6c9c6d74a6cd518f87da Mon Sep 17 00:00:00 2001 From: Corey Date: Wed, 27 Jul 2022 13:00:30 +0100 Subject: [PATCH 4/4] update version of tasks api client so that it works with MI config --- src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj | 2 +- .../SFA.DAS.EAS.Application.csproj | 2 +- .../SFA.DAS.EAS.Infrastructure.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj index 6f0f86cd0b..5253eb193d 100644 --- a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj +++ b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj @@ -62,7 +62,7 @@ - + diff --git a/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj b/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj index 71af804803..64ec62723a 100644 --- a/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj +++ b/src/SFA.DAS.EmployerApprenticeshipsService.Application/SFA.DAS.EAS.Application.csproj @@ -263,7 +263,7 @@ 1.1.90 - 1.8.44 + 1.8.163 1.8.44 diff --git a/src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/SFA.DAS.EAS.Infrastructure.csproj b/src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/SFA.DAS.EAS.Infrastructure.csproj index eaba6c8733..0b6cfc5db4 100644 --- a/src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/SFA.DAS.EAS.Infrastructure.csproj +++ b/src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/SFA.DAS.EAS.Infrastructure.csproj @@ -189,7 +189,7 @@ 1.1.90 - 1.8.44 + 1.8.163 1.8.44