diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 000000000..de6563d07 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-reportgenerator-globaltool": { + "version": "5.1.17", + "commands": [ + "reportgenerator" + ] + } + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5de1f6b9c..3be87c853 100644 --- a/.gitignore +++ b/.gitignore @@ -220,7 +220,7 @@ ClientBin/ *.publishsettings orleans.codegen.cs -# Including strong name files can present a security risk +# Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk @@ -316,7 +316,7 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ -# Azure Stream Analytics local run output +# Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log @@ -325,7 +325,7 @@ ASALocalRun/ # NVidia Nsight GPU debugger configuration file *.nvuser -# MFractors (Xamarin productivity tool) working folder +# MFractors (Xamarin productivity tool) working folder .mfractor/ # SonarQube @@ -342,4 +342,8 @@ ASALocalRun/ values.dev.yaml secrets.dev.yaml +.env .DS_Store +Coverage/ +**/SpecFlow/ +azurite/ diff --git a/README.md b/README.md index 6112a7f8d..0ac5f8f53 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,22 @@ # vh-video-api +## HMCTS + +[![Build Status](https://hmctsreform.visualstudio.com/VirtualHearings/_apis/build/status/Apps-CI/hmcts.vh-video-api?repoName=hmcts%2Fvh-video-api&branchName=master)](https://hmctsreform.visualstudio.com/VirtualHearings/_build/latest?definitionId=107&repoName=hmcts%2Fvh-video-api&branchName=master) + +[![VideoApi.Client package in vh-packages feed in Azure Artifacts](https://hmctsreform.feeds.visualstudio.com/3f69a23d-fbc7-4541-afc7-4cccefcad773/_apis/public/Packaging/Feeds/vh-packages/Packages/80002570-7840-44ca-8d91-58fe07774f40/Badge)](https://hmctsreform.visualstudio.com/VirtualHearings/_artifacts/feed/vh-packages/NuGet/VideoApi.Client?preferRelease=true) + +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vh-video-api&metric=alert_status)](https://sonarcloud.io/dashboard?id=vh-video-api) + +## SDS + +[![Build Status](https://dev.azure.com/hmcts/Video%20Hearings/_apis/build/status/vh-video-api/hmcts.vh-video-api.sds.master-release?repoName=hmcts%2Fvh-video-api&branchName=master)](https://dev.azure.com/hmcts/Video%20Hearings/_build/latest?definitionId=668&repoName=hmcts%2Fvh-video-api&branchName=master) + +[![VideoApi.Client package in vh-packages feed in Azure Artifacts](https://feeds.dev.azure.com/hmcts/cf3711aa-2aed-4f62-81a8-2afaee0ce26d/_apis/public/Packaging/Feeds/vh-packages/Packages/2cd477d4-635e-48e1-987f-1d91d35179a6/Badge)](https://dev.azure.com/hmcts/Video%20Hearings/_artifacts/feed/vh-packages/NuGet/VideoApi.Client?preferRelease=true) + + +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vh-video-api&metric=alert_status)](https://sonarcloud.io/dashboard?id=vh-video-api) + ## Running Sonar Analysis ``` bash @@ -24,7 +41,7 @@ dotnet test --no-build VideoApi.IntegrationTests/VideoApi.IntegrationTests.cspro Under the unit test project directory ``` bash -dotnet reportgenerator "-reports:../Artifacts/Coverage/coverage.opencover.xml" "-targetDir:../Artifacts/Coverage/Report" -reporttypes:HtmlInline_AzurePipelines +dotnet reportgenerator "-reports:./Coverage/coverage.opencover.xml" "-targetDir:./Artifacts/Coverage/Report" -reporttypes:Html -sourcedirs:./VideoApi ``` ##Branch name git hook will run on pre commit and control the standard for new branch name. @@ -54,30 +71,13 @@ Update following configuration under appsettings.json under VideoApi.AcceptanceT Note: Ensure you have Docker desktop engine installed and setup -## Run Stryker - -To run stryker mutation test, go to UnitTest folder under command prompt and run the following command - -```bash -dotnet stryker -``` -From the results look for line(s) of code highlighted with Survived\No Coverage and fix them. +### Running all tests in Docker +Open a terminal at the root level of the repository and run the following command -If in case you have not installed stryker previously, please use one of the following commands - -### Global -```bash -dotnet tool install -g dotnet-stryker -``` -### Local -```bash -dotnet tool install dotnet-stryker +```console +docker-compose -f "docker-compose.tests.yml" up --build --abort-on-container-exit ``` -To update latest version of stryker please use the following command - -```bash -dotnet tool update --global dotnet-stryker -``` \ No newline at end of file +> You may need to create a `.env` file to store the environment variables \ No newline at end of file diff --git a/VideoApi/Testing.Common/AzureStorageManager.cs b/VideoApi/Testing.Common/AzureStorageManager.cs new file mode 100644 index 000000000..75321d3a7 --- /dev/null +++ b/VideoApi/Testing.Common/AzureStorageManager.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Storage; +using Azure.Storage.Blobs; +using NUnit.Framework; + +namespace Testing.Common +{ + public class AzureStorageManager + { +#pragma warning disable + // This the default test secret available in public MS documentation + private static readonly string DefaultAzuriteConnectionString = + "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"; +#pragma warning restore + private string _storageContainerName; + + private readonly string _storageAccountName; + private readonly string _storageAccountKey; + + private BlobContainerClient _blobContainerClient; + private BlobClient _blobClient; + + public AzureStorageManager() + { + } + + public AzureStorageManager(string accountName, string accountKey, string containerName) + { + _storageAccountName = accountName; + _storageAccountKey = accountKey; + _storageContainerName = containerName; + } + + public AzureStorageManager SetStorageContainerName(string storageContainerName) + { + _storageContainerName = storageContainerName; + return this; + } + + public AzureStorageManager CreateBlobClient(string filePathWithoutExtension) + { + _blobContainerClient = CreateContainerClient(); + _blobClient = _blobContainerClient.GetBlobClient($"{filePathWithoutExtension}.mp4"); + return this; + } + + public AzureStorageManager CreateBlobClient(string filePathWithoutExtension, string connectionString) + { + _blobContainerClient = CreateContainerClient(connectionString); + _blobClient = _blobContainerClient.GetBlobClient($"{filePathWithoutExtension}.mp4"); + return this; + } + + public AzureStorageManager CreateBlobContainerClient(string connectionString) + { + _blobContainerClient = CreateContainerClient(connectionString); + return this; + } + + public async IAsyncEnumerable GetAllBlobsAsync(string filePathNamePrefix) + { + await foreach (var page in _blobContainerClient.GetBlobsAsync(prefix: filePathNamePrefix)) + { + yield return _blobContainerClient.GetBlobClient(page.Name); + } + } + + public async Task UploadAudioFileToStorage(string file) + { + await _blobClient.UploadAsync(file); + + if (!await _blobClient.ExistsAsync()) + { + throw new RequestFailedException($"Can not find file: {file}"); + } + + TestContext.WriteLine($"Uploaded audio file to : {file}"); + } + + public async Task UploadFileToStorage(string localFileName, string filePathOnStorage) + { + var blobClient = _blobContainerClient.GetBlobClient(filePathOnStorage); + + await blobClient.UploadAsync(localFileName); + + if (!await blobClient.ExistsAsync()) + { + throw new RequestFailedException($"Can not find file: {localFileName} with full path {filePathOnStorage}"); + } + + TestContext.WriteLine($"Uploaded audio file to : {localFileName} with full path: {filePathOnStorage}"); + } + + public async Task VerifyAudioFileExistsInStorage() + { + return await _blobClient.ExistsAsync(); + } + + public async Task RemoveAudioFileFromStorage() + { + await _blobClient.DeleteAsync(); + TestContext.WriteLine("Deleted audio file"); + } + + public static BlobServiceClient CreateAzuriteBlobServiceClient(string connectionString) + { + connectionString ??= DefaultAzuriteConnectionString; + TestContext.WriteLine($"Azure Connection string {connectionString}"); + var serviceClient = new BlobServiceClient(connectionString, new BlobClientOptions {Retry = { MaxRetries = 2}}); + return serviceClient; + } + + private BlobContainerClient CreateContainerClient(string connectionString) + { + var serviceClient = CreateAzuriteBlobServiceClient(connectionString); + var containerClient = serviceClient.GetBlobContainerClient(_storageContainerName); + containerClient.CreateIfNotExists(); + return containerClient; + } + + private BlobContainerClient CreateContainerClient() + { + var storageSharedKeyCredential = new StorageSharedKeyCredential(_storageAccountName, _storageAccountKey); + var serviceEndpoint = $"https://{_storageAccountName}.blob.core.windows.net/"; + var serviceClient = new BlobServiceClient(new Uri(serviceEndpoint), storageSharedKeyCredential); + return serviceClient.GetBlobContainerClient(_storageContainerName); + } + } +} diff --git a/VideoApi/Testing.Common/Configuration/ConfigRootBuilder.cs b/VideoApi/Testing.Common/Configuration/ConfigRootBuilder.cs new file mode 100644 index 000000000..532a58c78 --- /dev/null +++ b/VideoApi/Testing.Common/Configuration/ConfigRootBuilder.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Configuration; + +namespace Testing.Common.Configuration +{ + public static class ConfigRootBuilder + { + private const string UserSecretId = "9AECE566-336D-4D16-88FA-7A76C27321CD"; + public static IConfigurationRoot Build(string userSecretId = UserSecretId, bool useSecrets = true) + { + var builder = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .AddJsonFile("appsettings.Development.json", true) + .AddJsonFile("appsettings.Production.json", true); // CI write variables in the pipeline to this file + + if (useSecrets) + { + builder = builder.AddUserSecrets(userSecretId); + } + + return builder.AddEnvironmentVariables() + .Build(); + } + } +} diff --git a/VideoApi/Testing.Common/FileManager.cs b/VideoApi/Testing.Common/FileManager.cs new file mode 100644 index 000000000..80d7482ec --- /dev/null +++ b/VideoApi/Testing.Common/FileManager.cs @@ -0,0 +1,37 @@ +using System; +using System.IO; +using System.Reflection; + +namespace Testing.Common +{ + public static class FileManager + { + public static string GetAssemblyDirectory() + { + return AppDomain.CurrentDomain.BaseDirectory; + } + + public static string CreateNewAudioFile(string originalFileName, string fileNameWithoutExtension, string path = "TestAudioFiles") + { + var originalFilePath = Path.Join(GetAssemblyDirectory(), path, originalFileName); + if (!File.Exists(originalFilePath)) + { + throw new FileNotFoundException($"Unable to find audio file with path : {originalFilePath}"); + } + + var fileWithExtension = $"{fileNameWithoutExtension}.mp4"; + var newFilePath = Path.Join(GetAssemblyDirectory(), path, fileWithExtension); + File.Copy(originalFilePath, newFilePath, true); + return newFilePath; + } + + public static void RemoveLocalAudioFile(string filepath) + { + if (!File.Exists(filepath)) + { + throw new FileNotFoundException($"Unable to find audio file with path : {filepath}"); + } + File.Delete(filepath); + } + } +} diff --git a/VideoApi/Testing.Common/Helper/ApiUriFactory.cs b/VideoApi/Testing.Common/Helper/ApiUriFactory.cs index 4b3322f77..80e65c83c 100644 --- a/VideoApi/Testing.Common/Helper/ApiUriFactory.cs +++ b/VideoApi/Testing.Common/Helper/ApiUriFactory.cs @@ -12,11 +12,20 @@ public static class EventsEndpoints public static class AudioRecordingEndpoints { private const string ApiRoot = "conferences"; + + [Obsolete("We only have one application for all hearings now. Need to review old bookings.")] public static string GetAudioApplicationWithHearingId(Guid hearingId) => $"{ApiRoot}/audioapplications/{hearingId}"; + + [Obsolete("We only have one application for all hearings now. Need to review old bookings.")] public static string GetAudioApplication() => $"{ApiRoot}/audioapplications"; + + [Obsolete("We only have one application for all hearings now. Need to review old bookings.")] public static string DeleteAudioApplication(Guid hearingId) => $"{ApiRoot}/audioapplications/{hearingId}"; - public static string GetAudioStream(Guid hearingId) => $"{ApiRoot}/audiostreams/{hearingId}"; + + [Obsolete("We only have one application for all hearings now. Need to review old bookings.")] public static string GetAudioMonitoringStream(Guid hearingId) => $"{ApiRoot}/audiostreams/{hearingId}/monitoring"; + + public static string GetAudioStream(Guid hearingId) => $"{ApiRoot}/audiostreams/{hearingId}"; public static string GetAudioRecordingLink(Guid hearingId) => $"{ApiRoot}/audio/{hearingId}"; public static string GetCvpAudioRecordingsAll(string cloudRoom, string date, string caseReference) => $"{ApiRoot}/audio/cvp/all/{cloudRoom}/{date}/{caseReference}"; public static string GetCvpAudioRecordingsByCloudRoom(string cloudRoom, string date) => $"{ApiRoot}/audio/cvp/cloudroom/{cloudRoom}/{date}"; @@ -97,7 +106,7 @@ public static class InstantMessageEndpoints public static string RemoveInstantMessagesForConference(Guid conferenceId) => $"{ApiRoot}/{conferenceId}/instantmessages"; public static string GetClosedConferencesWithInstantMessages => $"{ApiRoot}/expiredIM"; } - + public static class EPEndpoints { private const string ApiRoot = "conferences"; @@ -123,10 +132,10 @@ public static class VirtualRoomEndpoints public static string GetInterpreterRoomForParticipant(Guid conferenceId, Guid participantId) => $"{ApiRoot}/{conferenceId}/rooms/interpreter/{participantId}"; - + public static string GetWitnessRoomForParticipant(Guid conferenceId, Guid participantId) => $"{ApiRoot}/{conferenceId}/rooms/witness/{participantId}"; - + public static string GetJudicialRoomForParticipant(Guid conferenceId, Guid participantId) => $"{ApiRoot}/{conferenceId}/rooms/judicial/{participantId}"; } diff --git a/VideoApi/Testing.Common/Helper/Builders/Domain/ConferenceBuilder.cs b/VideoApi/Testing.Common/Helper/Builders/Domain/ConferenceBuilder.cs index 92143e745..c4396db27 100644 --- a/VideoApi/Testing.Common/Helper/Builders/Domain/ConferenceBuilder.cs +++ b/VideoApi/Testing.Common/Helper/Builders/Domain/ConferenceBuilder.cs @@ -30,7 +30,7 @@ public ConferenceBuilder(bool ignoreId = false, Guid? knownHearingRefId = null, var hearingRefId = knownHearingRefId ?? Guid.NewGuid(); - var scheduleDateTime = scheduledDateTime ?? DateTime.UtcNow.AddMinutes(30); + var scheduleDateTime = scheduledDateTime ?? DateTime.Today.AddHours(9).AddMinutes(30); const string caseType = "Generic"; var randomGenerator = RandomNumberGenerator.Create(); // Compliant for security-sensitive use cases var data = new byte[2]; diff --git a/VideoApi/Testing.Common/Testing.Common.csproj b/VideoApi/Testing.Common/Testing.Common.csproj index e3e621d31..9f6902166 100644 --- a/VideoApi/Testing.Common/Testing.Common.csproj +++ b/VideoApi/Testing.Common/Testing.Common.csproj @@ -1,9 +1,10 @@ - netstandard2.1 + net6.0 latestmajor + @@ -12,6 +13,11 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/VideoApi/VideoApi.AcceptanceTests/ApiTests/AcApiTest.cs b/VideoApi/VideoApi.AcceptanceTests/ApiTests/AcApiTest.cs new file mode 100644 index 000000000..461a76ddf --- /dev/null +++ b/VideoApi/VideoApi.AcceptanceTests/ApiTests/AcApiTest.cs @@ -0,0 +1,52 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Options; +using NUnit.Framework; +using Testing.Common.Configuration; +using VideoApi.Client; +using VideoApi.Common.Configuration; +using VideoApi.Common.Security; + +namespace VideoApi.AcceptanceTests.ApiTests; + +public abstract class AcApiTest +{ + private IConfigurationRoot _configRoot; + private AzureAdConfiguration _azureConfiguration; + private ServicesConfiguration _serviceConfiguration; + protected WowzaConfiguration WowzaConfiguration; + + protected VideoApiClient VideoApiClient { get; set; } + + [OneTimeSetUp] + public async Task OneTimeSetup() + { + RegisterSettings(); + await InitApiClients(); + } + + private void RegisterSettings() + { + _configRoot = ConfigRootBuilder.Build(); + _azureConfiguration = _configRoot.GetSection("AzureAd").Get(); + _serviceConfiguration = _configRoot.GetSection("Services").Get(); + WowzaConfiguration = _configRoot.GetSection("WowzaConfiguration").Get(); + } + + private async Task InitApiClients() + { + var apiToken = await GenerateApiToken(); + var notificationApiHttpClient = new HttpClient(); + notificationApiHttpClient.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("bearer", apiToken); + VideoApiClient = VideoApiClient.GetClient(_serviceConfiguration.VideoApiUrl, notificationApiHttpClient); + } + + private async Task GenerateApiToken() + { + return await new AzureTokenProvider(Options.Create(_azureConfiguration)).GetClientAccessToken(_azureConfiguration.ClientId, + _azureConfiguration.ClientSecret, _serviceConfiguration.VideoApiResourceId); + } +} diff --git a/VideoApi/VideoApi.AcceptanceTests/ApiTests/InstantMessages/CreateAndRemoveInstantMessageTests.cs b/VideoApi/VideoApi.AcceptanceTests/ApiTests/InstantMessages/CreateAndRemoveInstantMessageTests.cs new file mode 100644 index 000000000..722ea1520 --- /dev/null +++ b/VideoApi/VideoApi.AcceptanceTests/ApiTests/InstantMessages/CreateAndRemoveInstantMessageTests.cs @@ -0,0 +1,112 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using NUnit.Framework; +using Testing.Common.Helper.Builders.Api; +using VideoApi.Contract.Enums; +using VideoApi.Contract.Requests; +using VideoApi.Contract.Responses; + +namespace VideoApi.AcceptanceTests.ApiTests.InstantMessages +{ + + public class CreateAndRemoveInstantMessageTests : AcApiTest + { + private ConferenceDetailsResponse _conference; + private string _fromUsername; + private string _toUsername; + private string _messageText = "AC Test IMs"; + + [Test] + public async Task should_add_get_and_remove_instant_messages_for_a_hearing() + { + await CreateAConference(); + AddInstantMessagesToConference(); + await GetInstantMessagesForConference(); + RemoveInstantMessagesForConference(); + } + + [Test] + public async Task should_get_message_history_for_a_participant() + { + await CreateAConference(); + AddInstantMessagesToConference(); + await GetInstantMessagesForParticipant(); + RemoveInstantMessagesForConference(); + } + + [Test] + public async Task should_get_an_empty_message_history_for_a_nonexistent_participant() + { + var history = await VideoApiClient.GetInstantMessageHistoryForParticipantAsync(Guid.NewGuid(), "not.exist.com"); + history.Should().BeEmpty(); + } + + [TearDown] + public async Task TearDown() + { + _fromUsername = null; + _toUsername = null; + if (_conference != null) + { + await VideoApiClient.RemoveConferenceAsync(_conference.Id); + _conference = null; + } + } + + private async Task CreateAConference() + { + var date = DateTime.Now.ToLocalTime().AddMinutes(2); + var request = new BookNewConferenceRequestBuilder("AC InstantMessage Tests") + .WithJudge() + .WithRepresentative().WithIndividual() + .WithHearingRefId(Guid.NewGuid()) + .WithDate(date) + .Build(); + _conference = await VideoApiClient.BookNewConferenceAsync(request); + } + + private void AddInstantMessagesToConference() + { + _fromUsername = _conference.Participants.Find(x => x.UserRole == UserRole.Judge).Username; + _toUsername = _conference.Participants.Find(x => x.UserRole == UserRole.Individual).Username; + var request = new AddInstantMessageRequest() + { + From = _fromUsername, + To = _toUsername, + MessageText = _messageText + }; + + Assert.DoesNotThrowAsync(async () => await VideoApiClient.AddInstantMessageToConferenceAsync(_conference.Id, request)); + } + + private async Task GetInstantMessagesForConference() + { + var messages = await VideoApiClient.GetInstantMessageHistoryAsync(_conference.Id); + messages.Should().NotBeNullOrEmpty(); + var message = messages.First(); + AssertMessage(message); + } + + private async Task GetInstantMessagesForParticipant() + { + var messages = await VideoApiClient.GetInstantMessageHistoryForParticipantAsync(_conference.Id, _toUsername); + messages.Should().NotBeNullOrEmpty(); + var message = messages.First(); + AssertMessage(message); + } + + private void AssertMessage(InstantMessageResponse message) + { + message.From.Should().Be(_fromUsername); + message.MessageText.Should().Be(_messageText); + message.To.Should().Be(_toUsername); + } + + private void RemoveInstantMessagesForConference() + { + Assert.DoesNotThrowAsync(async () => await VideoApiClient.RemoveInstantMessagesAsync(_conference.Id)); + } + } +} diff --git a/VideoApi/VideoApi.AcceptanceTests/Features/AudioRecording.feature b/VideoApi/VideoApi.AcceptanceTests/Features/AudioRecording.feature index e16ca6e5a..cae63cb08 100644 --- a/VideoApi/VideoApi.AcceptanceTests/Features/AudioRecording.feature +++ b/VideoApi/VideoApi.AcceptanceTests/Features/AudioRecording.feature @@ -3,14 +3,6 @@ Feature: Audio Recording As an api service I want to enable CRUD processes for audio recordings -@VIH-5868 -Scenario: Get Audio Stream Monitoring - Ok - Given I have a conference with an audio recording - And I have a valid get audio stream monitoring request - When I send the request to the endpoint - Then the response should have the status Ok and success status True - And the audio stream monitoring details are retrieved - @VIH-5868 Scenario: Get Audio Recording Link - Ok Given I have a conference diff --git a/VideoApi/VideoApi.AcceptanceTests/Features/EndPoints.feature b/VideoApi/VideoApi.AcceptanceTests/Features/EndPoints.feature index 0b31c799e..13933bad2 100644 --- a/VideoApi/VideoApi.AcceptanceTests/Features/EndPoints.feature +++ b/VideoApi/VideoApi.AcceptanceTests/Features/EndPoints.feature @@ -20,7 +20,7 @@ Scenario: Add an endpoint to an nonexistent conference Given I have a conference And I have add endpoint to a conference request with a Nonexistent conference id When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Add an endpoint with invalid data to a valid conference Given I have a conference @@ -48,13 +48,13 @@ Scenario: Remove an endpoint from an nonexistent conference And I have endpoints stored against a conference And I have remove endpoint to a conference request with a Nonexistent conference id When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Remove an nonexistent endpoint from a valid conference Given I have a conference And I have remove nonexistent endpoint to a conference request with a valid conference id When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Update an endpoint to a valid conference Given I have a conference @@ -83,13 +83,13 @@ Scenario: Update an endpoint to an nonexistent conference And I have endpoints stored against a conference And I have update endpoint to a conference request with a Nonexistent conference id When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Update an nonexistent endpoint from a valid conference Given I have a conference And I have update nonexistent endpoint to a conference request with a valid conference id When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Get endpoints for an existing conference Given I have a conference diff --git a/VideoApi/VideoApi.AcceptanceTests/Features/InstantMessages.feature b/VideoApi/VideoApi.AcceptanceTests/Features/InstantMessages.feature deleted file mode 100644 index 205a58cde..000000000 --- a/VideoApi/VideoApi.AcceptanceTests/Features/InstantMessages.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: Instant Messages - In order to manage IM messages - As an api service - I want to be able to create, retrieve, update and delete messages - -@VIH-5489 -Scenario: Get chat messages - Given I have a conference - And the conference has existing messages - And I have a get chat messages request - When I send the request to the endpoint - Then the response should have the status OK and success status True - And the chat messages are retrieved - -@VIH-5495 -Scenario: Create chat messages - Given I have a conference - And I have a create chat messages request - When I send the request to the endpoint - Then the response should have the status OK and success status True - -@VIH-5490 -Scenario: Remove messages for an existing conference -Given I have a conference -And the conference has existing messages -And I have a remove messages from a conference request -When I send the request to the endpoint -Then the response should have the status OK and success status True - -@VIH-6021 -Scenario: Get chat messages for a participant - Given I have a conference - And the conference has existing messages - And I have a get chat messages request for participant - When I send the request to the endpoint - Then the response should have the status OK and success status True - And the chat messages are retrieved for the participant - -Scenario: Get chat messages for a non existent participant - Given I have a conference - And the conference has existing messages - And I have a get chat messages request for non existent participant - When I send the request to the endpoint - Then the response should have the status OK and success status True - And no chat messages are retrieved for the participant diff --git a/VideoApi/VideoApi.AcceptanceTests/Steps/AudioRecordingSteps.cs b/VideoApi/VideoApi.AcceptanceTests/Steps/AudioRecordingSteps.cs index b3d001274..e3a1cbab4 100644 --- a/VideoApi/VideoApi.AcceptanceTests/Steps/AudioRecordingSteps.cs +++ b/VideoApi/VideoApi.AcceptanceTests/Steps/AudioRecordingSteps.cs @@ -23,36 +23,6 @@ public AudioRecordingSteps(TestContext context, ConferenceSteps conferenceSteps) _conferenceSteps = conferenceSteps; } - [Given(@"I have a valid get audio application request")] - public void GivenIHaveAValidGetAudioApplicationRequest() - { - _context.Request = _context.Get(GetAudioApplication()); - } - - [Given(@"I have a nonexistent get audio application request")] - public void GivenIHaveANonexistentGetAudioApplicationRequest() - { - _context.Request = _context.Get(GetAudioApplicationWithHearingId(Guid.NewGuid())); - } - - [Given(@"I have a valid delete audio application request that has no application")] - public void GivenIHaveAValidDeleteAudioApplicationRequestThatHasNoApplication() - { - _context.Request = _context.Delete(DeleteAudioApplication(Guid.NewGuid())); - } - - [Given(@"I have a valid delete audio application request")] - public void GivenIHaveAValidDeleteAudioApplicationRequest() - { - _context.Request = _context.Delete(DeleteAudioApplication(_context.Test.ConferenceResponse.HearingId)); - } - - [Given(@"I have a valid non-existent delete audio application request")] - public void GivenIHaveAValidNonExistentDeleteAudioApplicationRequest() - { - _context.Request = _context.Delete(DeleteAudioApplication(Guid.NewGuid())); - } - [Given(@"the conference has an audio application")] public void GivenTheConferenceHasAnAudioApplication() { @@ -72,24 +42,6 @@ public void GivenIHaveAValidGetAudioStreamRequestThatHasNoStream() _context.Request = _context.Get(GetAudioStream(Guid.NewGuid())); } - [Given(@"I have a valid delete audio stream request that has no audio stream")] - public void GivenIHaveAValidDeleteAudioApplicationRequestThatHasNoAudioStream() - { - _context.Request = _context.Delete(DeleteAudioApplication(_context.Config.AudioRecordingTestIds.NonExistent)); - } - - [Given(@"I have a valid get audio stream monitoring request")] - public void GivenIHaveAValidGetAudioStreamMonitoringRequest() - { - _context.Request = _context.Get(GetAudioMonitoringStream(_context.Test.ConferenceResponse.HearingId)); - } - - [Given(@"I have a valid get audio stream monitoring request that has no audio stream")] - public void GivenIHaveAValidGetAudioStreamMonitoringRequestThatHasNoAudioStream() - { - _context.Request = _context.Get(GetAudioMonitoringStream(_context.Config.AudioRecordingTestIds.NonExistent)); - } - [Given(@"the conference has an audio recording")] public async Task GivenTheConferenceHasAnAudioRecording() { diff --git a/VideoApi/VideoApi.AcceptanceTests/VideoApi.AcceptanceTests.csproj b/VideoApi/VideoApi.AcceptanceTests/VideoApi.AcceptanceTests.csproj index e39cd2e97..650d59936 100644 --- a/VideoApi/VideoApi.AcceptanceTests/VideoApi.AcceptanceTests.csproj +++ b/VideoApi/VideoApi.AcceptanceTests/VideoApi.AcceptanceTests.csproj @@ -14,7 +14,7 @@ - + @@ -22,6 +22,7 @@ + diff --git a/VideoApi/VideoApi.AcceptanceTests/appsettings.json b/VideoApi/VideoApi.AcceptanceTests/appsettings.json index 7de692745..8371e68be 100644 --- a/VideoApi/VideoApi.AcceptanceTests/appsettings.json +++ b/VideoApi/VideoApi.AcceptanceTests/appsettings.json @@ -18,16 +18,37 @@ "VideoApiResourceId": "VideoApiResourceId" }, "KinlyConfiguration": { - "ConferenceUsername": "ConferenceUsername", - "KinlyApiUrl": "KinlyApiUrl", - "KinlySelfTestApiUrl": "KinlySelfTestApiUrl", - "PexipNode": "PexipNode", - "PexipSelfTestNode": "PexipSelfTestNode" + "ApiSecret": "provide api key", + "SelfTestApiSecret": "provide api key", + "CallbackSecret": "provide api key", + "Audience": "kinly.api.endpoints", + "Issuer": "hmcts.video.hearings.service", + "ConferencePhoneNumber": "01234567890", + "ConferencePhoneNumberWelsh": "01234567890", + "KinlyApiUrl": "https://kinlyapi.url", + "KinlySelfTestApiUrl": "https://kinlyapi-selftest.url", + "CallbackUri": "https://callback.url", + "PexipNode": "pexipnode", + "PexipSelfTestNode": "pexipnode", + "ConferenceUsername": "conferenceUsername" }, "WowzaConfiguration": { - "StorageAccountName": "StorageAccountName", - "StorageAccountKey": "StorageAccountKey", - "StorageContainerName": "StorageContainerName" + "LoadBalancer": "https://wowza-example.net", + "RestApiEndpoints:0": "https://wowza-example.net:0001", + "RestApiEndpoints:1": "https://wowza-example.net:0000", + "ServerName": "_defaultServer_", + "StreamingEndpoint": "", + "HostName": "", + "Username": "", + "Password": "", + "StorageDirectory": "", + "AzureStorageDirectory": "", + "StorageAccountName": "foo", + "StorageAccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "StorageContainerName": "bar", + "StorageEndpoint": "http://127.0.0.1:10000/", + "ManagedIdentityClientId": "", + "ApplicationName": "vh-recording-app" }, "ZapConfiguration": { "ApiAddress": "127.0.0.1", diff --git a/VideoApi/VideoApi.AcceptanceTests/packages.lock.json b/VideoApi/VideoApi.AcceptanceTests/packages.lock.json index 69eec9f4e..f3d0b4349 100644 --- a/VideoApi/VideoApi.AcceptanceTests/packages.lock.json +++ b/VideoApi/VideoApi.AcceptanceTests/packages.lock.json @@ -13,12 +13,12 @@ }, "Microsoft.NET.Test.Sdk": { "type": "Direct", - "requested": "[17.4.0, )", - "resolved": "17.4.0", - "contentHash": "VtNZQ83ntG2aEUjy1gq6B4HNdn96se6FmdY/03At8WiqDReGrApm6OB2fNiSHz9D6IIEtWtNZ2FSH0RJDVXl/w==", + "requested": "[17.5.0, )", + "resolved": "17.5.0", + "contentHash": "IJ4eSPcsRbwbAZehh1M9KgejSy0u3d0wAdkJytfCh67zOaCl5U3ltruUEe15MqirdRqGmm/ngbjeaVeGapSZxg==", "dependencies": { - "Microsoft.CodeCoverage": "17.4.0", - "Microsoft.TestPlatform.TestHost": "17.4.0" + "Microsoft.CodeCoverage": "17.5.0", + "Microsoft.TestPlatform.TestHost": "17.5.0" } }, "NUnit3TestAdapter": { @@ -458,8 +458,8 @@ }, "Microsoft.CodeCoverage": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "2oZbSVTC2nAvQ2DnbXLlXS+c25ZyZdWeNd+znWwAxwGaPh9dwQ5NBsYyqQB7sKmJKIUdkKGmN3rzFzjVC81Dtg==" + "resolved": "17.5.0", + "contentHash": "6FQo0O6LKDqbCiIgVQhJAf810HSjFlOj7FunWaeOGDKxy8DAbpHzPk4SfBTXz9ytaaceuIIeR6hZgplt09m+ig==" }, "Microsoft.CSharp": { "type": "Transitive", @@ -777,8 +777,8 @@ }, "Microsoft.Identity.Client": { "type": "Transitive", - "resolved": "4.48.1", - "contentHash": "AsTnTKgmJqhL1hjZ7TA13TDQVyWdn0vpYwhDMdb1mTg+w5m9AZsacLvmxsUZt03uamZ81pDY78himvXOM//tpw==", + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", "dependencies": { "Microsoft.IdentityModel.Abstractions": "6.22.0" } @@ -857,8 +857,8 @@ }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "oWe7A0wrZhxagTOcaxJ9r0NXTbgkiBQQuCpCXxnP06NsGV/qOoaY2oaangAJbOUrwEx0eka1do400NwNCjfytw==", + "resolved": "17.5.0", + "contentHash": "QwiBJcC/oEA1kojOaB0uPWOIo4i6BYuTBBYJVhUvmXkyYqZ2Ut/VZfgi+enf8LF8J4sjO98oRRFt39MiRorcIw==", "dependencies": { "NuGet.Frameworks": "5.11.0", "System.Reflection.Metadata": "1.6.0" @@ -866,10 +866,10 @@ }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "sUx48fu9wgQF1JxzXeSVtzb7KoKpJrdtIzsFamxET3ZYOKXj+Ej13HWZ0U2nuMVZtZVHBmE+KS3Vv5cIdTlycQ==", + "resolved": "17.5.0", + "contentHash": "X86aikwp9d4SDcBChwzQYZihTPGEtMdDk+9t64emAl7N0Tq+OmlLAoW+Rs+2FB2k6QdUicSlT4QLO2xABRokaw==", "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.4.0", + "Microsoft.TestPlatform.ObjectModel": "17.5.0", "Newtonsoft.Json": "13.0.1" } }, @@ -1206,8 +1206,8 @@ }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.ComponentModel.Primitives": { "type": "Transitive", @@ -2130,6 +2130,7 @@ "testing.common": { "type": "Project", "dependencies": { + "Azure.Storage.Blobs": "[12.14.1, )", "Faker.NETCore": "[1.0.2, )", "FluentAssertions": "[5.10.3, )", "Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )", @@ -2138,17 +2139,25 @@ "Microsoft.Extensions.Configuration.UserSecrets": "[7.0.0, )", "Moq": "[4.14.1, )", "NBuilder": "[6.1.0, )", + "NUnit": "[3.13.3, )", "VideoApi.Common": "[1.0.0, )", "VideoApi.Contract": "[1.0.0, )", "VideoApi.Domain": "[1.0.0, )" } }, + "videoapi.client": { + "type": "Project", + "dependencies": { + "Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )", + "VideoApi.Contract": "[1.0.0, )" + } + }, "videoapi.common": { "type": "Project", "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", "Microsoft.Extensions.Caching.Abstractions": "[7.0.0, )", - "Microsoft.IdentityModel.Clients.ActiveDirectory": "[5.2.8, )", + "Microsoft.Identity.Client": "[4.50.0, )", "Newtonsoft.Json": "[13.0.2, )", "System.IdentityModel.Tokens.Jwt": "[6.25.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2157,7 +2166,7 @@ "videoapi.contract": { "type": "Project", "dependencies": { - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.domain": { @@ -2165,7 +2174,7 @@ "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } } } diff --git a/VideoApi/VideoApi.Client/VideoApiClient.cs b/VideoApi/VideoApi.Client/VideoApiClient.cs index cc705e89a..621f210c7 100644 --- a/VideoApi/VideoApi.Client/VideoApiClient.cs +++ b/VideoApi/VideoApi.Client/VideoApiClient.cs @@ -1258,6 +1258,16 @@ public virtual async System.Threading.Tasks.Task GetAud ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1356,6 +1366,16 @@ public virtual async System.Threading.Tasks.Task GetAudi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1449,6 +1469,16 @@ public virtual async System.Threading.Tasks.Task GetAudi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1541,6 +1571,16 @@ public virtual async System.Threading.Tasks.Task GetAudi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1633,6 +1673,16 @@ public virtual async System.Threading.Tasks.Task GetAudi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1729,6 +1779,16 @@ public virtual async System.Threading.Tasks.Task G ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -1824,6 +1884,16 @@ public virtual async System.Threading.Tasks.Task DeleteAudioApplicationAsync(Sys ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -1909,6 +1979,16 @@ public virtual async System.Threading.Tasks.Task G ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2007,6 +2087,16 @@ public virtual async System.Threading.Tasks.Task GetA ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2106,6 +2196,16 @@ public virtual async System.Threading.Tasks.Task Book ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2204,6 +2304,16 @@ public virtual async System.Threading.Tasks.Task UpdateConferenceAsync(UpdateCon ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -2295,6 +2405,16 @@ public virtual async System.Threading.Tasks.Task GetC ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2398,6 +2518,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -2498,6 +2628,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2583,6 +2723,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2670,6 +2820,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2767,6 +2927,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2864,6 +3034,16 @@ public virtual async System.Threading.Tasks.Task RemoveConferenceAsync(System.Gu ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2967,6 +3147,16 @@ public virtual async System.Threading.Tasks.Task GetC ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -2977,6 +3167,16 @@ public virtual async System.Threading.Tasks.Task GetC return objectResponse_.Object; } else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 400) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3057,6 +3257,16 @@ public virtual async System.Threading.Tasks.Task GetC ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3137,6 +3347,16 @@ public virtual async System.Threading.Tasks.Task GetC ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3223,6 +3443,16 @@ public virtual async System.Threading.Tasks.Task CloseConferenceAsync(System.Gui ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -3308,6 +3538,16 @@ public virtual async System.Threading.Tasks.Task CloseConferenceAsync(System.Gui ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3388,6 +3628,16 @@ public virtual async System.Threading.Tasks.Task CloseConferenceAsync(System.Gui ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3473,6 +3723,16 @@ public virtual async System.Threading.Tasks.Task CloseConferenceAsync(System.Gui ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3561,6 +3821,16 @@ public virtual async System.Threading.Tasks.Task AnonymiseConferencesAsync(Syste ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -3627,6 +3897,16 @@ public virtual async System.Threading.Tasks.Task RemoveHeartbeatsForConferencesA ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -3708,6 +3988,16 @@ public virtual async System.Threading.Tasks.Task AnonymiseConferenceWithHearingI ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -3784,6 +4074,16 @@ public virtual async System.Threading.Tasks.Task ReconcileAudioFilesInStor ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -3882,6 +4182,16 @@ public virtual async System.Threading.Tasks.Task StartOrResumeVideoHearingAsync( ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -3973,6 +4283,16 @@ public virtual async System.Threading.Tasks.Task PauseVideoHearingAsync(System.G ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -4054,6 +4374,16 @@ public virtual async System.Threading.Tasks.Task EndVideoHearingAsync(System.Gui ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -4135,6 +4465,16 @@ public virtual async System.Threading.Tasks.Task SuspendHearingAsync(System.Guid ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -4222,6 +4562,16 @@ public virtual async System.Threading.Tasks.Task TransferParticipantAsync(System ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -4303,6 +4653,16 @@ public virtual async System.Threading.Tasks.Task RespondToConsultationRequestAsy ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -4392,6 +4752,16 @@ public virtual async System.Threading.Tasks.Task JoinEndpointToConsultationAsync ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -4485,6 +4855,16 @@ public virtual async System.Threading.Tasks.Task LockRoomAsync(LockRoomRequest r ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -4589,6 +4969,16 @@ public virtual async System.Threading.Tasks.Task CreatePrivateCons ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -4697,6 +5087,16 @@ public virtual async System.Threading.Tasks.Task StartPrivateConsultationAsync(S ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 202) { return; @@ -4806,6 +5206,16 @@ public virtual async System.Threading.Tasks.Task LeaveConsultationAsync(LeaveCon ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -4907,6 +5317,16 @@ public virtual async System.Threading.Tasks.Task LeaveConsultationAsync(LeaveCon ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -5000,6 +5420,16 @@ public virtual async System.Threading.Tasks.Task LeaveConsultationAsync(LeaveCon ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -5083,6 +5513,16 @@ public virtual async System.Threading.Tasks.Task LeaveConsultationAsync(LeaveCon ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -5180,6 +5620,16 @@ public virtual async System.Threading.Tasks.Task UpdateDisplayNameForEndpointAsy ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -5255,24 +5705,24 @@ public virtual async System.Threading.Tasks.Task CheckServi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - return objectResponse_.Object; + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + return objectResponse_.Object; } else { @@ -5345,24 +5795,24 @@ public virtual async System.Threading.Tasks.Task CheckServi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200) + if (status_ == 500) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - return objectResponse_.Object; + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 500) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + return objectResponse_.Object; } else { @@ -5441,24 +5891,24 @@ public virtual async System.Threading.Tasks.Task CheckServi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200) + if (status_ == 500) { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - return objectResponse_.Object; + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else - if (status_ == 404) + if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); } - throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + return objectResponse_.Object; } else { @@ -5545,6 +5995,16 @@ public virtual async System.Threading.Tasks.Task AddInstantMessageToConferenceAs ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -5625,6 +6085,16 @@ public virtual async System.Threading.Tasks.Task RemoveInstantMessagesAsync(Syst ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -5715,10 +6185,20 @@ public virtual async System.Threading.Tasks.Task RemoveInstantMessagesAsync(Syst foreach (var item_ in response_.Content.Headers) headers_[item_.Key] = item_.Value; } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -5809,6 +6289,16 @@ public virtual async System.Threading.Tasks.Task RemoveInstantMessagesAsync(Syst ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -5901,6 +6391,16 @@ public virtual async System.Threading.Tasks.Task AddParticipantsToConferenceAsyn ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -6002,6 +6502,16 @@ public virtual async System.Threading.Tasks.Task AddParticipantsToConferenceAsyn ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -6104,6 +6614,16 @@ public virtual async System.Threading.Tasks.Task UpdateConferenceParticipantsAsy ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -6217,6 +6737,16 @@ public virtual async System.Threading.Tasks.Task UpdateParticipantDetailsAsync(S ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -6321,6 +6851,16 @@ public virtual async System.Threading.Tasks.Task RemoveParticipantFromConference ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -6426,6 +6966,16 @@ public virtual async System.Threading.Tasks.Task GetTestC ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -6521,6 +7071,16 @@ public virtual async System.Threading.Tasks.Task GetIndep ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -6621,6 +7181,16 @@ public virtual async System.Threading.Tasks.Task GetIndep ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -6729,6 +7299,16 @@ public virtual async System.Threading.Tasks.Task SaveHeartbeatDataForParticipant ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -6822,6 +7402,16 @@ public virtual async System.Threading.Tasks.Task GetDisti ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -6915,6 +7505,16 @@ public virtual async System.Threading.Tasks.Task AddStaf ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7016,6 +7616,16 @@ public virtual async System.Threading.Tasks.Task AnonymiseParticipantWithUsernam ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -7097,6 +7707,16 @@ public virtual async System.Threading.Tasks.Task AnonymiseQuickLinkParticipantWi ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { return; @@ -7168,6 +7788,16 @@ public virtual async System.Threading.Tasks.Task ValidateQuickLinkAsync(Sy ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7261,6 +7891,16 @@ public virtual async System.Threading.Tasks.Task(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7344,6 +7984,16 @@ public virtual async System.Threading.Tasks.Task Get ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7434,6 +8084,16 @@ public virtual async System.Threading.Tasks.Task GetPexipSe ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7528,6 +8188,16 @@ public virtual async System.Threading.Tasks.Task GetPexipSe ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7627,6 +8297,16 @@ public virtual async System.Threading.Tasks.Task UpdateTaskStatusA ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -7731,6 +8411,16 @@ public virtual async System.Threading.Tasks.Task AddTaskAsync(System.Guid confer ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 400) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); @@ -7820,6 +8510,16 @@ public virtual async System.Threading.Tasks.Task RaiseVideoEventAsync(Conference ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 204) { return; @@ -7911,6 +8611,16 @@ public virtual async System.Threading.Tasks.Task ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -8007,6 +8717,16 @@ public virtual async System.Threading.Tasks.Task ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); @@ -8103,6 +8823,16 @@ public virtual async System.Threading.Tasks.Task ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new VideoApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new VideoApiException("A server side error occurred.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); diff --git a/VideoApi/VideoApi.Common/EnumExtensions.cs b/VideoApi/VideoApi.Common/EnumExtensions.cs index 42f71f111..c35a2e99b 100644 --- a/VideoApi/VideoApi.Common/EnumExtensions.cs +++ b/VideoApi/VideoApi.Common/EnumExtensions.cs @@ -1,32 +1,9 @@ -using System; -using System.ComponentModel; -using System.Reflection; using VideoApi.Domain.Enums; namespace VideoApi.Common { public static class EnumExtensions { - public static string GetEnumDescription(Enum value) - { - FieldInfo fi = value.GetType().GetField(value.ToString()); - - DescriptionAttribute[] attributes = - (DescriptionAttribute[])fi.GetCustomAttributes( - typeof(DescriptionAttribute), - false); - - if (attributes != null && attributes.Length > 0) - { - return attributes[0].Description; - } - - else - { - return value.ToString(); - } - } - public static bool IsEndpointEvent(this EventType eventType) { return eventType == EventType.EndpointJoined || eventType == EventType.EndpointDisconnected || diff --git a/VideoApi/VideoApi.Common/Security/AzureTokenProvider.cs b/VideoApi/VideoApi.Common/Security/AzureTokenProvider.cs index f3ad6ffa6..5e8c82ecf 100644 --- a/VideoApi/VideoApi.Common/Security/AzureTokenProvider.cs +++ b/VideoApi/VideoApi.Common/Security/AzureTokenProvider.cs @@ -1,14 +1,15 @@ using System; +using System.Threading.Tasks; using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Clients.ActiveDirectory; +using Microsoft.Identity.Client; using VideoApi.Common.Configuration; namespace VideoApi.Common.Security { public interface ITokenProvider { - string GetClientAccessToken(string clientId, string clientSecret, string clientResource); - AuthenticationResult GetAuthorisationResult(string clientId, string clientSecret, string clientResource); + Task GetClientAccessToken(string clientId, string clientSecret, string clientResource); + Task GetAuthorisationResult(string clientId, string clientSecret, string clientResource); } public class AzureTokenProvider : ITokenProvider @@ -20,23 +21,26 @@ public AzureTokenProvider(IOptions environmentConfiguratio _securitySettings = environmentConfiguration.Value; } - public string GetClientAccessToken(string clientId, string clientSecret, string clientResource) + public async Task GetClientAccessToken(string clientId, string clientSecret, string clientResource) { - var result = GetAuthorisationResult(clientId, clientSecret, clientResource); + var result = await GetAuthorisationResult(clientId, clientSecret, clientResource); return result.AccessToken; } - - public AuthenticationResult GetAuthorisationResult(string clientId, string clientSecret, string clientResource) + + public async Task GetAuthorisationResult(string clientId, string clientSecret, + string clientResource) { AuthenticationResult result; - var credential = new ClientCredential(clientId, clientSecret); - var authContext = new AuthenticationContext($"{_securitySettings.Authority}{_securitySettings.TenantId}"); + var authority = $"{_securitySettings.Authority}{_securitySettings.TenantId}"; + var app =ConfidentialClientApplicationBuilder.Create(clientId).WithClientSecret(clientSecret) + .WithAuthority(authority).Build(); + try { - result = authContext.AcquireTokenAsync(clientResource, credential).Result; + result = await app.AcquireTokenForClient(new[] {$"{clientResource}/.default"}).ExecuteAsync(); } - catch (AdalException) + catch (MsalServiceException) { throw new UnauthorizedAccessException(); } @@ -44,4 +48,4 @@ public AuthenticationResult GetAuthorisationResult(string clientId, string clien return result; } } -} \ No newline at end of file +} diff --git a/VideoApi/VideoApi.Common/Security/BaseServiceTokenHandler.cs b/VideoApi/VideoApi.Common/Security/BaseServiceTokenHandler.cs index f69a907de..62fabc3c5 100644 --- a/VideoApi/VideoApi.Common/Security/BaseServiceTokenHandler.cs +++ b/VideoApi/VideoApi.Common/Security/BaseServiceTokenHandler.cs @@ -33,7 +33,7 @@ protected override async Task SendAsync(HttpRequestMessage var token = _memoryCache.Get(TokenCacheKey); if (string.IsNullOrEmpty(token)) { - var authenticationResult = _tokenProvider.GetAuthorisationResult(_azureAdConfiguration.ClientId, + var authenticationResult = await _tokenProvider.GetAuthorisationResult(_azureAdConfiguration.ClientId, _azureAdConfiguration.ClientSecret, ClientResource); token = authenticationResult.AccessToken; var tokenExpireDateTime = authenticationResult.ExpiresOn.DateTime.AddMinutes(-1); @@ -44,4 +44,4 @@ protected override async Task SendAsync(HttpRequestMessage return await base.SendAsync(request, cancellationToken); } } -} \ No newline at end of file +} diff --git a/VideoApi/VideoApi.Common/VideoApi.Common.csproj b/VideoApi/VideoApi.Common/VideoApi.Common.csproj index bd6855a1f..43a0a3a8f 100644 --- a/VideoApi/VideoApi.Common/VideoApi.Common.csproj +++ b/VideoApi/VideoApi.Common/VideoApi.Common.csproj @@ -9,9 +9,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VideoApi/VideoApi.Common/packages.lock.json b/VideoApi/VideoApi.Common/packages.lock.json index 566e4664a..0c8eccca2 100644 --- a/VideoApi/VideoApi.Common/packages.lock.json +++ b/VideoApi/VideoApi.Common/packages.lock.json @@ -30,25 +30,13 @@ "Microsoft.Extensions.Primitives": "7.0.0" } }, - "Microsoft.IdentityModel.Clients.ActiveDirectory": { + "Microsoft.Identity.Client": { "type": "Direct", - "requested": "[5.2.8, )", - "resolved": "5.2.8", - "contentHash": "VIi6Bzt0UWEeannuEjtRFr/LgUXXw70a9LlIVfoCGorztZhzHgKiof6UJE1ETRYlf/L+kepsUZeekYZwqb6xPg==", + "requested": "[4.50.0, )", + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Net.Http": "4.3.4", - "System.Private.Uri": "4.3.2", - "System.Runtime.Serialization.Formatters": "4.3.0", - "System.Runtime.Serialization.Json": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.SecureString": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" + "Microsoft.IdentityModel.Abstractions": "6.22.0" } }, "Newtonsoft.Json": { @@ -59,9 +47,9 @@ }, "SonarAnalyzer.CSharp": { "type": "Direct", - "requested": "[8.7.0.17535, )", - "resolved": "8.7.0.17535", - "contentHash": "c9f6HjLChuPcQpo6qUr/Bxmi6Q2ogOVINg2e9tjCeKT/hiL9Cxdw4XsNttiqAhY5AbmHJIs4rn/muXR4OOnAJg==" + "requested": "[8.56.0.67649, )", + "resolved": "8.56.0.67649", + "contentHash": "u5klyn4PBAOe38/CoPbxGjuMqJQ5K0M7SA17H2DHgHyQ+neSU+abneRGjSQSVD76kbYXzG7E1/KQwTuj+nnMZw==" }, "System.IdentityModel.Tokens.Jwt": { "type": "Direct", @@ -443,195 +431,19 @@ }, "Microsoft.NETCore.Platforms": { "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==" + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" }, "Microsoft.NETCore.Targets": { "type": "Transitive", - "resolved": "1.1.3", - "contentHash": "3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==" - }, - "Microsoft.Win32.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "NETStandard.Library": { - "type": "Transitive", - "resolved": "1.6.1", - "contentHash": "WcSp3+vP+yHNgS8EV5J7pZ9IRpeDuARBPN28by8zqff1wJQXm26PVU8L3/fYLBJVU7BtDyqNVWq2KlCVvSSR4A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.AppContext": "4.3.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Console": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.IO.Compression.ZipFile": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Net.Http": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Net.Sockets": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Timer": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0" - } + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, "RandomStringCreator": { "type": "Transitive", "resolved": "2.0.0", "contentHash": "GGpyCGm7W27MlBXp+HNeslnOsNi80Z2isoCt/yY7aKoyjS2Vl6AQ6kq2UK6NgeVpEQZeXaOIEf2pNbiXeARYdg==" }, - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" - }, - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" - }, - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" - }, - "runtime.native.System": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.IO.Compression": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "INBPonS5QPEgn7naufQFXJEp3zX6L4bwHgJ/ZH78aBTpeNfQMtf7C6VrAFhlq2xxWBveIOWyFzQjJ8XzHMhdOQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", - "dependencies": { - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" - } - }, - "runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", - "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } - }, - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" - }, - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" - }, - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" - }, - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" - }, - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" - }, - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" - }, - "System.AppContext": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "fKC+rmaLfeIzUhagxY17Q9siv/sPrjjKcfNg1Ic8IlQkZLipo8ljcaZQu4VtI4Jqbzjc2VTjzGLF6WmsRXAEgA==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, "System.Buffers": { "type": "Transitive", "resolved": "4.5.1", @@ -639,29 +451,12 @@ }, "System.Collections": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Collections.Concurrent": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "resolved": "4.0.11", + "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.Collections.Immutable": { @@ -669,98 +464,19 @@ "resolved": "1.5.0", "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" }, - "System.Collections.NonGeneric": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Collections.Specialized": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", - "dependencies": { - "System.Collections.NonGeneric": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.ComponentModel": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" - }, - "System.ComponentModel.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", - "dependencies": { - "System.ComponentModel": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.ComponentModel.TypeConverter": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.NonGeneric": "4.3.0", - "System.Collections.Specialized": "4.3.0", - "System.ComponentModel": "4.3.0", - "System.ComponentModel.Primitives": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Console": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "DHDrIxiqk1h03m6khKWV2X8p/uvN79rgSqpilL6uzpmSfxfU5ng8VcPtW4qsDsQDHiTv6IPV9TmD5M/vElPNLg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0" - } + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.Diagnostics.Debug": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "resolved": "4.0.11", + "contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.Diagnostics.DiagnosticSource": { @@ -777,144 +493,26 @@ "resolved": "4.7.0", "contentHash": "kE9szT4i3TYT9bDE/BPfzg9/BL6enMiZlcUmnUEBrhRtxWvurKoa8qhXkLTRhrxMzBqaDleWlRfIPE02tulU+w==" }, - "System.Diagnostics.Tools": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Diagnostics.Tracing": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Dynamic.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, "System.Globalization": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Globalization.Calendars": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Globalization.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "resolved": "4.0.11", + "contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.IO": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.IO.Compression": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "YHndyoiV90iu4iKG115ibkhrG+S3jBm8Ap9OwoUAzO5oPDAWcr0SFwQFm0HjM8WkEZWo0zvLTyLmbvTkW1bXgg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Buffers": "4.3.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.IO.Compression": "4.3.0" - } - }, - "System.IO.Compression.ZipFile": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "G4HwjEsgIwy3JFBduZ9quBkAu+eUwjIdJleuNSgmUojbH6O3mlvEIme+GHx/cLlTAPcrnnL7GqvB9pTlWRfhOg==", - "dependencies": { - "System.Buffers": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0" - } - }, - "System.IO.FileSystem": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "resolved": "4.1.0", + "contentHash": "3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0", + "System.Text.Encoding": "4.0.11", + "System.Threading.Tasks": "4.0.11" } }, "System.IO.FileSystem.AccessControl": { @@ -928,48 +526,16 @@ "System.Security.Principal.Windows": "4.7.0" } }, - "System.IO.FileSystem.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, "System.Linq": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - } - }, - "System.Linq.Expressions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "resolved": "4.1.0", + "contentHash": "bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==", "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" + "System.Collections": "4.0.11", + "System.Diagnostics.Debug": "4.0.11", + "System.Resources.ResourceManager": "4.0.1", + "System.Runtime": "4.1.0", + "System.Runtime.Extensions": "4.1.0" } }, "System.Memory": { @@ -982,175 +548,21 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.4", - "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } - }, - "System.Net.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Net.Sockets": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "m6icV6TqQOAdgt5N/9I5KNpjom/5NFtkmGseEH+AK/hny8XrytLH3+b5M8zL/Ycg3fhIocFpUMyl/wpFnVRvdw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, "System.Numerics.Vectors": { "type": "Transitive", "resolved": "4.5.0", "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" }, - "System.ObjectModel": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Private.DataContractSerialization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0", - "System.Xml.XmlSerializer": "4.3.0" - } - }, - "System.Private.Uri": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "Microsoft.NETCore.Targets": "1.1.3" - } - }, "System.Reflection": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", - "dependencies": { - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Emit.ILGeneration": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Emit.Lightweight": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "resolved": "4.1.0", + "contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==", "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.IO": "4.1.0", + "System.Reflection.Primitives": "4.0.1", + "System.Runtime": "4.1.0" } }, "System.Reflection.Metadata": { @@ -1163,33 +575,24 @@ }, "System.Reflection.Primitives": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "resolved": "4.0.1", + "contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.TypeExtensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", - "dependencies": { - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.Resources.ResourceManager": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "resolved": "4.0.1", + "contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Globalization": "4.0.11", + "System.Reflection": "4.1.0", + "System.Runtime": "4.1.0" } }, "System.Runtime": { @@ -1208,91 +611,12 @@ }, "System.Runtime.Extensions": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==", - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0" - } - }, - "System.Runtime.Numerics": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", - "dependencies": { - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - } - }, - "System.Runtime.Serialization.Formatters": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - } - }, - "System.Runtime.Serialization.Json": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "resolved": "4.1.0", + "contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==", "dependencies": { - "System.IO": "4.3.0", - "System.Private.DataContractSerialization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Serialization.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", - "dependencies": { - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.Security.AccessControl": { @@ -1303,157 +627,16 @@ "System.Security.Principal.Windows": "4.7.0" } }, - "System.Security.Cryptography.Algorithms": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.Apple": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, "System.Security.Cryptography.Cng": { "type": "Transitive", "resolved": "4.5.0", "contentHash": "WG3r7EyjUe9CMPFSs6bty5doUqT+q9pbI80hlNzo2SkPkZ4VTuZkGWjpp77JB8+uaL4DFPRdBsAY+DX3dBK92A==" }, - "System.Security.Cryptography.Csp": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Security.Cryptography.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", - "dependencies": { - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Security.Cryptography.X509Certificates": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Cng": "4.3.0", - "System.Security.Cryptography.Csp": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, "System.Security.Principal.Windows": { "type": "Transitive", "resolved": "4.7.0", "contentHash": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==" }, - "System.Security.SecureString": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } - }, "System.Text.Encoding": { "type": "Transitive", "resolved": "4.3.0", @@ -1464,17 +647,6 @@ "System.Runtime": "4.3.0" } }, - "System.Text.Encoding.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0" - } - }, "System.Text.Encodings.Web": { "type": "Transitive", "resolved": "4.7.2", @@ -1494,36 +666,23 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, - "System.Text.RegularExpressions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, "System.Threading": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "resolved": "4.0.11", + "contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==", "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" + "System.Runtime": "4.1.0", + "System.Threading.Tasks": "4.0.11" } }, "System.Threading.Tasks": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "resolved": "4.0.11", + "contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.NETCore.Targets": "1.0.1", + "System.Runtime": "4.1.0" } }, "System.Threading.Tasks.Extensions": { @@ -1534,104 +693,12 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "System.Threading.Timer": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Z6YfyYTCg7lOZjJzBjONJTFKGN9/NIYKSxhU5GRd+DTwHSZyvWp1xuI5aR+dLg+ayyC5Xv57KiY4oJ0tMO89fQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Xml.ReaderWriter": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Tasks.Extensions": "4.3.0" - } - }, - "System.Xml.XDocument": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - } - }, - "System.Xml.XmlDocument": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - } - }, - "System.Xml.XmlSerializer": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "videoapi.domain": { "type": "Project", "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } } } diff --git a/VideoApi/VideoApi.Contract/VideoApi.Contract.csproj b/VideoApi/VideoApi.Contract/VideoApi.Contract.csproj index 93f8442ac..b47ad52f9 100644 --- a/VideoApi/VideoApi.Contract/VideoApi.Contract.csproj +++ b/VideoApi/VideoApi.Contract/VideoApi.Contract.csproj @@ -8,10 +8,10 @@ $(NoWarn);1591 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/VideoApi/VideoApi.DAL/DesignTimeHearingsContextFactory.cs b/VideoApi/VideoApi.DAL/DesignTimeHearingsContextFactory.cs index ba7c0aa05..39fcbd000 100644 --- a/VideoApi/VideoApi.DAL/DesignTimeHearingsContextFactory.cs +++ b/VideoApi/VideoApi.DAL/DesignTimeHearingsContextFactory.cs @@ -1,9 +1,11 @@ -using Microsoft.EntityFrameworkCore; +using System.Diagnostics.CodeAnalysis; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; namespace VideoApi.DAL { + [ExcludeFromCodeCoverage] public class DesignTimeHearingsContextFactory : IDesignTimeDbContextFactory { public VideoApiDbContext CreateDbContext(string[] args) diff --git a/VideoApi/VideoApi.DAL/Exceptions/ConferenceNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/ConferenceNotFoundException.cs index b677e5e4b..60b7234c8 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/ConferenceNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/ConferenceNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class ConferenceNotFoundException : Exception + public class ConferenceNotFoundException : VideoDalException { public ConferenceNotFoundException(Guid conferenceId) : base($"Conference {conferenceId} does not exist") { diff --git a/VideoApi/VideoApi.DAL/Exceptions/EndpointNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/EndpointNotFoundException.cs index 9fda5f4de..69f3c407a 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/EndpointNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/EndpointNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class EndpointNotFoundException : Exception + public class EndpointNotFoundException : VideoDalException { public EndpointNotFoundException(Guid endpointId) : base($"Endpoint {endpointId} does not exist") { diff --git a/VideoApi/VideoApi.DAL/Exceptions/InvalidVirtualCourtRoomTypeException.cs b/VideoApi/VideoApi.DAL/Exceptions/InvalidVirtualCourtRoomTypeException.cs index 291a1bac4..47f43a7ef 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/InvalidVirtualCourtRoomTypeException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/InvalidVirtualCourtRoomTypeException.cs @@ -5,7 +5,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class InvalidVirtualCourtRoomTypeException : Exception + public class InvalidVirtualCourtRoomTypeException : VideoDalException { public InvalidVirtualCourtRoomTypeException(VirtualCourtRoomType roomType, string operationMessage) : base($"VirtualCourtRoomType {roomType} is not valid for this operation: {operationMessage}") { diff --git a/VideoApi/VideoApi.DAL/Exceptions/ParticipantNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/ParticipantNotFoundException.cs index 9931785dc..9de3c8344 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/ParticipantNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/ParticipantNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class ParticipantNotFoundException : Exception + public class ParticipantNotFoundException : VideoDalException { public ParticipantNotFoundException(Guid participantId) : base($"Participant {participantId} does not exist") { @@ -17,7 +17,7 @@ protected ParticipantNotFoundException(SerializationInfo info, StreamingContext } [Serializable] - public class ParticipantLinkException : Exception + public class ParticipantLinkException : VideoDalException { public ParticipantLinkException(Guid participantRefId, Guid linkRefId) : base($"Cannot link participants because one or both cannot be found") { diff --git a/VideoApi/VideoApi.DAL/Exceptions/RoomNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/RoomNotFoundException.cs index 231ce926f..850168d51 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/RoomNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/RoomNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class RoomNotFoundException : Exception + public class RoomNotFoundException : VideoDalException { public RoomNotFoundException(long roomId) : base( $"Room '{roomId}' not found ") diff --git a/VideoApi/VideoApi.DAL/Exceptions/RoomParticipantNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/RoomParticipantNotFoundException.cs index a9b5a8de4..45f9c4628 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/RoomParticipantNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/RoomParticipantNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class RoomParticipantNotFoundException : Exception + public class RoomParticipantNotFoundException : VideoDalException { public RoomParticipantNotFoundException(Guid participantId, long roomId) : base( $"Room participant '{participantId}' not found in room '{roomId}") diff --git a/VideoApi/VideoApi.DAL/Exceptions/TaskNotFoundException.cs b/VideoApi/VideoApi.DAL/Exceptions/TaskNotFoundException.cs index da14e8b06..392984ee7 100644 --- a/VideoApi/VideoApi.DAL/Exceptions/TaskNotFoundException.cs +++ b/VideoApi/VideoApi.DAL/Exceptions/TaskNotFoundException.cs @@ -4,7 +4,7 @@ namespace VideoApi.DAL.Exceptions { [Serializable] - public class TaskNotFoundException : Exception + public class TaskNotFoundException : VideoDalException { public TaskNotFoundException(Guid conferenceId, long taskId) : base( $"Task '{taskId}' not found in Conference {conferenceId} does not exist") diff --git a/VideoApi/VideoApi.DAL/Exceptions/VideoDalException.cs b/VideoApi/VideoApi.DAL/Exceptions/VideoDalException.cs new file mode 100644 index 000000000..08339e458 --- /dev/null +++ b/VideoApi/VideoApi.DAL/Exceptions/VideoDalException.cs @@ -0,0 +1,17 @@ +using System; +using System.Runtime.Serialization; + +namespace VideoApi.DAL.Exceptions +{ + public abstract class VideoDalException : Exception + { + protected VideoDalException(string message) : base(message) + { + } + + protected VideoDalException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} diff --git a/VideoApi/VideoApi.DAL/Queries/GetClosedConferencesWithInstantMessagesQuery.cs b/VideoApi/VideoApi.DAL/Queries/GetClosedConferencesWithInstantMessagesQuery.cs index c7bd570fc..632a78ad8 100644 --- a/VideoApi/VideoApi.DAL/Queries/GetClosedConferencesWithInstantMessagesQuery.cs +++ b/VideoApi/VideoApi.DAL/Queries/GetClosedConferencesWithInstantMessagesQuery.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; using VideoApi.DAL.Queries.Core; @@ -9,6 +10,7 @@ namespace VideoApi.DAL.Queries { + [SuppressMessage("Minor Code Smell", "S2094:Classes should not be empty")] public class GetClosedConferencesWithInstantMessagesQuery : IQuery { } diff --git a/VideoApi/VideoApi.DAL/Queries/GetConferenceInterpreterRoomsByDateQuery.cs b/VideoApi/VideoApi.DAL/Queries/GetConferenceInterpreterRoomsByDateQuery.cs index a38bbbd7c..dc933cb97 100644 --- a/VideoApi/VideoApi.DAL/Queries/GetConferenceInterpreterRoomsByDateQuery.cs +++ b/VideoApi/VideoApi.DAL/Queries/GetConferenceInterpreterRoomsByDateQuery.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore; using VideoApi.DAL.Queries.Core; using VideoApi.Domain; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.DAL.Queries { diff --git a/VideoApi/VideoApi.DAL/Queries/GetDistinctJudgeListByFirstNameQuery.cs b/VideoApi/VideoApi.DAL/Queries/GetDistinctJudgeListByFirstNameQuery.cs index 5b11934a8..41f21203a 100644 --- a/VideoApi/VideoApi.DAL/Queries/GetDistinctJudgeListByFirstNameQuery.cs +++ b/VideoApi/VideoApi.DAL/Queries/GetDistinctJudgeListByFirstNameQuery.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; @@ -9,6 +10,7 @@ namespace VideoApi.DAL.Queries { + [SuppressMessage("Minor Code Smell", "S2094:Classes should not be empty")] public class GetDistinctJudgeListByFirstNameQuery : IQuery {} public class GetDistinctJudgeListByFirstNameQueryHandler : IQueryHandler> diff --git a/VideoApi/VideoApi.DAL/Queries/GetExpiredAudiorecordingConferencesQuery.cs b/VideoApi/VideoApi.DAL/Queries/GetExpiredAudiorecordingConferencesQuery.cs index 82cb3053d..e215311e5 100644 --- a/VideoApi/VideoApi.DAL/Queries/GetExpiredAudiorecordingConferencesQuery.cs +++ b/VideoApi/VideoApi.DAL/Queries/GetExpiredAudiorecordingConferencesQuery.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; using VideoApi.DAL.Queries.Core; @@ -8,6 +9,7 @@ namespace VideoApi.DAL.Queries { + [SuppressMessage("Minor Code Smell", "S2094:Classes should not be empty")] public class GetExpiredAudiorecordingConferencesQuery : IQuery { } diff --git a/VideoApi/VideoApi.DAL/Queries/GetExpiredUnclosedConferencesQuery.cs b/VideoApi/VideoApi.DAL/Queries/GetExpiredUnclosedConferencesQuery.cs index 47c0c9047..82faa90c7 100644 --- a/VideoApi/VideoApi.DAL/Queries/GetExpiredUnclosedConferencesQuery.cs +++ b/VideoApi/VideoApi.DAL/Queries/GetExpiredUnclosedConferencesQuery.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; @@ -9,6 +10,7 @@ namespace VideoApi.DAL.Queries { + [SuppressMessage("Minor Code Smell", "S2094:Classes should not be empty")] public class GetExpiredUnclosedConferencesQuery : IQuery { } @@ -32,4 +34,4 @@ public async Task> Handle(GetExpiredUnclosedConferencesQuery qu .ToListAsync(); } } -} \ No newline at end of file +} diff --git a/VideoApi/VideoApi.DAL/VideoApi.DAL.csproj b/VideoApi/VideoApi.DAL/VideoApi.DAL.csproj index 4213aca46..897f7058e 100644 --- a/VideoApi/VideoApi.DAL/VideoApi.DAL.csproj +++ b/VideoApi/VideoApi.DAL/VideoApi.DAL.csproj @@ -19,7 +19,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VideoApi/VideoApi.DAL/packages.lock.json b/VideoApi/VideoApi.DAL/packages.lock.json index a3841d89c..1ef11cf7b 100644 --- a/VideoApi/VideoApi.DAL/packages.lock.json +++ b/VideoApi/VideoApi.DAL/packages.lock.json @@ -76,9 +76,9 @@ }, "SonarAnalyzer.CSharp": { "type": "Direct", - "requested": "[8.7.0.17535, )", - "resolved": "8.7.0.17535", - "contentHash": "c9f6HjLChuPcQpo6qUr/Bxmi6Q2ogOVINg2e9tjCeKT/hiL9Cxdw4XsNttiqAhY5AbmHJIs4rn/muXR4OOnAJg==" + "requested": "[8.56.0.67649, )", + "resolved": "8.56.0.67649", + "contentHash": "u5klyn4PBAOe38/CoPbxGjuMqJQ5K0M7SA17H2DHgHyQ+neSU+abneRGjSQSVD76kbYXzG7E1/KQwTuj+nnMZw==" }, "Z.EntityFramework.Plus.EFCore": { "type": "Direct", @@ -96,32 +96,34 @@ }, "Azure.Core": { "type": "Transitive", - "resolved": "1.2.1", - "contentHash": "U0zPuK0/ssiz0gvli1/sslqPKANZpCa7muDM3K4Vj6Pf6YKYNnpByQsnqFQTYafzr6cQ41mr1nM07I8jOm5UkA==", + "resolved": "1.25.0", + "contentHash": "X8Dd4sAggS84KScWIjEbFAdt2U1KDolQopTPoHVubG2y3CM54f9l6asVrP5Uy384NWXjsspPYaJgz5xHc+KvTA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.0.0", - "System.Buffers": "4.5.0", + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", "System.Diagnostics.DiagnosticSource": "4.6.0", - "System.Memory": "4.5.3", + "System.Memory.Data": "1.0.2", "System.Numerics.Vectors": "4.5.0", - "System.Threading.Tasks.Extensions": "4.5.2" + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Storage.Blobs": { "type": "Transitive", - "resolved": "12.4.2", - "contentHash": "fhUwOl4qXy23StKvBHDHV5ALM34SczEETRgJWDJHwPW3sZNIYAi3GTBXlWAYPm4SNKR1JgpZSYTbMHrNYCr1DQ==", + "resolved": "12.14.1", + "contentHash": "DvRBWUDMB2LjdRbsBNtz/LiVIYk56hqzSooxx4uq4rCdLj2M+7Vvoa1r+W35Dz6ZXL6p+SNcgEae3oZ+CkPfow==", "dependencies": { - "Azure.Core": "1.2.1", - "Azure.Storage.Common": "12.4.1" + "Azure.Storage.Common": "12.13.0", + "System.Text.Json": "4.7.2" } }, "Azure.Storage.Common": { "type": "Transitive", - "resolved": "12.4.1", - "contentHash": "Q1/w9P9wJCKo+q2LF4pgZxNwgmqmArkxHjPW+Q1pugdc894T6HU4+3hmrFda1otS9CbAPhBLG98WOZ37jMPmFg==", + "resolved": "12.13.0", + "contentHash": "jDv8xJWeZY2Er9zA6QO25BiGolxg87rItt9CwAp7L/V9EPJeaz8oJydaNL9Wj0+3ncceoMgdiyEv66OF8YUwWQ==", "dependencies": { - "Azure.Core": "1.2.1" + "Azure.Core": "1.25.0", + "System.IO.Hashing": "6.0.0" } }, "Castle.Core": { @@ -332,8 +334,8 @@ }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==" + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" }, "Microsoft.CSharp": { "type": "Transitive", @@ -548,34 +550,17 @@ }, "Microsoft.Identity.Client": { "type": "Transitive", - "resolved": "4.21.1", - "contentHash": "vycgk7S/HAbHaUaK4Tid1fsWHsXdFRRP2KavAIOHCVV27zvuQfYAjXmMvctuuF4egydSumG58CwPZob3gWeYgQ==" + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } }, "Microsoft.IdentityModel.Abstractions": { "type": "Transitive", "resolved": "6.25.0", "contentHash": "70MbUvri/xthpVpSEve7X6ysNtTe5MgLEgNyhnZ5z7WXVgFOkUfI7RNtqS6oenLoaaMpnRJrrZFt9Pps5NknBQ==" }, - "Microsoft.IdentityModel.Clients.ActiveDirectory": { - "type": "Transitive", - "resolved": "5.2.8", - "contentHash": "VIi6Bzt0UWEeannuEjtRFr/LgUXXw70a9LlIVfoCGorztZhzHgKiof6UJE1ETRYlf/L+kepsUZeekYZwqb6xPg==", - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Net.Http": "4.3.4", - "System.Private.Uri": "4.3.2", - "System.Runtime.Serialization.Formatters": "4.3.0", - "System.Runtime.Serialization.Json": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.SecureString": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "Microsoft.IdentityModel.JsonWebTokens": { "type": "Transitive", "resolved": "6.25.0", @@ -638,8 +623,8 @@ }, "Microsoft.NETCore.Targets": { "type": "Transitive", - "resolved": "1.1.3", - "contentHash": "3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==" + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, "Microsoft.Win32.Primitives": { "type": "Transitive", @@ -728,18 +713,18 @@ }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" + "resolved": "4.3.0", + "contentHash": "HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==" }, "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" + "resolved": "4.3.0", + "contentHash": "+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==" }, "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" + "resolved": "4.3.0", + "contentHash": "c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==" }, "runtime.native.System": { "type": "Transitive", @@ -778,30 +763,30 @@ }, "runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", + "resolved": "4.3.0", + "contentHash": "NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" + "resolved": "4.3.0", + "contentHash": "b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==" }, "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" + "resolved": "4.3.0", + "contentHash": "KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==" }, "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { "type": "Transitive", @@ -810,28 +795,28 @@ }, "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" + "resolved": "4.3.0", + "contentHash": "X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==" }, "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" + "resolved": "4.3.0", + "contentHash": "nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==" }, "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" + "resolved": "4.3.0", + "contentHash": "ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==" }, "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" + "resolved": "4.3.0", + "contentHash": "I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==" }, "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" + "resolved": "4.3.0", + "contentHash": "VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==" }, "System.AppContext": { "type": "Transitive", @@ -918,8 +903,8 @@ }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.ComponentModel.Primitives": { "type": "Transitive", @@ -1208,6 +1193,11 @@ "System.Runtime": "4.3.0" } }, + "System.IO.Hashing": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Rfm2jYCaUeGysFEZjDe7j1R4x6Z6BzumS/vUT5a1AA/AWJuGX71PoGB0RmpyX3VmrGqVnAwtfMn39OHR8Y/5+g==" + }, "System.Linq": { "type": "Transitive", "resolved": "4.3.0", @@ -1259,17 +1249,21 @@ "System.Runtime": "4.3.0" } }, - "System.Memory": { + "System.Memory.Data": { "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" + } }, "System.Net.Http": { "type": "Transitive", - "resolved": "4.3.4", - "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", + "resolved": "4.3.0", + "contentHash": "sYg+FtILtRQuYWSIAuNOELwVuVsxVyJGWQyOnlAzhV4xvhyFnON1bAzYYC+jjRW8JREM45R0R5Dgi8MTC5sEwA==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Platforms": "1.1.0", "System.Collections": "4.3.0", "System.Diagnostics.Debug": "4.3.0", "System.Diagnostics.DiagnosticSource": "4.3.0", @@ -1294,7 +1288,7 @@ "System.Threading.Tasks": "4.3.0", "runtime.native.System": "4.3.0", "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, "System.Net.Primitives": { @@ -1338,47 +1332,6 @@ "System.Threading": "4.3.0" } }, - "System.Private.DataContractSerialization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0", - "System.Xml.XmlSerializer": "4.3.0" - } - }, - "System.Private.Uri": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "Microsoft.NETCore.Targets": "1.1.3" - } - }, "System.Reflection": { "type": "Transitive", "resolved": "4.3.0", @@ -1540,37 +1493,6 @@ "System.Runtime.Extensions": "4.3.0" } }, - "System.Runtime.Serialization.Formatters": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - } - }, - "System.Runtime.Serialization.Json": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", - "dependencies": { - "System.IO": "4.3.0", - "System.Private.DataContractSerialization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Serialization.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", - "dependencies": { - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - } - }, "System.Security.AccessControl": { "type": "Transitive", "resolved": "6.0.0", @@ -1726,21 +1648,6 @@ "resolved": "4.7.0", "contentHash": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==" }, - "System.Security.SecureString": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } - }, "System.Text.Encoding": { "type": "Transitive", "resolved": "4.3.0", @@ -1816,8 +1723,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.5.2", - "contentHash": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==" + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" }, "System.Threading.Timer": { "type": "Transitive", @@ -1895,30 +1802,6 @@ "System.Xml.ReaderWriter": "4.3.0" } }, - "System.Xml.XmlSerializer": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "System.Xml.XPath": { "type": "Transitive", "resolved": "4.3.0", @@ -1971,7 +1854,7 @@ "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", "Microsoft.Extensions.Caching.Abstractions": "[7.0.0, )", - "Microsoft.IdentityModel.Clients.ActiveDirectory": "[5.2.8, )", + "Microsoft.Identity.Client": "[4.50.0, )", "Newtonsoft.Json": "[13.0.2, )", "System.IdentityModel.Tokens.Jwt": "[6.25.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -1980,7 +1863,7 @@ "videoapi.contract": { "type": "Project", "dependencies": { - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.domain": { @@ -1988,13 +1871,13 @@ "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.services": { "type": "Project", "dependencies": { - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "Microsoft.AspNetCore.Mvc.Abstractions": "[2.2.0, )", "Microsoft.Extensions.Configuration": "[7.0.0, )", "Polly": "[7.2.0, )", diff --git a/VideoApi/VideoApi.Domain/VideoApi.Domain.csproj b/VideoApi/VideoApi.Domain/VideoApi.Domain.csproj index 838c2259e..125dc9fbd 100644 --- a/VideoApi/VideoApi.Domain/VideoApi.Domain.csproj +++ b/VideoApi/VideoApi.Domain/VideoApi.Domain.csproj @@ -6,10 +6,10 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file diff --git a/VideoApi/VideoApi.Events/VideoApi.Events.csproj b/VideoApi/VideoApi.Events/VideoApi.Events.csproj index fae9d3f48..42a91b34a 100644 --- a/VideoApi/VideoApi.Events/VideoApi.Events.csproj +++ b/VideoApi/VideoApi.Events/VideoApi.Events.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VideoApi/VideoApi.IntegrationTests/Api/AudioRecordings/GetAudioRecordingLinkTests.cs b/VideoApi/VideoApi.IntegrationTests/Api/AudioRecordings/GetAudioRecordingLinkTests.cs new file mode 100644 index 000000000..6b305ca5d --- /dev/null +++ b/VideoApi/VideoApi.IntegrationTests/Api/AudioRecordings/GetAudioRecordingLinkTests.cs @@ -0,0 +1,97 @@ +using System; +using System.Net; +using FluentAssertions; +using Microsoft.Extensions.Configuration; +using NUnit.Framework; +using Testing.Common; +using Testing.Common.Helper; +using Testing.Common.Helper.Builders.Domain; +using VideoApi.Common.Configuration; +using VideoApi.Contract.Responses; +using VideoApi.Domain; +using VideoApi.IntegrationTests.Api.Setup; +using VideoApi.IntegrationTests.Helper; +using Task = System.Threading.Tasks.Task; + +namespace VideoApi.IntegrationTests.Api.AudioRecordings; + +[Category("azurite")] +public class GetAudioRecordingLinkTests : ApiTest +{ + private Conference _conference; + private AzureStorageManager _azureStorageManager; + + [TearDown] + public async Task TearDown() + { + if (_conference != null) + { + await TestDataManager.RemoveConference(_conference.Id); + _conference = null; + } + + if (_azureStorageManager != null) + { + await _azureStorageManager.RemoveAudioFileFromStorage(); + _azureStorageManager = null; + } + } + + [Test] + public async Task should_return_an_empty_list_when_no_recordings_are_found() + { + // arrange + var hearingId = Guid.NewGuid(); + + // act + using var client = Application.CreateClient(); + var result = + await client.GetAsync(ApiUriFactory.AudioRecordingEndpoints.GetAudioRecordingLink(hearingId)); + + // assert + result.IsSuccessStatusCode.Should().BeTrue(); + result.StatusCode.Should().Be(HttpStatusCode.OK); + + var audioRecording = await ApiClientResponse.GetResponses(result.Content); + audioRecording.Should().NotBeNull(); + audioRecording.AudioFileLinks.Should().BeNullOrEmpty(); + } + + [Test] + public async Task should_return_a_list_of_audio_recording_for_a_hearing() + { + // arrange + var conferenceWithMessages = new ConferenceBuilder(ignoreId: true).Build(); + _conference = await TestDataManager.SeedConference(conferenceWithMessages); + await SeedAudioRecordingIntoStorage(_conference.HearingRefId); + + // act + using var client = Application.CreateClient(); + var result = + await client.GetAsync(ApiUriFactory.AudioRecordingEndpoints.GetAudioRecordingLink(_conference.HearingRefId)); + + + // assert + result.IsSuccessStatusCode.Should().BeTrue(); + result.StatusCode.Should().Be(HttpStatusCode.OK); + + var audioRecording = await ApiClientResponse.GetResponses(result.Content); + audioRecording.Should().NotBeNull(); + audioRecording.AudioFileLinks.Should().NotBeNullOrEmpty(); + + } + + private async Task SeedAudioRecordingIntoStorage(Guid hearingRefId) + { + var wowzaConfiguration = ConfigRoot.GetSection("WowzaConfiguration").Get(); + var azureStorageConnectionString = ConfigRoot.GetValue("Azure:StorageConnectionString"); + _azureStorageManager = new AzureStorageManager() + .SetStorageContainerName(wowzaConfiguration.StorageContainerName) + .CreateBlobClient(hearingRefId.ToString(), azureStorageConnectionString); + + var file = FileManager.CreateNewAudioFile("TestAudioFile.mp4", hearingRefId.ToString()); + + await _azureStorageManager.UploadAudioFileToStorage(file); + FileManager.RemoveLocalAudioFile(file); + } +} diff --git a/VideoApi/VideoApi.IntegrationTests/Api/InstantMessages/GetInstantMessageHistoryTests.cs b/VideoApi/VideoApi.IntegrationTests/Api/InstantMessages/GetInstantMessageHistoryTests.cs new file mode 100644 index 000000000..15f4e5593 --- /dev/null +++ b/VideoApi/VideoApi.IntegrationTests/Api/InstantMessages/GetInstantMessageHistoryTests.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Net; +using FluentAssertions; +using NUnit.Framework; +using Testing.Common.Helper; +using Testing.Common.Helper.Builders.Domain; +using VideoApi.Contract.Responses; +using VideoApi.Domain; +using VideoApi.IntegrationTests.Api.Setup; +using VideoApi.IntegrationTests.Helper; +using Task = System.Threading.Tasks.Task; + +namespace VideoApi.IntegrationTests.Api.InstantMessages; + +public class GetInstantMessageHistoryTests : ApiTest +{ + private Conference _conference; + + [TearDown] + public async Task TearDown() + { + if (_conference != null) + { + await TestDataManager.RemoveConference(_conference.Id); + _conference = null; + } + } + + [Test] + public async Task should_get_messages_for_a_conference() + { + // arrange + var scheduledDateTime = DateTime.Today.AddHours(10); + var conferenceWithMessages = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) + .WithMessages(3).Build(); + _conference = await TestDataManager.SeedConference(conferenceWithMessages); + + // act + using var client = Application.CreateClient(); + var result = + await client.GetAsync(ApiUriFactory.InstantMessageEndpoints.GetInstantMessageHistory(_conference.Id)); + + // assert + result.IsSuccessStatusCode.Should().BeTrue(); + result.StatusCode.Should().Be(HttpStatusCode.OK); + + var messages = await ApiClientResponse.GetResponses>(result.Content); + messages.Should().NotBeNullOrEmpty(); + messages.Should().BeInDescendingOrder(x => x.TimeStamp); + + var from = conferenceWithMessages.InstantMessageHistory[0].From; + var to = conferenceWithMessages.InstantMessageHistory[0].To; + var messageText = conferenceWithMessages.InstantMessageHistory[0].MessageText; + foreach (var message in messages) + { + message.From.Should().Be(from); + message.MessageText.Should().Be(messageText); + message.To.Should().Be(to); + } + } + + [Test] + public async Task should_return_an_empty_list_for_a_nonexistent_conference() + { + // arrange + var conferenceId = Guid.NewGuid(); + + // act + using var client = Application.CreateClient(); + var result = + await client.GetAsync(ApiUriFactory.InstantMessageEndpoints.GetInstantMessageHistory(conferenceId)); + + // assert + result.IsSuccessStatusCode.Should().BeTrue(); + result.StatusCode.Should().Be(HttpStatusCode.OK); + var messages = await ApiClientResponse.GetResponses>(result.Content); + messages.Should().BeEmpty(); + } +} diff --git a/VideoApi/VideoApi.IntegrationTests/Api/Setup/ApiTest.cs b/VideoApi/VideoApi.IntegrationTests/Api/Setup/ApiTest.cs new file mode 100644 index 000000000..534662816 --- /dev/null +++ b/VideoApi/VideoApi.IntegrationTests/Api/Setup/ApiTest.cs @@ -0,0 +1,51 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using NUnit.Framework; +using Testing.Common.Configuration; +using VideoApi.Common.Configuration; +using VideoApi.Common.Security.Kinly; +using VideoApi.DAL; +using VideoApi.IntegrationTests.Helper; + +namespace VideoApi.IntegrationTests.Api.Setup +{ + public class ApiTest + { + protected VhApiWebApplicationFactory Application = null!; + protected TestDataManager TestDataManager = null!; + protected DbContextOptions DbOptions { get; private set; } + protected IConfigurationRoot ConfigRoot; + private string _databaseConnectionString; + private KinlyConfiguration _kinlyConfiguration; + private ServicesConfiguration _services; + + [OneTimeSetUp] + public void OneTimeSetup() + { + RegisterSettings(); + Application = new VhApiWebApplicationFactory(ConfigRoot); + InitTestDataManager(); + } + + private void InitTestDataManager() + { + var dbContextOptionsBuilder = new DbContextOptionsBuilder(); + dbContextOptionsBuilder.UseSqlServer(_databaseConnectionString); + DbOptions = dbContextOptionsBuilder.Options; + + var context = new VideoApiDbContext(DbOptions); + context.Database.Migrate(); + + TestDataManager = new TestDataManager(_kinlyConfiguration, dbContextOptionsBuilder.Options); + } + + private void RegisterSettings() + { + ConfigRoot = ConfigRootBuilder.Build(); + _services = ConfigRoot.GetSection("Services").Get(); + _kinlyConfiguration = ConfigRoot.GetSection("KinlyConfiguration").Get(); + _kinlyConfiguration.CallbackUri = _services.CallbackUri; + _databaseConnectionString = ConfigRoot.GetConnectionString("VideoApi"); + } + } +} diff --git a/VideoApi/VideoApi.IntegrationTests/Api/Setup/VhApiWebApplicationFactory.cs b/VideoApi/VideoApi.IntegrationTests/Api/Setup/VhApiWebApplicationFactory.cs new file mode 100644 index 000000000..14ef9844f --- /dev/null +++ b/VideoApi/VideoApi.IntegrationTests/Api/Setup/VhApiWebApplicationFactory.cs @@ -0,0 +1,78 @@ +using System.Linq; +using System.Net.Http; +using GST.Fake.Authentication.JwtBearer; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Testing.Common; +using VideoApi.Common.Configuration; +using VideoApi.Services; +using VideoApi.Services.Contracts; + +namespace VideoApi.IntegrationTests.Api.Setup +{ + public class VhApiWebApplicationFactory : WebApplicationFactory + { + private readonly IConfigurationRoot _configRoot; + + public VhApiWebApplicationFactory(IConfigurationRoot configRoot) + { + _configRoot = configRoot; + } + + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureTestServices(services => + { + services.AddAuthentication(options => + { + options.DefaultScheme = FakeJwtBearerDefaults.AuthenticationScheme; + options.DefaultAuthenticateScheme = FakeJwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = FakeJwtBearerDefaults.AuthenticationScheme; + }).AddFakeJwtBearer(); + + RegisterAzuriteStorageService(services); + RegisterStubs(services); + }); + builder.UseEnvironment("Development"); + } + + private void RegisterAzuriteStorageService(IServiceCollection services) + { + // Remove application existing IAzureStorageService service and replace with azurite one + var azStorageServices = services.Where(d => d.ServiceType == typeof(IAzureStorageService)).ToList(); + foreach (var azStorageService in azStorageServices) + { + services.Remove(azStorageService); + } + var azureStorageConnectionString = _configRoot.GetValue("Azure:StorageConnectionString"); + var serviceClient = AzureStorageManager.CreateAzuriteBlobServiceClient(azureStorageConnectionString); + var blobClientExtension = new BlobClientExtension(); + + var wowzaConfiguration = _configRoot.GetSection("WowzaConfiguration").Get(); + var cvpConfiguration = _configRoot.GetSection("CvpConfiguration").Get(); + + services.AddSingleton(_ => + new VhAzureStorageService(serviceClient, wowzaConfiguration, false, blobClientExtension)); + services.AddSingleton(_ => + new CvpAzureStorageService(serviceClient, cvpConfiguration, false, blobClientExtension)); + } + + private static void RegisterStubs(IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + + protected override void ConfigureClient(HttpClient client) + { + base.ConfigureClient(client); + client.SetFakeBearerToken("admin", new[] { "ROLE_ADMIN", "ROLE_GENTLEMAN" }); + } + + } +} diff --git a/VideoApi/VideoApi.IntegrationTests/Contexts/TestContext.cs b/VideoApi/VideoApi.IntegrationTests/Contexts/TestContext.cs index ae354205c..2d465ef80 100644 --- a/VideoApi/VideoApi.IntegrationTests/Contexts/TestContext.cs +++ b/VideoApi/VideoApi.IntegrationTests/Contexts/TestContext.cs @@ -1,8 +1,9 @@ using System.Net.Http; using AcceptanceTests.Common.Api; -using AcceptanceTests.Common.AudioRecordings; +using GST.Fake.Authentication.JwtBearer; using Microsoft.AspNetCore.TestHost; using Microsoft.EntityFrameworkCore; +using Testing.Common; using Testing.Common.Configuration; using VideoApi.DAL; using VideoApi.IntegrationTests.Helper; @@ -44,7 +45,7 @@ public HttpClient CreateClient() client = Server.CreateClient(); } - client.DefaultRequestHeaders.Add("Authorization", $"Bearer {Tokens.VideoApiBearerToken}"); + client.SetFakeBearerToken("admin", new[] { "ROLE_ADMIN", "ROLE_GENTLEMAN" }); return client; } } diff --git a/VideoApi/VideoApi.IntegrationTests/Database/Commands/AnonymiseConferencesCommandTests.cs b/VideoApi/VideoApi.IntegrationTests/Database/Commands/AnonymiseConferencesCommandTests.cs index f1a9c368f..d723c643e 100644 --- a/VideoApi/VideoApi.IntegrationTests/Database/Commands/AnonymiseConferencesCommandTests.cs +++ b/VideoApi/VideoApi.IntegrationTests/Database/Commands/AnonymiseConferencesCommandTests.cs @@ -1,8 +1,8 @@ -using FluentAssertions; -using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; +using FluentAssertions; +using NUnit.Framework; using Testing.Common.Helper.Builders.Domain; using VideoApi.DAL; using VideoApi.DAL.Commands; @@ -16,10 +16,7 @@ namespace VideoApi.IntegrationTests.Database.Commands public class AnonymiseConferencesCommandTests : DatabaseTestsBase { private AnonymiseConferencesCommandHandler _handler; - private Guid _conference1Id; - private Guid _conference2Id; - private Guid _conference3Id; - private List conferenceList; + private List conferenceList; private GetConferenceByIdQueryHandler _handlerGetConferenceByIdQueryHandler; [SetUp] @@ -27,17 +24,14 @@ public void Setup() { var context = new VideoApiDbContext(VideoBookingsDbContextOptions); _handler = new AnonymiseConferencesCommandHandler(context); - _conference1Id = Guid.Empty; - _conference2Id = Guid.Empty; - _conference3Id = Guid.Empty; _handlerGetConferenceByIdQueryHandler = new GetConferenceByIdQueryHandler(context); } [Test] public async Task Should_anonymise_data_older_than_three_months() { - conferenceList = new List(); - var conferenceType = typeof(Domain.Conference); + conferenceList = new List(); + var conferenceType = typeof(Conference); var utcDate = DateTime.UtcNow; var hearingClosed3Months = utcDate.AddMonths(-3).AddMinutes(-50); @@ -47,7 +41,6 @@ public async Task Should_anonymise_data_older_than_three_months() .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference1, DateTime.UtcNow.AddMonths(-3).AddMinutes(-10)); - _conference1Id = conference1.Id; conferenceList.Add(conference1); var conference1Rep = (Participant)conference1.Participants.FirstOrDefault(p => p.UserRole == UserRole.Representative); @@ -77,8 +70,8 @@ public async Task Should_anonymise_data_older_than_three_months() [Test] public async Task Should_not_anonymise_data_older_than_two_months_and_less_than_three_months() { - conferenceList = new List(); - var conferenceType = typeof(Domain.Conference); + conferenceList = new List(); + var conferenceType = typeof(Conference); var utcDate = DateTime.UtcNow; var hearingclosed1Month = utcDate.AddMonths(-1).AddMinutes(-50); @@ -88,7 +81,6 @@ public async Task Should_not_anonymise_data_older_than_two_months_and_less_than_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference2, DateTime.UtcNow.AddMonths(-1).AddMinutes(-10)); - _conference2Id = conference2.Id; conferenceList.Add(conference2); var conference2Rep = conference2.Participants.FirstOrDefault(p => p.UserRole == UserRole.Representative); @@ -112,7 +104,7 @@ public async Task Should_not_anonymise_data_older_than_two_months_and_less_than_ [Test] public async Task Should_not_anonymise_data_for_future_hearings() { - conferenceList = new List(); + conferenceList = new List(); var utcDate = DateTime.UtcNow; var futureHearing = utcDate.AddMonths(1); @@ -121,7 +113,6 @@ public async Task Should_not_anonymise_data_for_future_hearings() .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) .Build(); - _conference3Id = conference3.Id; conferenceList.Add(conference3); var conference3Rep = conference3.Participants.FirstOrDefault(p => p.UserRole == UserRole.Representative); @@ -145,8 +136,8 @@ public async Task Should_not_anonymise_data_for_future_hearings() [Test] public async Task Should_not_anonymise_data_that_has_been_anonymised() { - conferenceList = new List(); - var conferenceType = typeof(Domain.Conference); + conferenceList = new List(); + var conferenceType = typeof(Conference); var utcDate = DateTime.UtcNow; var hearingClosed3Months = utcDate.AddMonths(-3).AddMinutes(-50); @@ -156,7 +147,6 @@ public async Task Should_not_anonymise_data_that_has_been_anonymised() .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference1, DateTime.UtcNow.AddMonths(-3).AddMinutes(-10)); - _conference1Id = conference1.Id; conferenceList.Add(conference1); var conference1Rep = (Participant)conference1.Participants.FirstOrDefault(p => p.UserRole == UserRole.Representative); diff --git a/VideoApi/VideoApi.IntegrationTests/Database/DatabaseTestsBase.cs b/VideoApi/VideoApi.IntegrationTests/Database/DatabaseTestsBase.cs index ef95bbd38..358d69882 100644 --- a/VideoApi/VideoApi.IntegrationTests/Database/DatabaseTestsBase.cs +++ b/VideoApi/VideoApi.IntegrationTests/Database/DatabaseTestsBase.cs @@ -1,8 +1,8 @@ using VideoApi.DAL; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Options; using NUnit.Framework; +using Testing.Common.Configuration; using VideoApi.Common.Security.Kinly; using VideoApi.IntegrationTests.Helper; @@ -18,21 +18,14 @@ public abstract class DatabaseTestsBase [OneTimeSetUp] public void OneTimeSetup() { - var configRootBuilder = new ConfigurationBuilder() - .AddJsonFile("appsettings.json") - .AddEnvironmentVariables() - .AddUserSecrets(); - - var configRoot = configRootBuilder.Build(); + var configRoot = ConfigRootBuilder.Build(); + _kinlyConfiguration = configRoot.GetSection("KinlyConfiguration").Get(); + _databaseConnectionString = configRoot.GetConnectionString("VideoApi"); - _kinlyConfiguration = Options.Create(configRoot.GetSection("KinlyConfiguration").Get()).Value; - var dbContextOptionsBuilder = new DbContextOptionsBuilder(); - dbContextOptionsBuilder.EnableSensitiveDataLogging(); dbContextOptionsBuilder.UseSqlServer(_databaseConnectionString); - dbContextOptionsBuilder.EnableSensitiveDataLogging(); + VideoBookingsDbContextOptions = dbContextOptionsBuilder.Options; - var context = new VideoApiDbContext(VideoBookingsDbContextOptions); context.Database.Migrate(); diff --git a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetClosedConferencesTests.cs b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetClosedConferencesTests.cs index b17554917..48cce5721 100644 --- a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetClosedConferencesTests.cs +++ b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetClosedConferencesTests.cs @@ -14,13 +14,6 @@ namespace VideoApi.IntegrationTests.Database.Queries public class GetClosedConferencesTests : DatabaseTestsBase { private GetClosedConferencesWithInstantMessagesHandler _handler; - private Guid _conference1Id; - private Guid _conference2Id; - private Guid _conference3Id; - private Guid _conference4Id; - private Guid _conference5Id; - private Guid _conference6Id; - private Guid _conference7Id; private List conferenceList; [SetUp] @@ -28,13 +21,6 @@ public void Setup() { var context = new VideoApiDbContext(VideoBookingsDbContextOptions); _handler = new GetClosedConferencesWithInstantMessagesHandler(context); - _conference1Id = Guid.Empty; - _conference2Id = Guid.Empty; - _conference3Id = Guid.Empty; - _conference4Id = Guid.Empty; - _conference5Id = Guid.Empty; - _conference6Id = Guid.Empty; - _conference7Id = Guid.Empty; } [TearDown] @@ -63,7 +49,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) .Build(); - _conference1Id = conference1.Id; conferenceList.Add(conference1); // closed conferences with no messages. @@ -73,7 +58,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference2, DateTime.UtcNow.AddMinutes(-35)); - _conference2Id = conference2.Id; conferenceList.Add(conference2); var conference3 = new ConferenceBuilder(true, scheduledDateTime: oldHearing) @@ -82,7 +66,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference3, DateTime.UtcNow.AddMinutes(-25)); - _conference3Id = conference3.Id; conferenceList.Add(conference3); // closed conferences with messages. @@ -93,7 +76,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference4, DateTime.UtcNow.AddMinutes(-31)); - _conference4Id = conference4.Id; conferenceList.Add(conference4); var conference5 = new ConferenceBuilder(true, scheduledDateTime: oldHearing) @@ -103,7 +85,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference5, DateTime.UtcNow.AddMinutes(-30)); - _conference5Id = conference5.Id; conferenceList.Add(conference5); var conference6 = new ConferenceBuilder(true, scheduledDateTime: oldHearing) @@ -113,7 +94,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference6, DateTime.UtcNow.AddMinutes(-29)); - _conference6Id = conference6.Id; conferenceList.Add(conference6); var conference7 = new ConferenceBuilder(true, scheduledDateTime: veryOldHearing) @@ -123,7 +103,6 @@ public async Task Should_return_closed_conferences_with_im_messages_closed_over_ .WithConferenceStatus(ConferenceState.Closed) .Build(); conferenceType.GetProperty("ClosedDateTime").SetValue(conference7, DateTime.UtcNow.AddMonths(-3)); - _conference7Id = conference7.Id; conferenceList.Add(conference7); foreach (var c in conferenceList) diff --git a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByIndividualQueryTests.cs b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByIndividualQueryTests.cs index 8b2ca7223..fd0696985 100644 --- a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByIndividualQueryTests.cs +++ b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByIndividualQueryTests.cs @@ -43,7 +43,8 @@ public void Setup() public async Task Should_get_conference_with_meeting_room_for_username() { const string username = "Automation_knownuser@hmcts.net"; - var conference1 = new ConferenceBuilder(true) + var scheduledDateTime = DateTime.Today.AddHours(10).AddMinutes(40); + var conference1 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Closed) @@ -51,7 +52,7 @@ public async Task Should_get_conference_with_meeting_room_for_username() .Build(); _newConferenceId1 = conference1.Id; - var conference2 = new ConferenceBuilder(true) + var conference2 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) @@ -59,7 +60,7 @@ public async Task Should_get_conference_with_meeting_room_for_username() .Build(); _newConferenceId2 = conference2.Id; - var conference3 = new ConferenceBuilder(true) + var conference3 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Paused) @@ -67,7 +68,7 @@ public async Task Should_get_conference_with_meeting_room_for_username() .Build(); _newConferenceId3 = conference3.Id; - var conference4 = new ConferenceBuilder(true) + var conference4 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Suspended) @@ -83,14 +84,14 @@ public async Task Should_get_conference_with_meeting_room_for_username() .Build(); _newConferenceId5 = conference5.Id; - var conference6 = new ConferenceBuilder(true) + var conference6 =new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent") .WithParticipant(UserRole.Judge, null) .WithMeetingRoom("https://poc.node.com", "user@hmcts.net") .Build(); _newConferenceId6 = conference6.Id; - var conference7 = new ConferenceBuilder(true) + var conference7 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) @@ -98,7 +99,7 @@ public async Task Should_get_conference_with_meeting_room_for_username() .Build(); _newConferenceId7 = conference7.Id; - var conference8 = new ConferenceBuilder(true) + var conference8 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) diff --git a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByJudgeQueryTests.cs b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByJudgeQueryTests.cs index f8f39655d..a3cedd631 100644 --- a/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByJudgeQueryTests.cs +++ b/VideoApi/VideoApi.IntegrationTests/Database/Queries/GetConferencesForTodayByJudgeQueryTests.cs @@ -43,7 +43,8 @@ public void Setup() public async Task Should_get_conference_with_meeting_room_for_judge() { var username = "Automation_knownuser@hmcts.net"; - var conference1 = new ConferenceBuilder(true) + var scheduledDateTime = DateTime.Today.AddHours(10).AddMinutes(40); + var conference1 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Closed) @@ -51,7 +52,7 @@ public async Task Should_get_conference_with_meeting_room_for_judge() .Build(); _newConferenceId1 = conference1.Id; - var conference2 = new ConferenceBuilder(true) + var conference2 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) @@ -59,7 +60,7 @@ public async Task Should_get_conference_with_meeting_room_for_judge() .Build(); _newConferenceId2 = conference2.Id; - var conference3 = new ConferenceBuilder(true) + var conference3 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Paused) @@ -67,7 +68,7 @@ public async Task Should_get_conference_with_meeting_room_for_judge() .Build(); _newConferenceId3 = conference3.Id; - var conference4 = new ConferenceBuilder(true) + var conference4 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.Suspended) @@ -83,14 +84,14 @@ public async Task Should_get_conference_with_meeting_room_for_judge() .Build(); _newConferenceId5 = conference5.Id; - var conference6 = new ConferenceBuilder(true) + var conference6 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent") .WithParticipant(UserRole.Judge, null) .WithMeetingRoom("https://poc.node.com", "user@hmcts.net") .Build(); _newConferenceId6 = conference6.Id; - var conference7 = new ConferenceBuilder(true) + var conference7 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) @@ -98,7 +99,7 @@ public async Task Should_get_conference_with_meeting_room_for_judge() .Build(); _newConferenceId7 = conference7.Id; - var conference8 = new ConferenceBuilder(true) + var conference8 = new ConferenceBuilder(ignoreId: true, scheduledDateTime: scheduledDateTime) .WithParticipant(UserRole.Representative, "Respondent", username) .WithParticipant(UserRole.Judge, null) .WithConferenceStatus(ConferenceState.InSession) diff --git a/VideoApi/VideoApi.IntegrationTests/Features/AudioRecording.feature b/VideoApi/VideoApi.IntegrationTests/Features/AudioRecording.feature deleted file mode 100644 index 7652b047a..000000000 --- a/VideoApi/VideoApi.IntegrationTests/Features/AudioRecording.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Audio Recording - In order to enable the audio recordings of hearings - As an api service - I want to enable CRUD processes for audio recordings - - @VIH-5868 - Scenario: Get Audio Application - OK - Given I have a conference - And the conference has an audio application - And I have a valid get audio application request - When I send the request to the endpoint - Then the response should have the status Ok and success status True - And the audio application details are retrieved - - @VIH-5868 - Scenario: Delete Audio Application - OK - Given I have a conference - And the conference has an audio application - And I have an audio recording - And I have a valid delete audio application request - When I send the request to the endpoint - Then the response should have the status NoContent and success status True - - @VIH-5868 - Scenario: Get Audio Recording Link - OK - Given I have a conference - And I have an audio recording - And I have a valid get audio recording link request - When I send the request to the endpoint - Then the response should have the status Ok and success status True - And the audio recording link details are retrieved - - @VIH-5868 @VIH-6232 - Scenario: Get Audio Recording Link - Empty list - Given I have a nonexistent get audio recording link request - When I send the request to the endpoint - Then the response should have the status Ok and success status True - And the audio recording link details are empty diff --git a/VideoApi/VideoApi.IntegrationTests/Features/Callbacks.feature b/VideoApi/VideoApi.IntegrationTests/Features/Callbacks.feature index b8157c715..6c70329c6 100644 --- a/VideoApi/VideoApi.IntegrationTests/Features/Callbacks.feature +++ b/VideoApi/VideoApi.IntegrationTests/Features/Callbacks.feature @@ -6,12 +6,12 @@ Feature: Callbacks Scenario: Fail to send an event request for non-existent conference Given I have a nonexistent conference event request When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Fail to send an event request for non-existent participant in conference Given I have a room transfer event request for a nonexistent participant When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Fail to send an event invalid request Given I have an invalid conference event request diff --git a/VideoApi/VideoApi.IntegrationTests/Features/Endpoints.feature b/VideoApi/VideoApi.IntegrationTests/Features/Endpoints.feature index 36fb54f61..1068e44c0 100644 --- a/VideoApi/VideoApi.IntegrationTests/Features/Endpoints.feature +++ b/VideoApi/VideoApi.IntegrationTests/Features/Endpoints.feature @@ -57,13 +57,13 @@ Feature: Endpoints Scenario: Add endpoint to non-existent conference Given I have an add endpoint to a non-existent conference request When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Remove non-existent endpoint Given I have a conference with no endpoints And I have remove non-existent endpoint from a conference request When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Remove an endpoint from a conference Given I have a conference with endpoints @@ -75,7 +75,7 @@ Scenario: Update non-existent endpoint Given I have a conference with no endpoints And I have update to a non-existent endpoint for a conference request When I send the request to the endpoint - Then the response should have the status InternalServerError and success status False + Then the response should have the status BadRequest and success status False Scenario: Update an endpoint from a conference Given I have a conference with endpoints diff --git a/VideoApi/VideoApi.IntegrationTests/Features/InstantMessages.feature b/VideoApi/VideoApi.IntegrationTests/Features/InstantMessages.feature index aac774f27..14b3ca089 100644 --- a/VideoApi/VideoApi.IntegrationTests/Features/InstantMessages.feature +++ b/VideoApi/VideoApi.IntegrationTests/Features/InstantMessages.feature @@ -3,19 +3,6 @@ Feature: Instant Messages As an API service I want to save message and retrieve messages - Scenario: Get instant messages - Given I have a conference - And the conference has messages - And I have a valid get instant messages request - When I send the request to the endpoint - Then the response should have the status OK and success status True - And the chat message should be retrieved - - Scenario: Get instant messages with a nonexistent conference - Given I have a nonexistent get instant messages request - When I send the request to the endpoint - Then the response should have the status Ok and success status True - Scenario: Set instant messages Given I have a conference And I have a valid set instant message request diff --git a/VideoApi/VideoApi.IntegrationTests/Helper/Response.cs b/VideoApi/VideoApi.IntegrationTests/Helper/ApiClientResponse.cs similarity index 89% rename from VideoApi/VideoApi.IntegrationTests/Helper/Response.cs rename to VideoApi/VideoApi.IntegrationTests/Helper/ApiClientResponse.cs index ba9f19602..6de2441dc 100644 --- a/VideoApi/VideoApi.IntegrationTests/Helper/Response.cs +++ b/VideoApi/VideoApi.IntegrationTests/Helper/ApiClientResponse.cs @@ -4,7 +4,7 @@ namespace VideoApi.IntegrationTests.Helper { - public static class Response + public static class ApiClientResponse { public static async Task GetResponses(HttpContent content) { diff --git a/VideoApi/VideoApi.IntegrationTests/Hooks/ConfigHooks.cs b/VideoApi/VideoApi.IntegrationTests/Hooks/ConfigHooks.cs index cdcf36d7f..b2ec3479b 100644 --- a/VideoApi/VideoApi.IntegrationTests/Hooks/ConfigHooks.cs +++ b/VideoApi/VideoApi.IntegrationTests/Hooks/ConfigHooks.cs @@ -1,22 +1,29 @@ +using System; using System.Collections.Generic; +using System.Linq; using System.Net.Http; -using AcceptanceTests.Common.Api; +using System.Security.Cryptography; +using Azure.Storage.Blobs; using FluentAssertions; +using GST.Fake.Authentication.JwtBearer; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; +using Moq; using TechTalk.SpecFlow; using Testing.Common.Configuration; using VideoApi.Common.Configuration; -using VideoApi.Common.Security; using VideoApi.Common.Security.Kinly; using VideoApi.DAL; using VideoApi.Domain; using VideoApi.IntegrationTests.Contexts; using VideoApi.IntegrationTests.Helper; +using VideoApi.Services; +using VideoApi.Services.Contracts; using ConfigurationManager = AcceptanceTests.Common.Configuration.ConfigurationManager; namespace VideoApi.IntegrationTests.Hooks @@ -24,19 +31,32 @@ namespace VideoApi.IntegrationTests.Hooks [Binding] public class ConfigHooks { - private readonly IConfigurationRoot _configRoot; + private const string KinlyApiSecretConfigKeyName = "KinlyConfiguration:ApiSecret"; + private const string KinlyCallbackSecretConfigKeyName = "KinlyConfiguration:CallbackSecret"; + + private static IConfigurationRoot _configRoot; public ConfigHooks(TestContext context) { - _configRoot = ConfigurationManager.BuildConfig("9AECE566-336D-4D16-88FA-7A76C27321CD"); context.Config = new Config(); context.Tokens = new VideoApiTokens(); } + /// + /// This will insert a random callback secret per test run + /// + private static void AddRandomAccountKey() + { + var secret = Convert.ToBase64String(new HMACSHA256().Key); + Environment.SetEnvironmentVariable(KinlyApiSecretConfigKeyName, secret); + Environment.SetEnvironmentVariable(KinlyCallbackSecretConfigKeyName, secret); + } + [BeforeScenario(Order = (int)HooksSequence.ConfigHooks)] public void RegisterSecrets(TestContext context) { - var azureOptions = RegisterAzureSecrets(context); + AddRandomAccountKey(); + _configRoot = ConfigRootBuilder.Build(); RegisterDefaultData(context); RegisterHearingServices(context); RegisterKinlySettings(context); @@ -45,15 +65,6 @@ public void RegisterSecrets(TestContext context) RegisterDatabaseSettings(context); RegisterServer(context); RegisterApiSettings(context); - GenerateBearerTokens(context, azureOptions); - } - - private IOptions RegisterAzureSecrets(TestContext context) - { - var azureOptions = Options.Create(_configRoot.GetSection("AzureAd").Get()); - context.Config.AzureAdConfiguration = azureOptions.Value; - ConfigurationManager.VerifyConfigValuesSet(context.Config.AzureAdConfiguration); - return azureOptions; } private static void RegisterDefaultData(TestContext context) @@ -69,13 +80,13 @@ private static void RegisterDefaultData(TestContext context) context.Test.CaseName.Should().NotBeNullOrWhiteSpace(); } - private void RegisterHearingServices(TestContext context) + private static void RegisterHearingServices(TestContext context) { context.Config.Services = Options.Create(_configRoot.GetSection("Services").Get()).Value; ConfigurationManager.VerifyConfigValuesSet(context.Config.Services); } - - private void RegisterKinlySettings(TestContext context) + + private static void RegisterKinlySettings(TestContext context) { context.Config.KinlyConfiguration = Options.Create(_configRoot.GetSection("KinlyConfiguration").Get()).Value; context.Config.KinlyConfiguration.CallbackUri = context.Config.Services.CallbackUri; @@ -83,7 +94,7 @@ private void RegisterKinlySettings(TestContext context) context.Config.KinlyConfiguration.KinlyApiUrl.Should().NotBeEmpty(); } - private void RegisterWowzaSettings(TestContext context) + private static void RegisterWowzaSettings(TestContext context) { context.Config.Wowza = Options.Create(_configRoot.GetSection("WowzaConfiguration").Get()).Value; context.Config.Wowza.StorageAccountKey.Should().NotBeNullOrEmpty(); @@ -91,7 +102,7 @@ private void RegisterWowzaSettings(TestContext context) context.Config.Wowza.StorageContainerName.Should().NotBeNullOrEmpty(); } - private void RegisterCvpSettings(TestContext context) + private static void RegisterCvpSettings(TestContext context) { context.Config.Cvp = Options.Create(_configRoot.GetSection("CvpConfiguration").Get()).Value; context.Config.Cvp.StorageAccountKey.Should().NotBeNullOrEmpty(); @@ -99,12 +110,11 @@ private void RegisterCvpSettings(TestContext context) context.Config.Cvp.StorageContainerName.Should().NotBeNullOrEmpty(); } - private void RegisterDatabaseSettings(TestContext context) + private static void RegisterDatabaseSettings(TestContext context) { context.Config.DbConnection = Options.Create(_configRoot.GetSection("ConnectionStrings").Get()).Value; ConfigurationManager.VerifyConfigValuesSet(context.Config.DbConnection); var dbContextOptionsBuilder = new DbContextOptionsBuilder(); - dbContextOptionsBuilder.EnableSensitiveDataLogging(); dbContextOptionsBuilder.UseSqlServer(context.Config.DbConnection.VideoApi); context.VideoBookingsDbContextOptions = dbContextOptionsBuilder.Options; context.TestDataManager = new TestDataManager(context.Config.KinlyConfiguration, context.VideoBookingsDbContextOptions); @@ -115,23 +125,60 @@ private static void RegisterServer(TestContext context) var webHostBuilder = WebHost.CreateDefaultBuilder() .UseKestrel(c => c.AddServerHeader = false) .UseEnvironment("Development") - .UseStartup(); + .UseStartup() + .ConfigureTestServices(services => + { + services.AddAuthentication(options => + { + options.DefaultScheme = FakeJwtBearerDefaults.AuthenticationScheme; + options.DefaultAuthenticateScheme = FakeJwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = FakeJwtBearerDefaults.AuthenticationScheme; + }).AddFakeJwtBearer(); + + RegisterAzuriteStorageService(context, services); + + RegisterStubs(services); + }); context.Server = new TestServer(webHostBuilder); } - private static void RegisterApiSettings(TestContext context) + private static void RegisterStubs(IServiceCollection services) { - context.Response = new HttpResponseMessage(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); } - private static void GenerateBearerTokens(TestContext context, IOptions azureOptions) + private static void RegisterAzuriteStorageService(TestContext context, IServiceCollection services) { - context.Tokens.VideoApiBearerToken = new AzureTokenProvider(azureOptions).GetClientAccessToken( - azureOptions.Value.ClientId, azureOptions.Value.ClientSecret, - context.Config.Services.VideoApiResourceId); - context.Tokens.VideoApiBearerToken.Should().NotBeNullOrEmpty(); + // Remove application IEmailProvider service + var azStorageServices = services.Where(d => d.ServiceType == typeof(IAzureStorageService)).ToList(); + foreach (var azStorageService in azStorageServices) + { + services.Remove(azStorageService); + } + + var blobConnectionString = _configRoot.GetValue("Azure:StorageConnectionString"); +#pragma warning disable + // This the default test secret available in public MS documentation + var connectionString = + "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"; +#pragma warning restore + var serviceClient = new BlobServiceClient(connectionString); + + NUnit.Framework.TestContext.WriteLine($"Blob connectionstring is {blobConnectionString}"); + var blobClientExtension = new BlobClientExtension(); - Zap.SetAuthToken(context.Tokens.VideoApiBearerToken); + services.AddSingleton(x => + new VhAzureStorageService(serviceClient, context.Config.Wowza, false, blobClientExtension)); + services.AddSingleton(x => + new CvpAzureStorageService(serviceClient, context.Config.Cvp, false, blobClientExtension)); + } + + private static void RegisterApiSettings(TestContext context) + { + context.Response = new HttpResponseMessage(); } } } diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/AudioRecordingSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/AudioRecordingSteps.cs deleted file mode 100644 index 41dc072b1..000000000 --- a/VideoApi/VideoApi.IntegrationTests/Steps/AudioRecordingSteps.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using AcceptanceTests.Common.AudioRecordings; -using FluentAssertions; -using TechTalk.SpecFlow; -using TechTalk.SpecFlow.Assist; -using Testing.Common.Configuration; -using VideoApi.Contract.Responses; -using VideoApi.IntegrationTests.Contexts; -using static Testing.Common.Helper.ApiUriFactory.AudioRecordingEndpoints; -using Response = VideoApi.IntegrationTests.Helper.Response; - -namespace VideoApi.IntegrationTests.Steps -{ - [Binding] - public sealed class AudioRecordingSteps : BaseSteps - { - private readonly TestContext _context; - private readonly CommonSteps _commonSteps; - - public AudioRecordingSteps(TestContext context, CommonSteps commonSteps) - { - _context = context; - _commonSteps = commonSteps; - } - - [Given(@"the conference has an audio application")] - public async Task GivenTheConferenceHasAnAudioApplication() - { - _context.Uri = GetAudioApplication(); - _context.HttpMethod = HttpMethod.Get; - await _commonSteps.WhenISendTheRequestToTheEndpoint(); - _context.Response.StatusCode.Should().Be(HttpStatusCode.OK); - } - - [Given(@"I have an audio recording")] - public async Task GivenIHaveAnAudioRecording() - { - var file = FileManager.CreateNewAudioFile("TestAudioFile.mp4", _context.Test.Conference.HearingRefId.ToString()); - - _context.AzureStorage = new AzureStorageManager() - .SetStorageAccountName(_context.Config.Wowza.StorageAccountName) - .SetStorageAccountKey(_context.Config.Wowza.StorageAccountKey) - .SetStorageContainerName(_context.Config.Wowza.StorageContainerName) - .CreateBlobClient(_context.Test.Conference.HearingRefId.ToString()); - - await _context.AzureStorage.UploadAudioFileToStorage(file); - FileManager.RemoveLocalAudioFile(file); - } - - [Given(@"Cvp has audio recordings")] - public async Task CvpHasAudioRecordings(Table table) - { - var parameters = table.CreateSet(); - var file = FileManager.CreateNewAudioFile("TestAudioFile.mp4", Guid.NewGuid().ToString()); - - _context.AzureStorage = new AzureStorageManager() - .SetStorageAccountName(_context.Config.Cvp.StorageAccountName) - .SetStorageAccountKey(_context.Config.Cvp.StorageAccountKey) - .SetStorageContainerName(_context.Config.Cvp.StorageContainerName) - .CreateBlobContainerClient(); - - _context.Test.CvpFileNamesOnStorage = new List(); - - foreach (var cvp in parameters) - { - var filePathOnStorage = $"audiostream{cvp.CloudRoom}/{cvp.CaseReference}-{cvp.Date}-{Guid.NewGuid()}.mp4"; - _context.Test.CvpFileNamesOnStorage.Add(filePathOnStorage); - - await _context.AzureStorage.UploadFileToStorage(file, filePathOnStorage); - } - - FileManager.RemoveLocalAudioFile(file); - } - - [Given(@"I have a valid get audio application request")] - public void GivenIHaveAValidGetAudioApplicationRequest() - { - _context.Uri = GetAudioApplicationWithHearingId(_context.Test.Conference.HearingRefId); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a nonexistent get audio application request")] - public void GivenIHaveANonexistentGetAudioApplicationRequest() - { - _context.Uri = GetAudioApplicationWithHearingId(Guid.NewGuid()); - _context.HttpMethod = HttpMethod.Get; - } - - - [Given(@"I have a valid delete audio application request")] - public void GivenIHaveAValidDeleteAudioApplicationRequest() - { - _context.Uri = DeleteAudioApplication(_context.Test.Conference.HearingRefId); - _context.HttpMethod = HttpMethod.Delete; - } - - [Given(@"I have a nonexistent delete audio application request")] - public void GivenIHaveANonexistentDeleteAudioApplicationRequest() - { - _context.Uri = DeleteAudioApplication(Guid.NewGuid()); - _context.HttpMethod = HttpMethod.Delete; - } - - [Given(@"I have a valid get audio stream request")] - public void GivenIHaveAValidGetAudioStreamRequest() - { - _context.Uri = GetAudioStream(_context.Test.Conference.HearingRefId); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a nonexistent get audio steam request")] - public void GivenIHaveANonexistentGetAudioSteamRequest() - { - _context.Uri = GetAudioStream(Guid.NewGuid()); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a valid get audio monitoring stream request")] - public void GivenIHaveAValidGetAudioMonitoringStreamRequest() - { - _context.Uri = GetAudioMonitoringStream(_context.Test.Conference.HearingRefId); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a nonexistent get audio monitoring steam request")] - public void GivenIHaveANonexistentGetAudioMonitoringSteamRequest() - { - _context.Uri = GetAudioMonitoringStream(Guid.NewGuid()); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a valid get audio recording link request")] - public void GivenIHaveAValidGetAudioRecordingLinkRequest() - { - _context.Uri = GetAudioRecordingLink(_context.Test.Conference.HearingRefId); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a valid get cvp audio recordings by all request for (.*) (.*) (.*)")] - public void GivenIHaveAValidGetCvpAudioRecordingByAllRequest(string cloudRoom, string date, string caseReference) - { - _context.Uri = GetCvpAudioRecordingsAll(cloudRoom, date, caseReference); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a valid get cvp audio recordings by cloud room request for (.*) (.*)")] - public void GivenIHaveAValidGetCvpAudioRecordingByCloudRoomRequest(string cloudRoom, string date) - { - _context.Uri = GetCvpAudioRecordingsByCloudRoom(cloudRoom, date); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a valid get cvp audio recordings by date request for (.*) (.*)")] - public void GivenIHaveAValidGetCvpAudioRecordingByDateRequest(string date, string caseReference) - { - _context.Uri = GetCvpAudioRecordingsByDate(date, caseReference); - _context.HttpMethod = HttpMethod.Get; - } - - [Given(@"I have a nonexistent get audio recording link request")] - public void GivenIHaveANonexistentGetAudioRecordingLinkRequest() - { - _context.Uri = GetAudioRecordingLink(Guid.NewGuid()); - _context.HttpMethod = HttpMethod.Get; - } - - [Then(@"the audio application details are retrieved")] - public async Task ThenTheAudioApplicationDetailsAreRetrieved() - { - var audioApplication = await Response.GetResponses(_context.Response.Content); - audioApplication.Should().NotBeNull(); - } - - [Then(@"the audio stream details are retrieved")] - public async Task ThenTheAudioStreamDetailsAreRetrieved() - { - var audioStream = await Response.GetResponses(_context.Response.Content); - audioStream.Should().NotBeNull(); - } - - [Then(@"the audio monitoring stream details are retrieved")] - public async Task ThenTheAudioMonitoringStreamDetailsAreRetrieved() - { - var audioMonitoringStream = await Response.GetResponses(_context.Response.Content); - audioMonitoringStream.Should().NotBeNull(); - } - - [Then(@"the audio recording link details are retrieved")] - public async Task ThenTheAudioRecordingLinkDetailsAreRetrieved() - { - var audioRecording = await Response.GetResponses(_context.Response.Content); - audioRecording.Should().NotBeNull(); - audioRecording.AudioFileLinks.Should().NotBeNullOrEmpty(); - } - - [Then(@"the audio recording link details are empty")] - public async Task ThenTheAudioRecordingLinkDetailsAreEmpty() - { - var audioRecording = await Response.GetResponses(_context.Response.Content); - audioRecording.Should().NotBeNull(); - audioRecording.AudioFileLinks.Should().BeNullOrEmpty(); - } - - [Then(@"(.*) audio recordings from cvp are retrieved")] - public async Task ThenTheCountAudioRecordingFromCvpAreRetrieved(int count) - { - var audioRecordings = await Response.GetResponses>(_context.Response.Content); - var countAudioRecords = audioRecordings.Count; - countAudioRecords.Should().BeGreaterOrEqualTo(count); - } - } -} diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/ConferenceSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/ConferenceSteps.cs index b09ee6265..5961acfae 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/ConferenceSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/ConferenceSteps.cs @@ -275,7 +275,7 @@ public void GivenIHaveAValidGetOpenConferencesByScheduledDateRequest() [Then(@"the conference details should be retrieved")] public async Task ThenAConferenceDetailsShouldBeRetrieved() { - _conferenceDetails = await Response.GetResponses(_context.Response.Content); + _conferenceDetails = await ApiClientResponse.GetResponses(_context.Response.Content); _conferenceDetails.Should().NotBeNull(); AssertConferenceDetailsResponse.ForConference(_conferenceDetails); } @@ -283,7 +283,7 @@ public async Task ThenAConferenceDetailsShouldBeRetrieved() [Then(@"the conference details should be retrieved with jvs endpoints")] public async Task ThenAConferenceDetailsShouldBeRetrievedWithJvsEndpoints() { - _conferenceDetails = await Response.GetResponses(_context.Response.Content); + _conferenceDetails = await ApiClientResponse.GetResponses(_context.Response.Content); _conferenceDetails.Should().NotBeNull(); AssertConferenceDetailsResponse.ForConference(_conferenceDetails); AssertConferenceDetailsResponse.ForConferenceEndpoints(_conferenceDetails); @@ -295,7 +295,7 @@ public async Task ThenTheConferenceShouldBeClosed() _context.Uri = GetConferenceDetailsById(_context.Test.Conference.Id); _context.HttpMethod = HttpMethod.Get; await _commonSteps.WhenISendTheRequestToTheEndpoint(); - _conferenceDetails = await Response.GetResponses(_context.Response.Content); + _conferenceDetails = await ApiClientResponse.GetResponses(_context.Response.Content); _conferenceDetails.CurrentStatus.Should().Be(ConferenceState.Closed); } @@ -323,7 +323,7 @@ public async Task ThenTheConferenceDataShouldBeAnonymised() [Then(@"the summary of conference details should be retrieved for judges")] public async Task ThenTheSummaryOfConferenceDetailsShouldBeRetrieved() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Should().NotBeNullOrEmpty(); foreach (var conference in conferences) { @@ -340,7 +340,7 @@ public async Task ThenTheSummaryOfConferenceDetailsShouldBeRetrieved() [Then(@"the summary of conference details should be retrieved for individuals")] public async Task ThenTheSummaryOfConferenceDetailsShouldBeRetrievedForIndividuals() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Should().NotBeNullOrEmpty(); foreach (var conference in conferences) { @@ -352,7 +352,7 @@ public async Task ThenTheSummaryOfConferenceDetailsShouldBeRetrievedForIndividua [Then(@"only todays conferences should be retrieved for vho")] public async Task ThenOnlyTodaysConferencesShouldBeRetrieved() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Should().NotBeNullOrEmpty(); foreach (var conference in conferences) { @@ -387,14 +387,14 @@ public async Task ThenTheHearingShouldBeUpdated() [Then(@"an empty list is retrieved")] public async Task ThenAnEmptyListIsRetrieved() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Should().BeEmpty(); } [Then(@"a list without closed conferences is retrieved")] public async Task ThenAListWithoutClosedConferencesIsRetrieved() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Count.Should().BeGreaterThan(0); conferences.Any(x => x.Id.Equals(_context.Test.YesterdayClosedConference.Id)).Should().BeFalse(); } @@ -402,14 +402,14 @@ public async Task ThenAListWithoutClosedConferencesIsRetrieved() [When(@"I save the conference details")] public async Task WhenISaveTheConferenceDetails() { - _conferenceDetails = await Response.GetResponses(_context.Response.Content); + _conferenceDetails = await ApiClientResponse.GetResponses(_context.Response.Content); _conferenceDetails.Should().NotBeNull(); } [Then(@"the response should be the same")] public async Task ThenTheResponseShouldBeTheSame() { - var conference = await Response.GetResponses(_context.Response.Content); + var conference = await ApiClientResponse.GetResponses(_context.Response.Content); conference.Should().NotBeNull(); conference.Should().BeEquivalentTo(_conferenceDetails); } @@ -463,7 +463,7 @@ public void GivenIHaveAValidUpdateAConferenceRequest(Scenario scenario) [Then(@"I get (.*) hearing\(s\)")] public async Task ThenIGetXNumberOfHearings(int number) { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Count.Should().Be(number); } diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/ConsultationSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/ConsultationSteps.cs index 9a55bef3b..bd326da24 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/ConsultationSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/ConsultationSteps.cs @@ -317,7 +317,7 @@ public void GivenIHaveAStartEndpointConsultationWithANotLinkedDefenceAdvocate() [Given(@"I have a valid start consultation request")] public async Task GivenIHaveAValidStartConsultationRequest() { - var conference = await Response.GetResponses(_context.Response.Content); + var conference = await ApiClientResponse.GetResponses(_context.Response.Content); var judge = conference.Participants.First(x => x.UserRole == Contract.Enums.UserRole.Judge); @@ -334,7 +334,7 @@ public async Task GivenIHaveAValidStartConsultationRequest() [Given(@"the judge is in the waiting room")] public async Task GivenTheJudgeIsInTheWaitingRoom() { - var conferenceResponse = await Response.GetResponses(_context.Response.Content); + var conferenceResponse = await ApiClientResponse.GetResponses(_context.Response.Content); var judgeResponse = conferenceResponse.Participants.First(x => x.UserRole == Contract.Enums.UserRole.Judge); @@ -352,7 +352,7 @@ public async Task GivenTheJudgeIsInTheWaitingRoom() [Given(@"I have a valid leave consultation request")] public async Task GivenIHaveAValidLeaveConsultationRequest() { - var conference = await Response.GetResponses(_context.Response.Content); + var conference = await ApiClientResponse.GetResponses(_context.Response.Content); var judge = conference.Participants.First(x => x.UserRole == Contract.Enums.UserRole.Judge); @@ -368,7 +368,7 @@ public async Task GivenIHaveAValidLeaveConsultationRequest() [Given(@"the judge joh is in the consultation room")] public async Task GivenTheJudgeJohIsInTheConsultationRoom() { - var conferenceResponse = await Response.GetResponses(_context.Response.Content); + var conferenceResponse = await ApiClientResponse.GetResponses(_context.Response.Content); var judgeResponse = conferenceResponse.Participants.First(x => x.UserRole == Contract.Enums.UserRole.Judge); var consultationRoom = new ConsultationRoom(conferenceResponse.Id, "name", VirtualCourtRoomType.JudgeJOH, false); diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/EndpointSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/EndpointSteps.cs index 64071b7c1..a1675a19f 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/EndpointSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/EndpointSteps.cs @@ -216,7 +216,7 @@ public async Task ThenTheEndpointsStateShouldBe(EndpointState state) private async Task AssertEndpointLength(int length) { - var result = await Response.GetResponses>(_context.Response.Content); + var result = await ApiClientResponse.GetResponses>(_context.Response.Content); result.Should().HaveCount(length); } diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/InstantMessageSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/InstantMessageSteps.cs index 194b9aa86..4f3e0e94a 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/InstantMessageSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/InstantMessageSteps.cs @@ -143,7 +143,7 @@ public void GivenIHaveAValidGetClosedConferencesWithMessagesRequest() [Then(@"the responses list should contain closed conferences")] public async Task ThenTheResponsesListShouldContainClosedConferences() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); foreach (var conference in conferences) { _context.Test.ClosedConferencesWithMessages.Any(x => x.Id.Equals(conference.Id)).Should().BeTrue(); @@ -153,7 +153,7 @@ public async Task ThenTheResponsesListShouldContainClosedConferences() [Then(@"the response returns an empty list without messages")] public async Task ThenTheResponseReturnsAnEmptyListWithoutMessages() { - var conferences = await Response.GetResponses>(_context.Response.Content); + var conferences = await ApiClientResponse.GetResponses>(_context.Response.Content); conferences.Count.Should().Be(0); } @@ -164,14 +164,14 @@ public async Task ThenTheMessagesHaveBeenDeleted() _context.HttpMethod = HttpMethod.Get; await _commonSteps.WhenISendTheRequestToTheEndpoint(); _context.Response.StatusCode.Should().Be(HttpStatusCode.OK); - var response = await Response.GetResponses>(_context.Response.Content); + var response = await ApiClientResponse.GetResponses>(_context.Response.Content); response.Count.Should().Be(0); } [Then(@"the chat message should be retrieved")] public async Task ThenTheChatMessagesShouldBeRetrieved() { - var messages = await Response.GetResponses>(_context.Response.Content); + var messages = await ApiClientResponse.GetResponses>(_context.Response.Content); messages.Should().NotBeNullOrEmpty(); messages.Should().BeInDescendingOrder(x => x.TimeStamp); foreach (var message in messages) @@ -185,7 +185,7 @@ public async Task ThenTheChatMessagesShouldBeRetrieved() [Then(@"the no chat message should be retrieved")] public async Task ThenTheNoChatMessageShouldBeRetrieved() { - var messages = await Response.GetResponses>(_context.Response.Content); + var messages = await ApiClientResponse.GetResponses>(_context.Response.Content); messages.Should().BeEmpty(); } } diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/ParticipantSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/ParticipantSteps.cs index cc01689ae..d0f099a24 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/ParticipantSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/ParticipantSteps.cs @@ -346,7 +346,7 @@ private Guid GetConferenceIdForRequest(Scenario scenario) [Then(@"the participants should be retrieved")] public async Task ThenTheParticipantsShouldBeRetrieved() { - var result = await Response.GetResponses>(_context.Response.Content); + var result = await ApiClientResponse.GetResponses>(_context.Response.Content); result.Should().NotBeNull(); AssertParticipantSummaryResponse.ForParticipant(result[1]); } @@ -356,7 +356,7 @@ public async Task ThenTheParticipantsShouldBeRetrieved() [Then(@"(.*) heartbeat should be retrieved")] public async Task ThenTheHeartbeatsShouldBeRetrieved(int count) { - var result = await Response.GetResponses>(_context.Response.Content); + var result = await ApiClientResponse.GetResponses>(_context.Response.Content); result.Should().HaveCount(count); if (count > 0) { diff --git a/VideoApi/VideoApi.IntegrationTests/Steps/SelfTestSteps.cs b/VideoApi/VideoApi.IntegrationTests/Steps/SelfTestSteps.cs index 3ab078715..5946c1aae 100644 --- a/VideoApi/VideoApi.IntegrationTests/Steps/SelfTestSteps.cs +++ b/VideoApi/VideoApi.IntegrationTests/Steps/SelfTestSteps.cs @@ -28,7 +28,7 @@ public void GivenIHaveASelfTestRequest() [Then(@"the pexip service configuration should be retrieved")] public async Task ThenThePexipServiceConfigurationShouldBeRetrieved() { - var pexipConfig = await Response.GetResponses(_context.Response.Content); + var pexipConfig = await ApiClientResponse.GetResponses(_context.Response.Content); pexipConfig.PexipSelfTestNode.Should().NotBeNullOrWhiteSpace(); } } diff --git a/VideoApi/VideoApi.IntegrationTests/VideoApi.IntegrationTests.csproj b/VideoApi/VideoApi.IntegrationTests/VideoApi.IntegrationTests.csproj index 97ca1f2e6..a52150e01 100644 --- a/VideoApi/VideoApi.IntegrationTests/VideoApi.IntegrationTests.csproj +++ b/VideoApi/VideoApi.IntegrationTests/VideoApi.IntegrationTests.csproj @@ -6,15 +6,17 @@ latestmajor + all runtime; build; native; contentfiles; analyzers; buildtransitive + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -27,9 +29,6 @@ - - Always - PreserveNewest @@ -43,4 +42,9 @@ + + + Always + + diff --git a/VideoApi/VideoApi.IntegrationTests/appsettings.json b/VideoApi/VideoApi.IntegrationTests/appsettings.json index a04af0bfe..9db11f8a3 100644 --- a/VideoApi/VideoApi.IntegrationTests/appsettings.json +++ b/VideoApi/VideoApi.IntegrationTests/appsettings.json @@ -1,7 +1,8 @@ { "Logging": { "LogLevel": { - "Default": "Warning" + "Default": "Warning", + "Microsoft.EntityFrameworkCore.Database.Command": "Warning" } }, "AllowedHosts": "*", @@ -30,16 +31,29 @@ "VideoApiResourceId": "VideoApiResourceId" }, "WowzaConfiguration": { - "RestApiEndpoints": "RestApiEndpoints", - "StreamingEndpoint": "StreamingEndpoint", - "ServerName": "ServerName", - "HostName": "HostName", - "Username": "Username", - "Password": "Password", - "StorageDirectory": "StorageDirectory", - "StorageAccountName": "StorageAccountName", - "StorageAccountKey": "StorageAccountKey", - "StorageContainerName": "StorageContainerName" + "LoadBalancer": "https://wowza-example.net", + "RestApiEndpoints:0": "https://wowza-example.net:0001", + "RestApiEndpoints:1": "https://wowza-example.net:0000", + "ServerName": "_defaultServer_", + "StreamingEndpoint": "", + "HostName": "", + "Username": "", + "Password": "", + "StorageDirectory": "", + "AzureStorageDirectory": "", + "StorageAccountName": "foo-wow", + "StorageAccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "StorageContainerName": "bar-wow", + "StorageEndpoint": "http://azurite:10000/", + "ManagedIdentityClientId": "", + "ApplicationName": "vh-recording-app" + }, + "CvpConfiguration": { + "StorageAccountName": "foocvp", + "StorageAccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "StorageContainerName": "bar-cvp", + "StorageEndpoint": "http://azurite:10000/", + "ManagedIdentityClientId": "" }, "ZapConfiguration": { "ApiAddress": "127.0.0.1", @@ -51,11 +65,5 @@ "ActiveScan": false, "ZapScan": false }, - "CvpConfiguration": { - "StorageAccountName": "StorageAccountName", - "StorageAccountKey": "StorageAccountKey", - "StorageContainerName": "StorageContainerName" - }, "UseStub": "true" } - diff --git a/VideoApi/VideoApi.IntegrationTests/packages.lock.json b/VideoApi/VideoApi.IntegrationTests/packages.lock.json index 689c5b267..6880eb6a7 100644 --- a/VideoApi/VideoApi.IntegrationTests/packages.lock.json +++ b/VideoApi/VideoApi.IntegrationTests/packages.lock.json @@ -2,6 +2,16 @@ "version": 1, "dependencies": { "net6.0": { + "Azure.Storage.Blobs": { + "type": "Direct", + "requested": "[12.14.1, )", + "resolved": "12.14.1", + "contentHash": "DvRBWUDMB2LjdRbsBNtz/LiVIYk56hqzSooxx4uq4rCdLj2M+7Vvoa1r+W35Dz6ZXL6p+SNcgEae3oZ+CkPfow==", + "dependencies": { + "Azure.Storage.Common": "12.13.0", + "System.Text.Json": "4.7.2" + } + }, "coverlet.msbuild": { "type": "Direct", "requested": "[3.2.0, )", @@ -17,6 +27,18 @@ "System.Configuration.ConfigurationManager": "4.4.0" } }, + "GST.Fake.Authentication.JwtBearer": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "qvXgZuizJDXbTkW/lk52Cw0/byOVHyxzHj+FT9KX5Tgp0tU7WYi71VCvzYkkb7aNUhI7t/ZEWTRDn6fs1pyxMw==", + "dependencies": { + "Microsoft.AspNetCore.Authentication": "2.2.0", + "Microsoft.AspNetCore.Session": "2.2.0", + "Microsoft.Extensions.Options": "6.0.0", + "Newtonsoft.Json": "13.0.1" + } + }, "Microsoft.AspNetCore.Mvc.Testing": { "type": "Direct", "requested": "[6.0.11, )", @@ -30,12 +52,12 @@ }, "Microsoft.NET.Test.Sdk": { "type": "Direct", - "requested": "[17.4.0, )", - "resolved": "17.4.0", - "contentHash": "VtNZQ83ntG2aEUjy1gq6B4HNdn96se6FmdY/03At8WiqDReGrApm6OB2fNiSHz9D6IIEtWtNZ2FSH0RJDVXl/w==", + "requested": "[17.5.0, )", + "resolved": "17.5.0", + "contentHash": "IJ4eSPcsRbwbAZehh1M9KgejSy0u3d0wAdkJytfCh67zOaCl5U3ltruUEe15MqirdRqGmm/ngbjeaVeGapSZxg==", "dependencies": { - "Microsoft.CodeCoverage": "17.4.0", - "Microsoft.TestPlatform.TestHost": "17.4.0" + "Microsoft.CodeCoverage": "17.5.0", + "Microsoft.TestPlatform.TestHost": "17.5.0" } }, "NUnit3TestAdapter": { @@ -46,9 +68,9 @@ }, "SonarAnalyzer.CSharp": { "type": "Direct", - "requested": "[8.7.0.17535, )", - "resolved": "8.7.0.17535", - "contentHash": "c9f6HjLChuPcQpo6qUr/Bxmi6Q2ogOVINg2e9tjCeKT/hiL9Cxdw4XsNttiqAhY5AbmHJIs4rn/muXR4OOnAJg==" + "requested": "[8.56.0.67649, )", + "resolved": "8.56.0.67649", + "contentHash": "u5klyn4PBAOe38/CoPbxGjuMqJQ5K0M7SA17H2DHgHyQ+neSU+abneRGjSQSVD76kbYXzG7E1/KQwTuj+nnMZw==" }, "VH.AcceptanceTests.Common": { "type": "Direct", @@ -122,24 +144,16 @@ }, "Azure.Identity": { "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "TTB+Od1T9Okr1QNhXY0pTvuOsNtHqykgR1YcTt8o7jlsk2AWiuCilaOMqESTAK7a103e7YWVqjv9v5O7MJJlTg==", - "dependencies": { - "Azure.Core": "1.0.2", - "Microsoft.Identity.Client": "4.1.0", - "System.Memory": "4.5.3", - "System.Security.Cryptography.ProtectedData": "4.5.0", - "System.Text.Json": "4.6.0", - "System.Threading.Tasks.Extensions": "4.5.2" - } - }, - "Azure.Storage.Blobs": { - "type": "Transitive", - "resolved": "12.14.1", - "contentHash": "DvRBWUDMB2LjdRbsBNtz/LiVIYk56hqzSooxx4uq4rCdLj2M+7Vvoa1r+W35Dz6ZXL6p+SNcgEae3oZ+CkPfow==", + "resolved": "1.8.2", + "contentHash": "ywnpn9MLhNTtBG12WOxSaomx0Dwu5HK5PyhHH/CApGrd1BCrhgEwdy4Uwy5IfAznJzVJKZRyKR9cp4aa61xYvA==", "dependencies": { - "Azure.Storage.Common": "12.13.0", - "System.Text.Json": "4.7.2" + "Azure.Core": "1.25.0", + "Microsoft.Identity.Client": "4.49.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.25.3", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Storage.Common": { @@ -310,6 +324,20 @@ "System.IO.FileSystem.AccessControl": "4.7.0" } }, + "Microsoft.AspNetCore.Authentication": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "b0R9X7L6zMqNsssKDvhYHuNi5x0s4DyHTeXybIAyGaitKiW1Q5aAGKdV2codHPiePv9yHfC9hAMyScXQ/xXhPw==", + "dependencies": { + "Microsoft.AspNetCore.Authentication.Core": "2.2.0", + "Microsoft.AspNetCore.DataProtection": "2.2.0", + "Microsoft.AspNetCore.Http": "2.2.0", + "Microsoft.AspNetCore.Http.Extensions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0", + "Microsoft.Extensions.WebEncoders": "2.2.0" + } + }, "Microsoft.AspNetCore.Authentication.Abstractions": { "type": "Transitive", "resolved": "2.2.0", @@ -365,6 +393,32 @@ "System.IO.Pipelines": "4.7.3" } }, + "Microsoft.AspNetCore.Cryptography.Internal": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "GXmMD8/vuTLPLvKzKEPz/4vapC5e0cwx1tUVd83ePRyWF9CCrn/pg4/1I+tGkQqFLPvi3nlI2QtPtC6MQN8Nww==" + }, + "Microsoft.AspNetCore.DataProtection": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "G6dvu5Nd2vjpYbzazZ//qBFbSEf2wmBUbyAR7E4AwO3gWjhoJD5YxpThcGJb7oE3VUcW65SVMXT+cPCiiBg8Sg==", + "dependencies": { + "Microsoft.AspNetCore.Cryptography.Internal": "2.2.0", + "Microsoft.AspNetCore.DataProtection.Abstractions": "2.2.0", + "Microsoft.AspNetCore.Hosting.Abstractions": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0", + "Microsoft.Win32.Registry": "4.5.0", + "System.Security.Cryptography.Xml": "4.5.0", + "System.Security.Principal.Windows": "4.5.0" + } + }, + "Microsoft.AspNetCore.DataProtection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "seANFXmp8mb5Y12m1ShiElJ3ZdOT3mBN3wA1GPhHJIvZ/BxOCPyqEOR+810OWsxEZwA5r5fDRNpG/CqiJmQnJg==" + }, "Microsoft.AspNetCore.Hosting": { "type": "Transitive", "resolved": "2.1.1", @@ -531,6 +585,18 @@ "Microsoft.AspNetCore.Http.Abstractions": "2.2.0" } }, + "Microsoft.AspNetCore.Session": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "lOjJVh293AKaOEPi1MIC1/G9gOVZMrve2a05o56oslK6bo0PMgMB17rmPomvqrJAjMdlWZ/MGdN2y78Z9wzWTw==", + "dependencies": { + "Microsoft.AspNetCore.DataProtection": "2.2.0", + "Microsoft.AspNetCore.Http.Abstractions": "2.2.0", + "Microsoft.Extensions.Caching.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, "Microsoft.AspNetCore.TestHost": { "type": "Transitive", "resolved": "6.0.11", @@ -555,8 +621,8 @@ }, "Microsoft.CodeCoverage": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "2oZbSVTC2nAvQ2DnbXLlXS+c25ZyZdWeNd+znWwAxwGaPh9dwQ5NBsYyqQB7sKmJKIUdkKGmN3rzFzjVC81Dtg==" + "resolved": "17.5.0", + "contentHash": "6FQo0O6LKDqbCiIgVQhJAf810HSjFlOj7FunWaeOGDKxy8DAbpHzPk4SfBTXz9ytaaceuIIeR6hZgplt09m+ig==" }, "Microsoft.CSharp": { "type": "Transitive", @@ -964,14 +1030,34 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "Microsoft.Extensions.WebEncoders": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "V8XcqYcpcdBAxUhLeyYcuKmxu4CtNQA9IphTnARpQGhkop4A93v2XgM3AtaVVJo3H2cDWxWM6aeO8HxkifREqw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0", + "System.Text.Encodings.Web": "4.5.0" + } + }, "Microsoft.Identity.Client": { "type": "Transitive", - "resolved": "4.48.1", - "contentHash": "AsTnTKgmJqhL1hjZ7TA13TDQVyWdn0vpYwhDMdb1mTg+w5m9AZsacLvmxsUZt03uamZ81pDY78himvXOM//tpw==", + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", "dependencies": { "Microsoft.IdentityModel.Abstractions": "6.22.0" } }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "2.25.3", + "contentHash": "I6/Od0d3OMD9b7RPxW1l25A8oA94H+r9ZtrOe4Ogk49Ftxhs9RS+pbzPE5dLe0i7nQy+1aob7mR22YsNcc0BiQ==", + "dependencies": { + "Microsoft.Identity.Client": "4.49.1", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } + }, "Microsoft.IdentityModel.Abstractions": { "type": "Transitive", "resolved": "6.25.0", @@ -1054,8 +1140,8 @@ }, "Microsoft.NETCore.Platforms": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "z7aeg8oHln2CuNulfhiLYxCVMPEwBl3rzicjvIX+4sUuCwvXw5oXQEtbiU2c0z4qYL5L3Kmx0mMA/+t/SbY67w==" + "resolved": "5.0.0", + "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" }, "Microsoft.NETCore.Targets": { "type": "Transitive", @@ -1069,8 +1155,8 @@ }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "oWe7A0wrZhxagTOcaxJ9r0NXTbgkiBQQuCpCXxnP06NsGV/qOoaY2oaangAJbOUrwEx0eka1do400NwNCjfytw==", + "resolved": "17.5.0", + "contentHash": "QwiBJcC/oEA1kojOaB0uPWOIo4i6BYuTBBYJVhUvmXkyYqZ2Ut/VZfgi+enf8LF8J4sjO98oRRFt39MiRorcIw==", "dependencies": { "NuGet.Frameworks": "5.11.0", "System.Reflection.Metadata": "1.6.0" @@ -1078,10 +1164,10 @@ }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "sUx48fu9wgQF1JxzXeSVtzb7KoKpJrdtIzsFamxET3ZYOKXj+Ej13HWZ0U2nuMVZtZVHBmE+KS3Vv5cIdTlycQ==", + "resolved": "17.5.0", + "contentHash": "X86aikwp9d4SDcBChwzQYZihTPGEtMdDk+9t64emAl7N0Tq+OmlLAoW+Rs+2FB2k6QdUicSlT4QLO2xABRokaw==", "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.4.0", + "Microsoft.TestPlatform.ObjectModel": "17.5.0", "Newtonsoft.Json": "13.0.1" } }, @@ -1549,8 +1635,8 @@ }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.ComponentModel.Primitives": { "type": "Transitive", @@ -1779,11 +1865,11 @@ }, "System.IO.FileSystem.AccessControl": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "vMToiarpU81LR1/KZtnT7VDPvqAZfw9oOS5nY6pPP78nGYz3COLsQH3OfzbR+SjTgltd31R6KmKklz/zDpTmzw==", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", "dependencies": { - "System.Security.AccessControl": "4.7.0", - "System.Security.Principal.Windows": "4.7.0" + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" } }, "System.IO.FileSystem.Primitives": { @@ -1857,8 +1943,8 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" }, "System.Memory.Data": { "type": "Transitive", @@ -2161,11 +2247,11 @@ }, "System.Security.AccessControl": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "JECvTt5aFF3WT3gHpfofL2MNNP6v84sxtXxpqhLBCcDRzqsPBmHhQ6shv4DwwN2tRlzsUxtb3G9M3763rbXKDg==", + "resolved": "5.0.0", + "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", "dependencies": { - "Microsoft.NETCore.Platforms": "3.1.0", - "System.Security.Principal.Windows": "4.7.0" + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" } }, "System.Security.Cryptography.Algorithms": { @@ -2253,6 +2339,14 @@ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, + "System.Security.Cryptography.Pkcs": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "TGQX51gxpY3K3I6LJlE2LAftVlIMqJf0cBGhz68Y89jjk3LJCB6SrwiD+YN1fkqemBvWGs+GjyMJukl6d6goyQ==", + "dependencies": { + "System.Security.Cryptography.Cng": "4.5.0" + } + }, "System.Security.Cryptography.Primitives": { "type": "Transitive", "resolved": "4.3.0", @@ -2304,6 +2398,15 @@ "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, + "System.Security.Cryptography.Xml": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "i2Jn6rGXR63J0zIklImGRkDIJL4b1NfPSEbIVHBlqoIb12lfXIigCbDRpDmIEzwSo/v1U5y/rYJdzZYSyCWxvg==", + "dependencies": { + "System.Security.Cryptography.Pkcs": "4.5.0", + "System.Security.Permissions": "4.5.0" + } + }, "System.Security.Permissions": { "type": "Transitive", "resolved": "7.0.0", @@ -2314,8 +2417,8 @@ }, "System.Security.Principal.Windows": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==" + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" }, "System.Security.SecureString": { "type": "Transitive", @@ -2584,17 +2687,18 @@ }, "ZymLabs.NSwag.FluentValidation": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "k57Y6NAlv1rqgHVbCV33gRfJWWX9JuI+zT4CdV/79P9kEecgtRI9tiLjL0DdMAT+PUWJSWG5VDBccSAQ3ZLuZw==", + "resolved": "0.6.2", + "contentHash": "oo6Dx/D5pCMsCtSCuN9zpcykwLajW1qylUtpatpUBMdTuPca+9VLAJFOA9+AEsF7f4qPnyypQcN2e68sqXSYHA==", "dependencies": { - "FluentValidation": "9.0.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.5", - "NJsonSchema": "10.1.23" + "FluentValidation": "10.2.3", + "Microsoft.Extensions.Logging.Abstractions": "5.0.0", + "NJsonSchema": "10.4.4" } }, "testing.common": { "type": "Project", "dependencies": { + "Azure.Storage.Blobs": "[12.14.1, )", "Faker.NETCore": "[1.0.2, )", "FluentAssertions": "[5.10.3, )", "Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )", @@ -2603,6 +2707,7 @@ "Microsoft.Extensions.Configuration.UserSecrets": "[7.0.0, )", "Moq": "[4.14.1, )", "NBuilder": "[6.1.0, )", + "NUnit": "[3.13.3, )", "VideoApi.Common": "[1.0.0, )", "VideoApi.Contract": "[1.0.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2611,8 +2716,8 @@ "videoapi": { "type": "Project", "dependencies": { - "Azure.Identity": "[1.1.1, )", - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Identity": "[1.8.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "FluentValidation.AspNetCore": "[11.2.2, )", "MicroElements.Swashbuckle.FluentValidation": "[5.7.0, )", "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", @@ -2629,7 +2734,7 @@ "VideoApi.Domain": "[1.0.0, )", "VideoApi.Events": "[1.0.0, )", "VideoApi.Services": "[1.0.0, )", - "ZymLabs.NSwag.FluentValidation": "[0.4.0, )" + "ZymLabs.NSwag.FluentValidation": "[0.6.2, )" } }, "videoapi.common": { @@ -2637,7 +2742,7 @@ "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", "Microsoft.Extensions.Caching.Abstractions": "[7.0.0, )", - "Microsoft.IdentityModel.Clients.ActiveDirectory": "[5.2.8, )", + "Microsoft.Identity.Client": "[4.50.0, )", "Newtonsoft.Json": "[13.0.2, )", "System.IdentityModel.Tokens.Jwt": "[6.25.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2646,7 +2751,7 @@ "videoapi.contract": { "type": "Project", "dependencies": { - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.dal": { @@ -2668,7 +2773,7 @@ "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.events": { @@ -2684,7 +2789,7 @@ "videoapi.services": { "type": "Project", "dependencies": { - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "Microsoft.AspNetCore.Mvc.Abstractions": "[2.2.0, )", "Microsoft.Extensions.Configuration": "[7.0.0, )", "Polly": "[7.2.0, )", diff --git a/VideoApi/VideoApi.Services.Generator/kinly-api.nswag b/VideoApi/VideoApi.Services.Generator/kinly-api.nswag index a8986acbc..48b1a4154 100644 --- a/VideoApi/VideoApi.Services.Generator/kinly-api.nswag +++ b/VideoApi/VideoApi.Services.Generator/kinly-api.nswag @@ -51,7 +51,7 @@ "wrapResponseMethods": [], "generateResponseClasses": true, "responseClass": "KinlyApiResponse", - "namespace": "VideoApi.Services.Kinly", + "namespace": "VideoApi.Services.Clients", "requiredPropertiesMustBeDefined": true, "dateType": "System.DateTime", "jsonConverters": null, diff --git a/VideoApi/VideoApi.Services/Clients/KinlyApiClient.cs b/VideoApi/VideoApi.Services/Clients/KinlyApiClient.cs index 9793e77f3..898b9f400 100644 --- a/VideoApi/VideoApi.Services/Clients/KinlyApiClient.cs +++ b/VideoApi/VideoApi.Services/Clients/KinlyApiClient.cs @@ -13,7 +13,7 @@ #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" -namespace VideoApi.Services.Kinly +namespace VideoApi.Services.Clients { using System = global::System; diff --git a/VideoApi/VideoApi.Services/Clients/KinlySelfTestHttpClient.cs b/VideoApi/VideoApi.Services/Clients/KinlySelfTestHttpClient.cs index dbc4e65bc..88541266d 100644 --- a/VideoApi/VideoApi.Services/Clients/KinlySelfTestHttpClient.cs +++ b/VideoApi/VideoApi.Services/Clients/KinlySelfTestHttpClient.cs @@ -9,7 +9,7 @@ using VideoApi.Domain.Enums; using VideoApi.Services.Contracts; using VideoApi.Services.Helpers; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.Services.Clients { diff --git a/VideoApi/VideoApi.Services/Contracts/IVideoPlatformService.cs b/VideoApi/VideoApi.Services/Contracts/IVideoPlatformService.cs index 9d15bdc34..01e23e412 100644 --- a/VideoApi/VideoApi.Services/Contracts/IVideoPlatformService.cs +++ b/VideoApi/VideoApi.Services/Contracts/IVideoPlatformService.cs @@ -4,7 +4,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services.Dtos; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Endpoint = VideoApi.Domain.Endpoint; using Task = System.Threading.Tasks.Task; diff --git a/VideoApi/VideoApi.Services/KinlyPlatformService.cs b/VideoApi/VideoApi.Services/KinlyPlatformService.cs index f4f21f9ae..7c255629b 100644 --- a/VideoApi/VideoApi.Services/KinlyPlatformService.cs +++ b/VideoApi/VideoApi.Services/KinlyPlatformService.cs @@ -8,7 +8,7 @@ using VideoApi.Common.Security.Kinly; using VideoApi.Domain; using VideoApi.Services.Exceptions; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; using VideoApi.Services.Contracts; using VideoApi.Services.Dtos; diff --git a/VideoApi/VideoApi.Services/KinlyPlatformServiceStub.cs b/VideoApi/VideoApi.Services/KinlyPlatformServiceStub.cs index d5969c43d..2af7a95a0 100644 --- a/VideoApi/VideoApi.Services/KinlyPlatformServiceStub.cs +++ b/VideoApi/VideoApi.Services/KinlyPlatformServiceStub.cs @@ -7,7 +7,7 @@ using VideoApi.Services.Contracts; using VideoApi.Services.Dtos; using VideoApi.Services.Exceptions; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Endpoint = VideoApi.Domain.Endpoint; using Task = System.Threading.Tasks.Task; diff --git a/VideoApi/VideoApi.Services/Mappers/EndpointMapper.cs b/VideoApi/VideoApi.Services/Mappers/EndpointMapper.cs index 347b88720..2094e8b02 100644 --- a/VideoApi/VideoApi.Services/Mappers/EndpointMapper.cs +++ b/VideoApi/VideoApi.Services/Mappers/EndpointMapper.cs @@ -16,11 +16,11 @@ public static EndpointDto MapToEndpoint(Endpoint source) }; } - public static Kinly.Endpoint MapToEndpoint(EndpointDto source, int index) + public static VideoApi.Services.Clients.Endpoint MapToEndpoint(EndpointDto source, int index) { var kinlyDisplayName = $"T{100 + index};{source.DisplayName};{source.Id}"; - return new Kinly.Endpoint + return new VideoApi.Services.Clients.Endpoint { Address = source.SipAddress, Display_name = kinlyDisplayName, diff --git a/VideoApi/VideoApi.Services/VideoApi.Services.csproj b/VideoApi/VideoApi.Services/VideoApi.Services.csproj index 4921ffd0a..47b8e96e6 100644 --- a/VideoApi/VideoApi.Services/VideoApi.Services.csproj +++ b/VideoApi/VideoApi.Services/VideoApi.Services.csproj @@ -6,10 +6,14 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/VideoApi/VideoApi.UnitTests/Clients/KinlySelfTestHttpClientTest.cs b/VideoApi/VideoApi.UnitTests/Clients/KinlySelfTestHttpClientTest.cs index 43e91f7db..9bfb54938 100644 --- a/VideoApi/VideoApi.UnitTests/Clients/KinlySelfTestHttpClientTest.cs +++ b/VideoApi/VideoApi.UnitTests/Clients/KinlySelfTestHttpClientTest.cs @@ -10,7 +10,6 @@ using VideoApi.Common.Security.Kinly; using VideoApi.Domain.Enums; using VideoApi.Services.Clients; -using VideoApi.Services.Kinly; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Clients diff --git a/VideoApi/VideoApi.UnitTests/Controllers/AudioRecording/AudioRecordingControllerTest.cs b/VideoApi/VideoApi.UnitTests/Controllers/AudioRecording/AudioRecordingControllerTest.cs index c60157ff7..c05393baf 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/AudioRecording/AudioRecordingControllerTest.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/AudioRecording/AudioRecordingControllerTest.cs @@ -67,171 +67,6 @@ public void Setup() .ReturnsAsync(_testConference); } - [Test] - public async Task GetAudioApplicationAsync_Returns_NotFound() - { - _audioPlatformService - .Setup(x => x.GetAudioApplicationInfoAsync(It.IsAny())) - .ReturnsAsync((WowzaGetApplicationResponse)null); - - var result = await _controller.GetAudioApplicationAsync(It.IsAny()) as NotFoundResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status404NotFound); - } - - [Test] - public async Task GetAudioApplicationAsyncWithHearingId_Returns_AudioApplicationInfoResponse() - { - var hearingId = Guid.NewGuid(); - var wowzaResponse = new WowzaGetApplicationResponse - { - Description = "Description", - Name = "Name", - ServerName = "ServerName", - StreamConfig = new Streamconfig - { - KeyDir = "KeyDir", - ServerName = "ServerName", - StorageDir = "StorageDir", - StreamType = "StreamType", - StorageDirExists = true - } - }; - - _audioPlatformService - .Setup(x => x.GetAudioApplicationInfoAsync(hearingId)) - .ReturnsAsync(wowzaResponse); - - var result = await _controller.GetAudioApplicationAsync(hearingId) as OkObjectResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status200OK); - var response = result.Value as AudioApplicationInfoResponse; - response.Should().NotBeNull(); - response.Should().BeEquivalentTo(wowzaResponse, options => options.ExcludingMissingMembers()); - } - - [Test] - public async Task GetAudioApplicationAsync_Returns_AudioApplicationInfoResponse() - { - var wowzaResponse = new WowzaGetApplicationResponse - { - Description = "Description", - Name = "Name", - ServerName = "ServerName", - StreamConfig = new Streamconfig - { - KeyDir = "KeyDir", - ServerName = "ServerName", - StorageDir = "StorageDir", - StreamType = "StreamType", - StorageDirExists = true - } - }; - - _audioPlatformService - .Setup(x => x.GetAudioApplicationInfoAsync(null)) - .ReturnsAsync(wowzaResponse); - - var result = await _controller.GetAudioApplicationAsync() as OkObjectResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status200OK); - var response = result.Value as AudioApplicationInfoResponse; - response.Should().NotBeNull(); - response.Should().BeEquivalentTo(wowzaResponse, options => options.ExcludingMissingMembers()); - } - - [Test] - public async Task DeleteAudioApplicationAsync_Returns_Conflict() - { - _storageServiceFactory.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(_storageService.Object); - - var blobFiles = new List { "SomeBlob.mp4" }; - _storageService.Setup(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny())).ReturnsAsync(blobFiles); - _audioPlatformService - .Setup(x => x.DeleteAudioApplicationAsync(It.IsAny())) - .ReturnsAsync(new AudioPlatformServiceResponse(false) - { - StatusCode = HttpStatusCode.Conflict, - Message = "Conflict" - }); - - var result = await _controller.DeleteAudioApplicationAsync(It.IsAny()) as ObjectResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status409Conflict); - result.Value.Should().Be("Conflict"); - } - - [Test] - public async Task DeleteAudioApplicationAsync_Returns_NoContent() - { - _storageServiceFactory.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(_storageService.Object); - _storageService.Setup(x => x.FileExistsAsync(It.IsAny())).ReturnsAsync(true); - - var blobFiles = new List { "SomeBlob.mp4" }; - _storageService.Setup(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny())).ReturnsAsync(blobFiles); - - _audioPlatformService - .Setup(x => x.DeleteAudioApplicationAsync(It.IsAny())) - .ReturnsAsync(new AudioPlatformServiceResponse(true)); - - var result = await _controller.DeleteAudioApplicationAsync(It.IsAny()) as NoContentResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status204NoContent); - } - - [Test] - public async Task - Should_not_delete_audio_application_if_audio_file_not_exists_and_audio_required_returns_notFound() - { - var conferenceType = typeof(VideoApi.Domain.Conference); - conferenceType.GetProperty(nameof(_testConference.ActualStartTime)) - ?.SetValue(_testConference, DateTime.UtcNow.AddHours(-1)); - - _testConference.AudioRecordingRequired = true; - _queryHandler - .Setup(x => - x.Handle( - It.IsAny())) - .ReturnsAsync(_testConference); - - _storageServiceFactory.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(_storageService.Object); - var blobFiles = new List(); - _storageService.Setup(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny())).ReturnsAsync(blobFiles); - _audioPlatformService.Reset(); - _audioPlatformService.Setup(x => x.ApplicationName).Returns(ApplicationName); - var result = await _controller.DeleteAudioApplicationAsync(It.IsAny()) as NotFoundResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status404NotFound); - _audioPlatformService.Verify(x => x.DeleteAudioApplicationAsync(It.IsAny()), Times.Never); - } - - [Test] - public async Task - Should_delete_audio_application_if_audio_file_not_exists_and_audio_not_reqired_returns_noContent() - { - var conferenceType = typeof(VideoApi.Domain.Conference); - conferenceType.GetProperty(nameof(_testConference.ActualStartTime)) - ?.SetValue(_testConference, DateTime.UtcNow.AddHours(-1)); - _testConference.AudioRecordingRequired = false; - - _queryHandler - .Setup(x => - x.Handle( - It.IsAny())) - .ReturnsAsync(_testConference); - - _storageServiceFactory.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(_storageService.Object); - - _audioPlatformService - .Setup(x => x.DeleteAudioApplicationAsync(It.IsAny())) - .ReturnsAsync(new AudioPlatformServiceResponse(true)); - - var result = await _controller.DeleteAudioApplicationAsync(It.IsAny()) as NoContentResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status204NoContent); - _audioPlatformService.Verify(x => x.DeleteAudioApplicationAsync(It.IsAny()), Times.Once); - } - [Test] public async Task GetAudioStreamInfoAsync_Returns_NotFound() { @@ -283,43 +118,6 @@ public async Task GetAudioStreamInfoAsync_Returns_AudioStreamInfoResponse(bool w else _audioPlatformService.Verify(e => e.GetAudioStreamInfoAsync(hearingId.ToString(), hearingId.ToString()), Times.Once); } - - [Test] - public async Task GetAudioStreamMonitoringInfoAsync_Returns_NotFound() - { - _audioPlatformService - .Setup(x => x.GetAudioStreamMonitoringInfoAsync(It.IsAny())) - .ReturnsAsync((WowzaMonitorStreamResponse) null); - - var result = await _controller.GetAudioStreamMonitoringInfoAsync(It.IsAny()) as NotFoundResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status404NotFound); - } - - [Test] - public async Task GetAudioStreamMonitoringInfoAsync_Returns_AudioStreamMonitoringInfo() - { - var wowzaResponse = new WowzaMonitorStreamResponse - { - Name = "Name", - Uptime = 1, - ApplicationInstance = "ApplicationInstance", - BytesIn = 1, - ServerName = "ServerName", - BytesInRate = 1 - }; - - _audioPlatformService - .Setup(x => x.GetAudioStreamMonitoringInfoAsync(It.IsAny())) - .ReturnsAsync(wowzaResponse); - - var result = await _controller.GetAudioStreamMonitoringInfoAsync(It.IsAny()) as OkObjectResult; - result.Should().NotBeNull(); - result.StatusCode.Should().Be(StatusCodes.Status200OK); - var response = result.Value as AudioStreamMonitoringInfo; - response.Should().NotBeNull(); - response.Should().BeEquivalentTo(wowzaResponse, options => options.ExcludingMissingMembers()); - } [Test] public async Task GetAudioRecordingLinkAsync_returns_audio_file_link() diff --git a/VideoApi/VideoApi.UnitTests/Controllers/Conference/RemoveHeartbeatsForConferencesTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/Conference/RemoveHeartbeatsForConferencesTests.cs index 0b0b9b790..e2c1e8bd7 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/Conference/RemoveHeartbeatsForConferencesTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/Conference/RemoveHeartbeatsForConferencesTests.cs @@ -5,7 +5,6 @@ using System.Net; using System.Threading.Tasks; using VideoApi.DAL.Commands; -using VideoApi.DAL.Commands.Core; namespace VideoApi.UnitTests.Controllers.Conference { diff --git a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/EndVideoHearingTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/EndVideoHearingTests.cs index 61bbfe5eb..8d17f01f6 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/EndVideoHearingTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/EndVideoHearingTests.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.UnitTests.Controllers.ConferenceManagement { diff --git a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/PauseVideoHearingTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/PauseVideoHearingTests.cs index eee5ae888..41e3d4dca 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/PauseVideoHearingTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/PauseVideoHearingTests.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.UnitTests.Controllers.ConferenceManagement { diff --git a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/StartVideoHearingTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/StartVideoHearingTests.cs index 9954f54ed..e56557d99 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/StartVideoHearingTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/StartVideoHearingTests.cs @@ -7,7 +7,7 @@ using Moq; using NUnit.Framework; using VideoApi.Contract.Requests; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.UnitTests.Controllers.ConferenceManagement { diff --git a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/SuspendVideoHearingTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/SuspendVideoHearingTests.cs index d1b94f3e2..1c5ac07d7 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/SuspendVideoHearingTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/SuspendVideoHearingTests.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.UnitTests.Controllers.ConferenceManagement { diff --git a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/TransferParticipantTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/TransferParticipantTests.cs index a1a9692d9..35743c9d8 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/TransferParticipantTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/ConferenceManagement/TransferParticipantTests.cs @@ -9,7 +9,7 @@ using VideoApi.Contract.Requests; using VideoApi.Domain; using VideoApi.Domain.Enums; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Controllers.ConferenceManagement diff --git a/VideoApi/VideoApi.UnitTests/Controllers/Consultation/LeaveConsultationTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/Consultation/LeaveConsultationTests.cs index ebe28fa3d..698faff3f 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/Consultation/LeaveConsultationTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/Consultation/LeaveConsultationTests.cs @@ -9,7 +9,7 @@ using VideoApi.DAL.Queries; using VideoApi.Domain; using VideoApi.Domain.Enums; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Controllers.Consultation diff --git a/VideoApi/VideoApi.UnitTests/Controllers/Consultation/StartConsultationRequestTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/Consultation/StartConsultationRequestTests.cs index 8800d0aa7..ac718dd4b 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/Consultation/StartConsultationRequestTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/Consultation/StartConsultationRequestTests.cs @@ -11,7 +11,7 @@ using VideoApi.DAL.Exceptions; using VideoApi.Domain; using VideoApi.Extensions; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; using VhRoom = VideoApi.Domain.Enums.RoomType; diff --git a/VideoApi/VideoApi.UnitTests/Controllers/HealthChecks/HealthTests.cs b/VideoApi/VideoApi.UnitTests/Controllers/HealthChecks/HealthTests.cs index 58e57bb3c..5c5f0f938 100644 --- a/VideoApi/VideoApi.UnitTests/Controllers/HealthChecks/HealthTests.cs +++ b/VideoApi/VideoApi.UnitTests/Controllers/HealthChecks/HealthTests.cs @@ -11,7 +11,7 @@ using VideoApi.DAL.Queries.Core; using VideoApi.Domain; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using HealthCheckResponse = VideoApi.Contract.Responses.HealthCheckResponse; using Task = System.Threading.Tasks.Task; @@ -46,7 +46,7 @@ public void Setup() _mockVideoPlatformService .Setup(x => x.GetPlatformHealthAsync()) - .ReturnsAsync(new VideoApi.Services.Kinly.HealthCheckResponse{Health_status = PlatformHealth.HEALTHY}); + .ReturnsAsync(new VideoApi.Services.Clients.HealthCheckResponse{Health_status = PlatformHealth.HEALTHY}); var wowzaResponse = true ; diff --git a/VideoApi/VideoApi.UnitTests/DAL/Commands/DomainModelFactoryForTests.cs b/VideoApi/VideoApi.UnitTests/DAL/Commands/DomainModelFactoryForTests.cs index 4b44b959c..c28884f43 100644 --- a/VideoApi/VideoApi.UnitTests/DAL/Commands/DomainModelFactoryForTests.cs +++ b/VideoApi/VideoApi.UnitTests/DAL/Commands/DomainModelFactoryForTests.cs @@ -5,7 +5,7 @@ namespace VideoApi.UnitTests.DAL.Commands { - public class DomainModelFactoryForTests + public static class DomainModelFactoryForTests { public static Conference CreateConference() { diff --git a/VideoApi/VideoApi.UnitTests/Mappings/HearingLayoutMapperTests.cs b/VideoApi/VideoApi.UnitTests/Mappings/HearingLayoutMapperTests.cs index 80c5798be..5958293d4 100644 --- a/VideoApi/VideoApi.UnitTests/Mappings/HearingLayoutMapperTests.cs +++ b/VideoApi/VideoApi.UnitTests/Mappings/HearingLayoutMapperTests.cs @@ -2,7 +2,7 @@ using NUnit.Framework; using VideoApi.Contract.Requests; using VideoApi.Mappings; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.UnitTests.Mappings { diff --git a/VideoApi/VideoApi.UnitTests/Middleware/ExceptionMiddlewareTests.cs b/VideoApi/VideoApi.UnitTests/Middleware/ExceptionMiddlewareTests.cs index a5b06b645..09d30fafb 100644 --- a/VideoApi/VideoApi.UnitTests/Middleware/ExceptionMiddlewareTests.cs +++ b/VideoApi/VideoApi.UnitTests/Middleware/ExceptionMiddlewareTests.cs @@ -1,9 +1,7 @@ using System; using System.Net; -using System.Net.Mime; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Formatters; using Moq; using NUnit.Framework; using VideoApi.Common; diff --git a/VideoApi/VideoApi.UnitTests/Middleware/RequestModelValidatorServiceTests.cs b/VideoApi/VideoApi.UnitTests/Middleware/RequestModelValidatorServiceTests.cs deleted file mode 100644 index 2c7db1c0b..000000000 --- a/VideoApi/VideoApi.UnitTests/Middleware/RequestModelValidatorServiceTests.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using FluentAssertions; -using FluentValidation; -using Moq; -using NUnit.Framework; -using VideoApi.Contract.Requests; -using VideoApi.ValidationMiddleware; - -namespace VideoApi.UnitTests.Middleware -{ - public class RequestModelValidatorServiceTests - { - private RequestModelValidatorService _service; - private Mock _validatorFactory; - - [SetUp] - public void Setup() - { - _validatorFactory = new Mock(); - _service = new RequestModelValidatorService(_validatorFactory.Object); - } - - [Test] - public void should_return_failure_when_request_validator_is_not_found() - { - _validatorFactory.Setup(x => x.GetValidator(It.IsAny())).Returns((IValidator) null); - var model = new StartHearingRequest(); - - var result = _service.Validate(model.GetType(), model); - - result.Should().NotBeNullOrEmpty(); - } - } -} diff --git a/VideoApi/VideoApi.UnitTests/Services/Consultation/ConsultationServiceTests.cs b/VideoApi/VideoApi.UnitTests/Services/Consultation/ConsultationServiceTests.cs index 3ae05759a..7a12c80b7 100644 --- a/VideoApi/VideoApi.UnitTests/Services/Consultation/ConsultationServiceTests.cs +++ b/VideoApi/VideoApi.UnitTests/Services/Consultation/ConsultationServiceTests.cs @@ -15,7 +15,7 @@ using VideoApi.Domain.Enums; using VideoApi.Extensions; using VideoApi.Services; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Services.Consultation diff --git a/VideoApi/VideoApi.UnitTests/Services/Consultation/LeaveConsultationTests.cs b/VideoApi/VideoApi.UnitTests/Services/Consultation/LeaveConsultationTests.cs index 432cc654e..2d28402d4 100644 --- a/VideoApi/VideoApi.UnitTests/Services/Consultation/LeaveConsultationTests.cs +++ b/VideoApi/VideoApi.UnitTests/Services/Consultation/LeaveConsultationTests.cs @@ -8,7 +8,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Services.Consultation diff --git a/VideoApi/VideoApi.UnitTests/Services/Handlers/KinlySelfTestApiDelegatingHandlerTest.cs b/VideoApi/VideoApi.UnitTests/Services/Handlers/KinlySelfTestApiDelegatingHandlerTest.cs index 295a92f0a..6e2ea865a 100644 --- a/VideoApi/VideoApi.UnitTests/Services/Handlers/KinlySelfTestApiDelegatingHandlerTest.cs +++ b/VideoApi/VideoApi.UnitTests/Services/Handlers/KinlySelfTestApiDelegatingHandlerTest.cs @@ -28,7 +28,7 @@ public KinlySelfTestApiDelegatingHandlerTest() public async Task Should_send_http_request() { var request = new HttpRequestMessage(HttpMethod.Get, "http://somesite.com"); - request.Properties.Add("participantId", Guid.NewGuid()); + request.Options.Set(new HttpRequestOptionsKey("participantId"), Guid.NewGuid()); var handler = new KinlySelfTestApiDelegatingHandler(_customJwtTokenProvider.Object) { diff --git a/VideoApi/VideoApi.UnitTests/Services/KinlyPlatformServiceTests.cs b/VideoApi/VideoApi.UnitTests/Services/KinlyPlatformServiceTests.cs index a0fca2cf2..df80a1a74 100644 --- a/VideoApi/VideoApi.UnitTests/Services/KinlyPlatformServiceTests.cs +++ b/VideoApi/VideoApi.UnitTests/Services/KinlyPlatformServiceTests.cs @@ -16,7 +16,7 @@ using VideoApi.Services.Contracts; using VideoApi.Services.Dtos; using VideoApi.Services.Exceptions; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using VideoApi.Services.Mappers; using Task = System.Threading.Tasks.Task; diff --git a/VideoApi/VideoApi.UnitTests/Services/VhAzureStorageServiceTest.cs b/VideoApi/VideoApi.UnitTests/Services/VhAzureStorageServiceTest.cs index 944fdf732..62dbb94b2 100644 --- a/VideoApi/VideoApi.UnitTests/Services/VhAzureStorageServiceTest.cs +++ b/VideoApi/VideoApi.UnitTests/Services/VhAzureStorageServiceTest.cs @@ -223,41 +223,6 @@ public void Should_Throw_AudioPlatformFileNotFoundException_If_Storage_Returns_L } - /* - [Test] - public void Should_Throw_AudioPlatformFileNotFoundException_If_Storage_Returns_Any_Empty_Files() - { - var mockitems = GetMockBlobItems(); - - var pageable1 = new Mock>() ; - - var blobContainerClient1 = new Mock(); - var blobClientMock1 = new Mock(); - var blobServiceClient1 = new Mock(); - var blobClientExtensionMock1 = new Mock(); - var blobContainerClientMock1 = new Mock(); - - - pageable.SetupSequence(x => x.GetAsyncEnumerator(default)).Returns(mockitems); - pageable1.SetupSequence(x => x.GetAsyncEnumerator(default)).Returns(mockitems); - - blobContainerClientMock.SetupSequence(x => x.GetBlobsAsync(BlobTraits.None, BlobStates.None, filePathPrefix, default)).Returns(pageable.Object).Returns(pageable1.Object); - - blobContainerClientMock.SetupSequence(x => x.GetBlobClient(It.IsAny())).Returns(blobClientMock.Object).Returns(blobClientMock1.Object); - - blobClientExtensionMock.SetupSequence(x => x.GetPropertiesAsync(It.IsAny())).ReturnsAsync(emptyBlobClientProperties); - - blobServiceClient.SetupSequence(x => x.GetBlobContainerClient(config.StorageContainerName)).Returns(blobContainerClientMock.Object).Returns(blobContainerClientMock1.Object); - - blobClientMock.SetupSequence(x => x.Name).Returns("myFilePath.mp4").Returns("myFilePath.mp4"); - - var msg = $"ReconcileFilesInStorage - File name prefix :" + filePathPrefix + " Expected: " + "1" + " Actual:" + "0"; - - Assert.That(async () => await service.ReconcileFilesInStorage("myFilePath", 1), Throws.TypeOf().With.Message.Contains(msg)); - - } - */ - private async IAsyncEnumerator GetMockBlobItems() { var blobItem = new Mock(); diff --git a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAJudicialVirtualRoom.cs b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAJudicialVirtualRoom.cs index e0028d4e2..b378991fb 100644 --- a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAJudicialVirtualRoom.cs +++ b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAJudicialVirtualRoom.cs @@ -13,7 +13,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Services.VirtualRoom diff --git a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAWitnessVirtualRoomTests.cs b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAWitnessVirtualRoomTests.cs index 01d359ebc..94c1f4be4 100644 --- a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAWitnessVirtualRoomTests.cs +++ b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAWitnessVirtualRoomTests.cs @@ -12,7 +12,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Services.VirtualRoom diff --git a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAnInterpreterVirtualRoomTests.cs b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAnInterpreterVirtualRoomTests.cs index 7a771196e..bb121d570 100644 --- a/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAnInterpreterVirtualRoomTests.cs +++ b/VideoApi/VideoApi.UnitTests/Services/VirtualRoom/GetOrCreateAnInterpreterVirtualRoomTests.cs @@ -12,7 +12,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.UnitTests.Services.VirtualRoom diff --git a/VideoApi/VideoApi.UnitTests/VideoApi.UnitTests.csproj b/VideoApi/VideoApi.UnitTests/VideoApi.UnitTests.csproj index 6ed75711f..86d1bfb72 100644 --- a/VideoApi/VideoApi.UnitTests/VideoApi.UnitTests.csproj +++ b/VideoApi/VideoApi.UnitTests/VideoApi.UnitTests.csproj @@ -13,12 +13,12 @@ - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VideoApi/VideoApi.UnitTests/packages.lock.json b/VideoApi/VideoApi.UnitTests/packages.lock.json index ab060ff26..14bab71a7 100644 --- a/VideoApi/VideoApi.UnitTests/packages.lock.json +++ b/VideoApi/VideoApi.UnitTests/packages.lock.json @@ -39,19 +39,19 @@ }, "Microsoft.NET.Test.Sdk": { "type": "Direct", - "requested": "[17.4.0, )", - "resolved": "17.4.0", - "contentHash": "VtNZQ83ntG2aEUjy1gq6B4HNdn96se6FmdY/03At8WiqDReGrApm6OB2fNiSHz9D6IIEtWtNZ2FSH0RJDVXl/w==", + "requested": "[17.5.0, )", + "resolved": "17.5.0", + "contentHash": "IJ4eSPcsRbwbAZehh1M9KgejSy0u3d0wAdkJytfCh67zOaCl5U3ltruUEe15MqirdRqGmm/ngbjeaVeGapSZxg==", "dependencies": { - "Microsoft.CodeCoverage": "17.4.0", - "Microsoft.TestPlatform.TestHost": "17.4.0" + "Microsoft.CodeCoverage": "17.5.0", + "Microsoft.TestPlatform.TestHost": "17.5.0" } }, "Microsoft.TestPlatform": { "type": "Direct", - "requested": "[16.8.0, )", - "resolved": "16.8.0", - "contentHash": "rPA7+W+UNo6YX2QmOG1yilEcVNdn9vCjBHNDdnT+YH6cb8SeTc9aPxGkEFmFwgH+bSIdVMcCuLqLuJMatzu2hw==" + "requested": "[17.5.0, )", + "resolved": "17.5.0", + "contentHash": "0ZgCf5nsTiAukgEC0kfm0unheijVC7KYoR2IkEeMOkpYIWhOKdoeNBLRGVWmC3utfBl+8a/XE3lFe/fL18i95Q==" }, "Moq": { "type": "Direct", @@ -80,9 +80,9 @@ }, "SonarAnalyzer.CSharp": { "type": "Direct", - "requested": "[8.7.0.17535, )", - "resolved": "8.7.0.17535", - "contentHash": "c9f6HjLChuPcQpo6qUr/Bxmi6Q2ogOVINg2e9tjCeKT/hiL9Cxdw4XsNttiqAhY5AbmHJIs4rn/muXR4OOnAJg==" + "requested": "[8.56.0.67649, )", + "resolved": "8.56.0.67649", + "contentHash": "u5klyn4PBAOe38/CoPbxGjuMqJQ5K0M7SA17H2DHgHyQ+neSU+abneRGjSQSVD76kbYXzG7E1/KQwTuj+nnMZw==" }, "Autofac": { "type": "Transitive", @@ -94,45 +94,48 @@ }, "Azure.Core": { "type": "Transitive", - "resolved": "1.2.1", - "contentHash": "U0zPuK0/ssiz0gvli1/sslqPKANZpCa7muDM3K4Vj6Pf6YKYNnpByQsnqFQTYafzr6cQ41mr1nM07I8jOm5UkA==", + "resolved": "1.25.0", + "contentHash": "X8Dd4sAggS84KScWIjEbFAdt2U1KDolQopTPoHVubG2y3CM54f9l6asVrP5Uy384NWXjsspPYaJgz5xHc+KvTA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.0.0", - "System.Buffers": "4.5.0", + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", "System.Diagnostics.DiagnosticSource": "4.6.0", - "System.Memory": "4.5.3", + "System.Memory.Data": "1.0.2", "System.Numerics.Vectors": "4.5.0", - "System.Threading.Tasks.Extensions": "4.5.2" + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Identity": { "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "TTB+Od1T9Okr1QNhXY0pTvuOsNtHqykgR1YcTt8o7jlsk2AWiuCilaOMqESTAK7a103e7YWVqjv9v5O7MJJlTg==", + "resolved": "1.8.2", + "contentHash": "ywnpn9MLhNTtBG12WOxSaomx0Dwu5HK5PyhHH/CApGrd1BCrhgEwdy4Uwy5IfAznJzVJKZRyKR9cp4aa61xYvA==", "dependencies": { - "Azure.Core": "1.0.2", - "Microsoft.Identity.Client": "4.1.0", - "System.Memory": "4.5.3", - "System.Security.Cryptography.ProtectedData": "4.5.0", - "System.Text.Json": "4.6.0", - "System.Threading.Tasks.Extensions": "4.5.2" + "Azure.Core": "1.25.0", + "Microsoft.Identity.Client": "4.49.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.25.3", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Storage.Blobs": { "type": "Transitive", - "resolved": "12.4.2", - "contentHash": "fhUwOl4qXy23StKvBHDHV5ALM34SczEETRgJWDJHwPW3sZNIYAi3GTBXlWAYPm4SNKR1JgpZSYTbMHrNYCr1DQ==", + "resolved": "12.14.1", + "contentHash": "DvRBWUDMB2LjdRbsBNtz/LiVIYk56hqzSooxx4uq4rCdLj2M+7Vvoa1r+W35Dz6ZXL6p+SNcgEae3oZ+CkPfow==", "dependencies": { - "Azure.Core": "1.2.1", - "Azure.Storage.Common": "12.4.1" + "Azure.Storage.Common": "12.13.0", + "System.Text.Json": "4.7.2" } }, "Azure.Storage.Common": { "type": "Transitive", - "resolved": "12.4.1", - "contentHash": "Q1/w9P9wJCKo+q2LF4pgZxNwgmqmArkxHjPW+Q1pugdc894T6HU4+3hmrFda1otS9CbAPhBLG98WOZ37jMPmFg==", + "resolved": "12.13.0", + "contentHash": "jDv8xJWeZY2Er9zA6QO25BiGolxg87rItt9CwAp7L/V9EPJeaz8oJydaNL9Wj0+3ncceoMgdiyEv66OF8YUwWQ==", "dependencies": { - "Azure.Core": "1.2.1" + "Azure.Core": "1.25.0", + "System.IO.Hashing": "6.0.0" } }, "Castle.Core": { @@ -503,13 +506,13 @@ }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==" + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" }, "Microsoft.CodeCoverage": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "2oZbSVTC2nAvQ2DnbXLlXS+c25ZyZdWeNd+znWwAxwGaPh9dwQ5NBsYyqQB7sKmJKIUdkKGmN3rzFzjVC81Dtg==" + "resolved": "17.5.0", + "contentHash": "6FQo0O6LKDqbCiIgVQhJAf810HSjFlOj7FunWaeOGDKxy8DAbpHzPk4SfBTXz9ytaaceuIIeR6hZgplt09m+ig==" }, "Microsoft.CSharp": { "type": "Transitive", @@ -806,34 +809,27 @@ }, "Microsoft.Identity.Client": { "type": "Transitive", - "resolved": "4.21.1", - "contentHash": "vycgk7S/HAbHaUaK4Tid1fsWHsXdFRRP2KavAIOHCVV27zvuQfYAjXmMvctuuF4egydSumG58CwPZob3gWeYgQ==" + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "2.25.3", + "contentHash": "I6/Od0d3OMD9b7RPxW1l25A8oA94H+r9ZtrOe4Ogk49Ftxhs9RS+pbzPE5dLe0i7nQy+1aob7mR22YsNcc0BiQ==", + "dependencies": { + "Microsoft.Identity.Client": "4.49.1", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } }, "Microsoft.IdentityModel.Abstractions": { "type": "Transitive", "resolved": "6.25.0", "contentHash": "70MbUvri/xthpVpSEve7X6ysNtTe5MgLEgNyhnZ5z7WXVgFOkUfI7RNtqS6oenLoaaMpnRJrrZFt9Pps5NknBQ==" }, - "Microsoft.IdentityModel.Clients.ActiveDirectory": { - "type": "Transitive", - "resolved": "5.2.8", - "contentHash": "VIi6Bzt0UWEeannuEjtRFr/LgUXXw70a9LlIVfoCGorztZhzHgKiof6UJE1ETRYlf/L+kepsUZeekYZwqb6xPg==", - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Net.Http": "4.3.4", - "System.Private.Uri": "4.3.2", - "System.Runtime.Serialization.Formatters": "4.3.0", - "System.Runtime.Serialization.Json": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.SecureString": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "Microsoft.IdentityModel.JsonWebTokens": { "type": "Transitive", "resolved": "6.25.0", @@ -896,8 +892,8 @@ }, "Microsoft.NETCore.Targets": { "type": "Transitive", - "resolved": "1.1.3", - "contentHash": "3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==" + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, "Microsoft.OpenApi": { "type": "Transitive", @@ -906,8 +902,8 @@ }, "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "oWe7A0wrZhxagTOcaxJ9r0NXTbgkiBQQuCpCXxnP06NsGV/qOoaY2oaangAJbOUrwEx0eka1do400NwNCjfytw==", + "resolved": "17.5.0", + "contentHash": "QwiBJcC/oEA1kojOaB0uPWOIo4i6BYuTBBYJVhUvmXkyYqZ2Ut/VZfgi+enf8LF8J4sjO98oRRFt39MiRorcIw==", "dependencies": { "NuGet.Frameworks": "5.11.0", "System.Reflection.Metadata": "1.6.0" @@ -915,10 +911,10 @@ }, "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "17.4.0", - "contentHash": "sUx48fu9wgQF1JxzXeSVtzb7KoKpJrdtIzsFamxET3ZYOKXj+Ej13HWZ0U2nuMVZtZVHBmE+KS3Vv5cIdTlycQ==", + "resolved": "17.5.0", + "contentHash": "X86aikwp9d4SDcBChwzQYZihTPGEtMdDk+9t64emAl7N0Tq+OmlLAoW+Rs+2FB2k6QdUicSlT4QLO2xABRokaw==", "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.4.0", + "Microsoft.TestPlatform.ObjectModel": "17.5.0", "Newtonsoft.Json": "13.0.1" } }, @@ -1065,21 +1061,6 @@ "resolved": "2.0.0", "contentHash": "GGpyCGm7W27MlBXp+HNeslnOsNi80Z2isoCt/yY7aKoyjS2Vl6AQ6kq2UK6NgeVpEQZeXaOIEf2pNbiXeARYdg==" }, - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" - }, - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" - }, - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" - }, "runtime.native.System": { "type": "Transitive", "resolved": "4.3.0", @@ -1089,80 +1070,6 @@ "Microsoft.NETCore.Targets": "1.1.0" } }, - "runtime.native.System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", - "dependencies": { - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" - } - }, - "runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", - "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } - }, - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" - }, - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==" - }, - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" - }, - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" - }, - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" - }, - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" - }, - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" - }, "Scrutor": { "type": "Transitive", "resolved": "3.3.0", @@ -1265,8 +1172,8 @@ }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.ComponentModel.Primitives": { "type": "Transitive", @@ -1353,16 +1260,6 @@ "System.Security.Principal.Windows": "4.7.0" } }, - "System.Diagnostics.Tools": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, "System.Diagnostics.TraceSource": { "type": "Transitive", "resolved": "4.3.0", @@ -1428,17 +1325,6 @@ "System.Runtime": "4.3.0" } }, - "System.Globalization.Calendars": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, "System.Globalization.Extensions": { "type": "Transitive", "resolved": "4.3.0", @@ -1490,11 +1376,11 @@ }, "System.IO.FileSystem.AccessControl": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "vMToiarpU81LR1/KZtnT7VDPvqAZfw9oOS5nY6pPP78nGYz3COLsQH3OfzbR+SjTgltd31R6KmKklz/zDpTmzw==", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", "dependencies": { - "System.Security.AccessControl": "4.7.0", - "System.Security.Principal.Windows": "4.7.0" + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" } }, "System.IO.FileSystem.Primitives": { @@ -1505,6 +1391,11 @@ "System.Runtime": "4.3.0" } }, + "System.IO.Hashing": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Rfm2jYCaUeGysFEZjDe7j1R4x6Z6BzumS/vUT5a1AA/AWJuGX71PoGB0RmpyX3VmrGqVnAwtfMn39OHR8Y/5+g==" + }, "System.IO.Pipelines": { "type": "Transitive", "resolved": "4.7.3", @@ -1563,51 +1454,16 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Net.Http": { - "type": "Transitive", - "resolved": "4.3.4", - "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" - } + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" }, - "System.Net.Primitives": { + "System.Memory.Data": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" } }, "System.Numerics.Vectors": { @@ -1627,47 +1483,6 @@ "System.Threading": "4.3.0" } }, - "System.Private.DataContractSerialization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0", - "System.Xml.XmlSerializer": "4.3.0" - } - }, - "System.Private.Uri": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "Microsoft.NETCore.Targets": "1.1.3" - } - }, "System.Reflection": { "type": "Transitive", "resolved": "4.3.0", @@ -1804,189 +1619,21 @@ "System.Runtime.Handles": "4.3.0" } }, - "System.Runtime.Numerics": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", - "dependencies": { - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - } - }, - "System.Runtime.Serialization.Formatters": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - } - }, - "System.Runtime.Serialization.Json": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", - "dependencies": { - "System.IO": "4.3.0", - "System.Private.DataContractSerialization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Serialization.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", - "dependencies": { - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - } - }, "System.Security.AccessControl": { "type": "Transitive", "resolved": "6.0.0", "contentHash": "AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==" }, - "System.Security.Cryptography.Algorithms": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.Apple": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, "System.Security.Cryptography.Cng": { "type": "Transitive", "resolved": "4.5.0", "contentHash": "WG3r7EyjUe9CMPFSs6bty5doUqT+q9pbI80hlNzo2SkPkZ4VTuZkGWjpp77JB8+uaL4DFPRdBsAY+DX3dBK92A==" }, - "System.Security.Cryptography.Csp": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Security.Cryptography.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.OpenSsl": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", - "dependencies": { - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, - "System.Security.Cryptography.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "6.0.0", "contentHash": "rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==" }, - "System.Security.Cryptography.X509Certificates": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Cng": "4.3.0", - "System.Security.Cryptography.Csp": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" - } - }, "System.Security.Permissions": { "type": "Transitive", "resolved": "6.0.0", @@ -1998,23 +1645,8 @@ }, "System.Security.Principal.Windows": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==" - }, - "System.Security.SecureString": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" }, "System.Text.Encoding": { "type": "Transitive", @@ -2091,8 +1723,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.5.2", - "contentHash": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==" + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" }, "System.Windows.Extensions": { "type": "Transitive", @@ -2124,25 +1756,6 @@ "System.Threading.Tasks.Extensions": "4.3.0" } }, - "System.Xml.XDocument": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - } - }, "System.Xml.XmlDocument": { "type": "Transitive", "resolved": "4.3.0", @@ -2160,30 +1773,6 @@ "System.Xml.ReaderWriter": "4.3.0" } }, - "System.Xml.XmlSerializer": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "System.Xml.XPath": { "type": "Transitive", "resolved": "4.3.0", @@ -2263,17 +1852,18 @@ }, "ZymLabs.NSwag.FluentValidation": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "k57Y6NAlv1rqgHVbCV33gRfJWWX9JuI+zT4CdV/79P9kEecgtRI9tiLjL0DdMAT+PUWJSWG5VDBccSAQ3ZLuZw==", + "resolved": "0.6.2", + "contentHash": "oo6Dx/D5pCMsCtSCuN9zpcykwLajW1qylUtpatpUBMdTuPca+9VLAJFOA9+AEsF7f4qPnyypQcN2e68sqXSYHA==", "dependencies": { - "FluentValidation": "9.0.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.5", - "NJsonSchema": "10.1.23" + "FluentValidation": "10.2.3", + "Microsoft.Extensions.Logging.Abstractions": "5.0.0", + "NJsonSchema": "10.4.4" } }, "testing.common": { "type": "Project", "dependencies": { + "Azure.Storage.Blobs": "[12.14.1, )", "Faker.NETCore": "[1.0.2, )", "FluentAssertions": "[5.10.3, )", "Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )", @@ -2282,6 +1872,7 @@ "Microsoft.Extensions.Configuration.UserSecrets": "[7.0.0, )", "Moq": "[4.14.1, )", "NBuilder": "[6.1.0, )", + "NUnit": "[3.13.3, )", "VideoApi.Common": "[1.0.0, )", "VideoApi.Contract": "[1.0.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2290,8 +1881,8 @@ "videoapi": { "type": "Project", "dependencies": { - "Azure.Identity": "[1.1.1, )", - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Identity": "[1.8.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "FluentValidation.AspNetCore": "[11.2.2, )", "MicroElements.Swashbuckle.FluentValidation": "[5.7.0, )", "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", @@ -2308,7 +1899,7 @@ "VideoApi.Domain": "[1.0.0, )", "VideoApi.Events": "[1.0.0, )", "VideoApi.Services": "[1.0.0, )", - "ZymLabs.NSwag.FluentValidation": "[0.4.0, )" + "ZymLabs.NSwag.FluentValidation": "[0.6.2, )" } }, "videoapi.common": { @@ -2316,7 +1907,7 @@ "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", "Microsoft.Extensions.Caching.Abstractions": "[7.0.0, )", - "Microsoft.IdentityModel.Clients.ActiveDirectory": "[5.2.8, )", + "Microsoft.Identity.Client": "[4.50.0, )", "Newtonsoft.Json": "[13.0.2, )", "System.IdentityModel.Tokens.Jwt": "[6.25.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2325,7 +1916,7 @@ "videoapi.contract": { "type": "Project", "dependencies": { - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.dal": { @@ -2347,7 +1938,7 @@ "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.events": { @@ -2363,7 +1954,7 @@ "videoapi.services": { "type": "Project", "dependencies": { - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "Microsoft.AspNetCore.Mvc.Abstractions": "[2.2.0, )", "Microsoft.Extensions.Configuration": "[7.0.0, )", "Polly": "[7.2.0, )", diff --git a/VideoApi/VideoApi/ConfigureServicesExtensions.cs b/VideoApi/VideoApi/ConfigureServicesExtensions.cs index 4f69b774b..ec3a452ec 100644 --- a/VideoApi/VideoApi/ConfigureServicesExtensions.cs +++ b/VideoApi/VideoApi/ConfigureServicesExtensions.cs @@ -1,5 +1,5 @@ using System; -using System.Linq; +using System.Collections.Generic; using System.Net; using System.Net.Http; using Azure.Identity; @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -28,7 +29,6 @@ using VideoApi.Services.Clients; using VideoApi.Services.Contracts; using VideoApi.Services.Handlers; -using VideoApi.Services.Kinly; using VideoApi.Swagger; using ZymLabs.NSwag.FluentValidation; @@ -38,21 +38,31 @@ public static class ConfigureServicesExtensions { public static IServiceCollection AddSwagger(this IServiceCollection services) { - services.AddSingleton(); + services.AddScoped(provider => + { + var validationRules = provider.GetService>(); + var loggerFactory = provider.GetService(); + + return new FluentValidationSchemaProcessor(provider, validationRules, loggerFactory); + }); services.AddOpenApiDocument((document, serviceProvider) => { - document.AddSecurity("JWT", Enumerable.Empty(), - new OpenApiSecurityScheme - { - Type = OpenApiSecuritySchemeType.ApiKey, - Name = "Authorization", - In = OpenApiSecurityApiKeyLocation.Header, - Description = "Type into the textbox: Bearer {your JWT token}.", - Scheme = "bearer" - }); + document.DocumentProcessors.Add( + new SecurityDefinitionAppender("JWT", + new OpenApiSecurityScheme + { + Type = OpenApiSecuritySchemeType.ApiKey, + Name = "Authorization", + In = OpenApiSecurityApiKeyLocation.Header, + Description = "Type into the textbox: Bearer {your JWT token}.", + Scheme = "bearer" + })); document.Title = "Video API"; document.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("JWT")); document.OperationProcessors.Add(new AuthResponseOperationProcessor()); + var fluentValidationSchemaProcessor = serviceProvider.CreateScope().ServiceProvider.GetService(); + // Add the fluent validations schema processor + document.SchemaProcessors.Add(fluentValidationSchemaProcessor); }); return services; } diff --git a/VideoApi/VideoApi/Controllers/ConferenceController.cs b/VideoApi/VideoApi/Controllers/ConferenceController.cs index 3f3bc8c3f..0853c8402 100644 --- a/VideoApi/VideoApi/Controllers/ConferenceController.cs +++ b/VideoApi/VideoApi/Controllers/ConferenceController.cs @@ -352,6 +352,7 @@ public async Task GetConferencesTodayForIndividualByUsernameAsync [HttpGet("hearings/{hearingRefId}")] [OpenApiOperation("GetConferenceByHearingRefId")] [ProducesResponseType(typeof(ConferenceDetailsResponse), (int) HttpStatusCode.OK)] + [ProducesResponseType((int) HttpStatusCode.NotFound)] [ProducesResponseType(typeof(ValidationProblemDetails),(int)HttpStatusCode.BadRequest)] public async Task GetConferenceByHearingRefIdAsync(Guid hearingRefId, [FromQuery]bool? includeClosed = false) { diff --git a/VideoApi/VideoApi/Controllers/ConferenceManagementController.cs b/VideoApi/VideoApi/Controllers/ConferenceManagementController.cs index 419f70204..29a72bbf1 100644 --- a/VideoApi/VideoApi/Controllers/ConferenceManagementController.cs +++ b/VideoApi/VideoApi/Controllers/ConferenceManagementController.cs @@ -12,7 +12,7 @@ using VideoApi.Domain.Enums; using VideoApi.Mappings; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using StartHearingRequest = VideoApi.Contract.Requests.StartHearingRequest; namespace VideoApi.Controllers diff --git a/VideoApi/VideoApi/Controllers/ConsultationController.cs b/VideoApi/VideoApi/Controllers/ConsultationController.cs index ca68f0ce9..7e871b706 100644 --- a/VideoApi/VideoApi/Controllers/ConsultationController.cs +++ b/VideoApi/VideoApi/Controllers/ConsultationController.cs @@ -17,7 +17,7 @@ using VideoApi.Mappings; using VideoApi.Extensions; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.Controllers { diff --git a/VideoApi/VideoApi/Controllers/HealthCheckController.cs b/VideoApi/VideoApi/Controllers/HealthCheckController.cs index 4ead40014..0ff08d761 100644 --- a/VideoApi/VideoApi/Controllers/HealthCheckController.cs +++ b/VideoApi/VideoApi/Controllers/HealthCheckController.cs @@ -10,7 +10,7 @@ using VideoApi.DAL.Queries.Core; using VideoApi.Domain; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using HealthCheckResponse = VideoApi.Contract.Responses.HealthCheckResponse; namespace VideoApi.Controllers diff --git a/VideoApi/VideoApi/Controllers/InstantMessageController.cs b/VideoApi/VideoApi/Controllers/InstantMessageController.cs index 910a66aff..2ae9ce6d0 100644 --- a/VideoApi/VideoApi/Controllers/InstantMessageController.cs +++ b/VideoApi/VideoApi/Controllers/InstantMessageController.cs @@ -45,7 +45,6 @@ public InstantMessageController(IQueryHandler queryHandler, ICommandHandler comm [HttpGet("{conferenceId}/instantmessages")] [OpenApiOperation("GetInstantMessageHistory")] [ProducesResponseType(typeof(List), (int)HttpStatusCode.OK)] - [ProducesResponseType((int)HttpStatusCode.NotFound)] public async Task GetInstantMessageHistoryAsync(Guid conferenceId) { _logger.LogDebug("Retrieving instant message history"); @@ -105,7 +104,6 @@ public async Task AddInstantMessageToConferenceAsync(Guid confere [ProducesResponseType((int)HttpStatusCode.OK)] [ProducesResponseType((int)HttpStatusCode.BadRequest)] public async Task RemoveInstantMessagesForConferenceAsync(Guid conferenceId) - { _logger.LogDebug("RemoveInstantMessagesForConference"); try diff --git a/VideoApi/VideoApi/Extensions/DatabaseMigration.cs b/VideoApi/VideoApi/Extensions/DatabaseMigration.cs deleted file mode 100644 index 519452102..000000000 --- a/VideoApi/VideoApi/Extensions/DatabaseMigration.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using VideoApi.DAL; - -namespace VideoApi.Extensions -{ - public static class DatabaseMigration - { - public static void RunLatestMigrations(this IApplicationBuilder app) - { - using (var serviceScope = app.ApplicationServices.CreateScope()) - { - var ctx = serviceScope.ServiceProvider.GetService(); - ctx.Database.Migrate(); - } - } - } -} diff --git a/VideoApi/VideoApi/Extensions/EnumExtensions.cs b/VideoApi/VideoApi/Extensions/EnumExtensions.cs deleted file mode 100644 index 2001958aa..000000000 --- a/VideoApi/VideoApi/Extensions/EnumExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel; -using System.Reflection; -using System.Runtime.Serialization; - -namespace VideoApi.Extensions -{ - public static class EnumExtensions - { - public static string EnumDataMemberAttr(this T source) - { - FieldInfo fi = source.GetType().GetField(source.ToString()); - - EnumMemberAttribute[] attributes = (EnumMemberAttribute[]) fi.GetCustomAttributes( - typeof(EnumMemberAttribute), false); - - if (attributes != null && attributes.Length > 0) - { - return attributes[0].Value; - } - else - { - return source.ToString(); - } - } - - public static string DescriptionAttr(this T source) - { - FieldInfo fi = source.GetType().GetField(source.ToString()); - - DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes( - typeof(DescriptionAttribute), false); - - if (attributes != null && attributes.Length > 0) return attributes[0].Description; - else return source.ToString(); - } - } -} diff --git a/VideoApi/VideoApi/Extensions/ExceptionMiddleware.cs b/VideoApi/VideoApi/Extensions/ExceptionMiddleware.cs index 6541f11c9..7adc22292 100644 --- a/VideoApi/VideoApi/Extensions/ExceptionMiddleware.cs +++ b/VideoApi/VideoApi/Extensions/ExceptionMiddleware.cs @@ -3,8 +3,11 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; using VideoApi.Common; using VideoApi.Common.Helpers; +using VideoApi.DAL.Exceptions; namespace VideoApi.Extensions { @@ -24,10 +27,19 @@ public async Task InvokeAsync(HttpContext httpContext) { await _next(httpContext); } - catch (BadRequestException ex) + catch(BadRequestException ex) { - ApplicationLogger.TraceException(TraceCategory.APIException.ToString(), "400 Exception", ex, null, null); - await HandleExceptionAsync(httpContext, HttpStatusCode.BadRequest, ex); + var modelState = new ModelStateDictionary(); + modelState.AddModelError("request", ex.Message); + var problemDetails = new ValidationProblemDetails(modelState); + await HandleBadRequestAsync(httpContext, problemDetails); + } + catch(VideoDalException ex) + { + var modelState = new ModelStateDictionary(); + modelState.AddModelError("database", ex.Message); + var problemDetails = new ValidationProblemDetails(modelState); + await HandleBadRequestAsync(httpContext, problemDetails); } catch (Exception ex) { @@ -35,9 +47,18 @@ public async Task InvokeAsync(HttpContext httpContext) await HandleExceptionAsync(httpContext, HttpStatusCode.InternalServerError, ex); } } + + private static Task HandleBadRequestAsync(HttpContext httpContext, ValidationProblemDetails problemDetails) + { + httpContext.Response.ContentType = "application/json"; + httpContext.Response.StatusCode = (int) HttpStatusCode.BadRequest; + + return httpContext.Response.WriteAsJsonAsync(problemDetails); + } private static Task HandleExceptionAsync(HttpContext context, HttpStatusCode statusCode, Exception exception) { + context.Response.ContentType = "application/json"; context.Response.StatusCode = (int) statusCode; var sb = new StringBuilder(exception.Message); var innerException = exception.InnerException; diff --git a/VideoApi/VideoApi/Extensions/LogResponseBodyMiddleware.cs b/VideoApi/VideoApi/Extensions/LogResponseBodyMiddleware.cs deleted file mode 100644 index 79c8d2ffa..000000000 --- a/VideoApi/VideoApi/Extensions/LogResponseBodyMiddleware.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; - -namespace VideoApi.Extensions -{ - /// - /// Middleware to intercept the response we're sending to the client in order to use for logging - /// - public class LogResponseBodyMiddleware - { - private readonly RequestDelegate _next; - - - public LogResponseBodyMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task InvokeAsync(HttpContext context) - { - Stream originalBody = context.Response.Body; - - try - { - using (var memStream = new MemoryStream()) - { - context.Response.Body = memStream; - - await _next(context); - - memStream.Position = 0; - var responseBody = new StreamReader(memStream).ReadToEnd(); - - // Rewind the stream for the client - memStream.Position = 0; - await memStream.CopyToAsync(originalBody); - - // Stow away the response body - context.Items["responseBody"] = responseBody; - } - } - finally - { - context.Response.Body = originalBody; - } - } - } -} diff --git a/VideoApi/VideoApi/Mappings/HearingLayoutMapper.cs b/VideoApi/VideoApi/Mappings/HearingLayoutMapper.cs index 9de6ca3b6..236e2c018 100644 --- a/VideoApi/VideoApi/Mappings/HearingLayoutMapper.cs +++ b/VideoApi/VideoApi/Mappings/HearingLayoutMapper.cs @@ -1,5 +1,5 @@ using VideoApi.Contract.Requests; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; namespace VideoApi.Mappings { diff --git a/VideoApi/VideoApi/Extensions/LoggingMiddleware.cs b/VideoApi/VideoApi/Middleware/Logging/LoggingMiddleware.cs similarity index 97% rename from VideoApi/VideoApi/Extensions/LoggingMiddleware.cs rename to VideoApi/VideoApi/Middleware/Logging/LoggingMiddleware.cs index ce877cdc0..95bbff596 100644 --- a/VideoApi/VideoApi/Extensions/LoggingMiddleware.cs +++ b/VideoApi/VideoApi/Middleware/Logging/LoggingMiddleware.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging; using VideoApi.Common.Helpers; -namespace VideoApi.Extensions +namespace VideoApi.Middleware.Logging { public class LoggingMiddleware : IAsyncActionFilter { diff --git a/VideoApi/VideoApi/ValidationMiddleware/IRequestModelValidatorService.cs b/VideoApi/VideoApi/Middleware/Validation/IRequestModelValidatorService.cs similarity index 84% rename from VideoApi/VideoApi/ValidationMiddleware/IRequestModelValidatorService.cs rename to VideoApi/VideoApi/Middleware/Validation/IRequestModelValidatorService.cs index 243e36b99..53b57f370 100644 --- a/VideoApi/VideoApi/ValidationMiddleware/IRequestModelValidatorService.cs +++ b/VideoApi/VideoApi/Middleware/Validation/IRequestModelValidatorService.cs @@ -2,10 +2,10 @@ using System.Collections.Generic; using FluentValidation.Results; -namespace VideoApi.ValidationMiddleware +namespace VideoApi.Middleware.Validation { public interface IRequestModelValidatorService { IList Validate(Type requestModel, object modelValue); } -} +} \ No newline at end of file diff --git a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFilter.cs b/VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorFilter.cs similarity index 75% rename from VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFilter.cs rename to VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorFilter.cs index 6ea90b1a9..34cd8e00b 100644 --- a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFilter.cs +++ b/VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorFilter.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Logging; using VideoApi.Extensions; -namespace VideoApi.ValidationMiddleware +namespace VideoApi.Middleware.Validation { public class RequestModelValidatorFilter : IAsyncActionFilter { @@ -26,14 +26,18 @@ public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionE _logger.LogDebug("Processing request"); foreach (var property in context.ActionDescriptor.Parameters) { + var isNullable = Nullable.GetUnderlyingType(property.ParameterType) != null; var valuePair = context.ActionArguments.SingleOrDefault(x => x.Key == property.Name); + + // requests with a body should have a validator if (property.BindingInfo?.BindingSource == BindingSource.Body) { var validationFailures = _requestModelValidatorService.Validate(property.ParameterType, valuePair.Value); context.ModelState.AddFluentValidationErrors(validationFailures); } - if (valuePair.Value != null && valuePair.Value.Equals(GetDefaultValue(property.ParameterType))) + // validate non body parameters, but ignore nullable params that have not been set + if (!isNullable && valuePair.Value != null && valuePair.Value.Equals(GetDefaultValue(property.ParameterType))) { context.ModelState.AddModelError(valuePair.Key, $"Please provide a valid {valuePair.Key}"); } @@ -42,9 +46,9 @@ public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionE if (!context.ModelState.IsValid) { var errors = context.ModelState.Values.SelectMany(v => v.Errors.Select(b => b.ErrorMessage)).ToList(); - var errorsString = string.Join("; ", errors); - _logger.LogWarning("Request Validation Failed: {Errors}", errorsString); - context.Result = new BadRequestObjectResult(context.ModelState); + _logger.LogWarning($"Request Validation Failed: {string.Join("; ", errors)}"); + + context.Result = new BadRequestObjectResult(new ValidationProblemDetails(context.ModelState)); } else { diff --git a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorService.cs b/VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorService.cs similarity index 65% rename from VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorService.cs rename to VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorService.cs index be86620b2..a620e4029 100644 --- a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorService.cs +++ b/VideoApi/VideoApi/Middleware/Validation/RequestModelValidatorService.cs @@ -3,20 +3,21 @@ using FluentValidation; using FluentValidation.Results; -namespace VideoApi.ValidationMiddleware +namespace VideoApi.Middleware.Validation { public class RequestModelValidatorService : IRequestModelValidatorService { - private readonly IValidatorFactory _validatorFactory; + private readonly IServiceProvider _serviceProvider; - public RequestModelValidatorService(IValidatorFactory validatorFactory) + public RequestModelValidatorService(IServiceProvider serviceProvider) { - _validatorFactory = validatorFactory; + _serviceProvider = serviceProvider; } public IList Validate(Type requestModel, object modelValue) { - var validator = _validatorFactory.GetValidator(requestModel); + var genericType = typeof(IValidator<>).MakeGenericType(requestModel); + var validator = _serviceProvider.GetService(genericType) as IValidator; if (validator == null) { var failure = new ValidationFailure(modelValue.GetType().ToString(), "Validator not found for request"); diff --git a/VideoApi/VideoApi/Program.cs b/VideoApi/VideoApi/Program.cs index 8c990afdf..fdc56c9e5 100644 --- a/VideoApi/VideoApi/Program.cs +++ b/VideoApi/VideoApi/Program.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; @@ -5,6 +6,7 @@ namespace VideoApi { + [ExcludeFromCodeCoverage] public class Program { protected Program() diff --git a/VideoApi/VideoApi/Services/ConsultationService.cs b/VideoApi/VideoApi/Services/ConsultationService.cs index ffbb3be34..fc5b10fb0 100644 --- a/VideoApi/VideoApi/Services/ConsultationService.cs +++ b/VideoApi/VideoApi/Services/ConsultationService.cs @@ -10,7 +10,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.Services diff --git a/VideoApi/VideoApi/Services/VirtualRoomService.cs b/VideoApi/VideoApi/Services/VirtualRoomService.cs index 048a82ff9..1ca1ddd96 100644 --- a/VideoApi/VideoApi/Services/VirtualRoomService.cs +++ b/VideoApi/VideoApi/Services/VirtualRoomService.cs @@ -10,7 +10,7 @@ using VideoApi.Domain; using VideoApi.Domain.Enums; using VideoApi.Services.Contracts; -using VideoApi.Services.Kinly; +using VideoApi.Services.Clients; using Task = System.Threading.Tasks.Task; namespace VideoApi.Services diff --git a/VideoApi/VideoApi/Startup.cs b/VideoApi/VideoApi/Startup.cs index 5e5fb1cdd..d4d9e44fd 100644 --- a/VideoApi/VideoApi/Startup.cs +++ b/VideoApi/VideoApi/Startup.cs @@ -1,6 +1,5 @@ using System; using FluentValidation; -using FluentValidation.AspNetCore; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; @@ -16,9 +15,9 @@ using VideoApi.Common.Security.Kinly; using VideoApi.DAL; using VideoApi.Extensions; +using VideoApi.Middleware.Logging; +using VideoApi.Middleware.Validation; using VideoApi.Telemetry; -using VideoApi.ValidationMiddleware; -using VideoApi.Validations; using VideoApi.Services; namespace VideoApi @@ -60,16 +59,24 @@ public void ConfigureServices(IServiceCollection services) services.AddCustomTypes(Environment, useStub); RegisterAuth(services); - services.AddTransient(); + services.AddMvc(opt => opt.Filters.Add(typeof(LoggingMiddleware))); - services.AddMvc(opt => opt.Filters.Add(typeof(RequestModelValidatorFilter))) - .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining()); - services.AddTransient(); + services.AddTransient(); + + services.AddMvc(opt => + { + opt.Filters.Add(typeof(LoggingMiddleware)); + opt.Filters.Add(typeof(RequestModelValidatorFilter)); + opt.Filters.Add(new ProducesResponseTypeAttribute(typeof(string), 500)); + }); + services.AddValidatorsFromAssemblyContaining(); + services.AddDbContextPool(options => - { - options.UseSqlServer(Configuration.GetConnectionString("VideoApi")); - }); + { + options.UseSqlServer(Configuration.GetConnectionString("VideoApi"), + builder => builder.EnableRetryOnFailure(5, TimeSpan.FromSeconds(5), null)); + }); } private void RegisterSettings(IServiceCollection services) @@ -92,7 +99,7 @@ private void RegisterAuth(IServiceCollection serviceCollection) { var securitySettings = Configuration.GetSection("AzureAd").Get(); var serviceSettings = Configuration.GetSection("Services").Get(); - + serviceCollection.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; @@ -100,7 +107,7 @@ private void RegisterAuth(IServiceCollection serviceCollection) }) .AddJwtBearer(options => { - options.Authority = $"{securitySettings.Authority}{securitySettings.TenantId}"; + options.Authority = $"{securitySettings.Authority}{securitySettings.TenantId}"; options.TokenValidationParameters = new TokenValidationParameters() { ClockSkew = TimeSpan.Zero, @@ -113,22 +120,16 @@ private void RegisterAuth(IServiceCollection serviceCollection) serviceCollection.AddMvc(AddMvcPolicies); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - app.UseOpenApi(); - app.UseSwaggerUi3(c => - { - c.DocumentTitle = "Video API V1"; - }); + app.UseSwaggerUi3(c => { c.DocumentTitle = "Video API V1"; }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } - else if(!SettingsConfiguration.DisableHttpsRedirection) + else if (!SettingsConfiguration.DisableHttpsRedirection) { app.UseHsts(); app.UseHttpsRedirection(); @@ -137,13 +138,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseRouting(); app.UseAuthorization(); - + app.UseAuthentication(); app.UseCors("CorsPolicy"); - app.UseMiddleware(); app.UseMiddleware(); - + app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); }); } diff --git a/VideoApi/VideoApi/Swagger/AuthResponseOperationProcessor.cs b/VideoApi/VideoApi/Swagger/AuthResponseOperationProcessor.cs index c55e4d445..c2f82282e 100644 --- a/VideoApi/VideoApi/Swagger/AuthResponseOperationProcessor.cs +++ b/VideoApi/VideoApi/Swagger/AuthResponseOperationProcessor.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.AspNetCore.Authorization; using Namotion.Reflection; @@ -8,6 +9,7 @@ namespace VideoApi.Swagger { + [ExcludeFromCodeCoverage] public class AuthResponseOperationProcessor : IOperationProcessor { public bool Process(OperationProcessorContext context) diff --git a/VideoApi/VideoApi/Telemetry/SuccessfulDependencyProcessor.cs b/VideoApi/VideoApi/Telemetry/SuccessfulDependencyProcessor.cs index 99c9887fd..72c62fa27 100644 --- a/VideoApi/VideoApi/Telemetry/SuccessfulDependencyProcessor.cs +++ b/VideoApi/VideoApi/Telemetry/SuccessfulDependencyProcessor.cs @@ -17,7 +17,7 @@ public void Process(ITelemetry item) { var dependency = item as DependencyTelemetry; - if (dependency?.ResultCode.Equals("404", StringComparison.OrdinalIgnoreCase) == true) + if (dependency?.ResultCode?.Equals("404", StringComparison.OrdinalIgnoreCase) == true) { // To filter out external 404 errors. return; diff --git a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFactory.cs b/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFactory.cs deleted file mode 100644 index 0b94daf54..000000000 --- a/VideoApi/VideoApi/ValidationMiddleware/RequestModelValidatorFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using FluentValidation; - -namespace VideoApi.ValidationMiddleware -{ - public class RequestModelValidatorFactory : ValidatorFactoryBase - { - private readonly IServiceProvider _serviceProvider; - - public RequestModelValidatorFactory(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } - - public override IValidator CreateInstance(Type validatorType) - { - var validator = (IValidator)_serviceProvider.GetService(validatorType); - return validator; - } - } -} diff --git a/VideoApi/VideoApi/VideoApi.csproj b/VideoApi/VideoApi/VideoApi.csproj index bcbd9a4f1..2c0d42d6a 100644 --- a/VideoApi/VideoApi/VideoApi.csproj +++ b/VideoApi/VideoApi/VideoApi.csproj @@ -1,16 +1,16 @@ net6.0 - true - true - latestmajor + true + true + latestmajor - + true false false - false + false $(NoWarn);1591 @@ -23,8 +23,8 @@ ..\docker-compose.dcproj - - + + @@ -42,14 +42,14 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + @@ -58,11 +58,11 @@ - + - false + false - + Always @@ -73,20 +73,16 @@ Always - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/VideoApi/VideoApi/appsettings.json b/VideoApi/VideoApi/appsettings.json index 44edd7f6c..fedb30416 100644 --- a/VideoApi/VideoApi/appsettings.json +++ b/VideoApi/VideoApi/appsettings.json @@ -12,39 +12,52 @@ }, "AllowedHosts": "*", "AzureAd": { - "Authority": "https://login.microsoftonline.com/" + "Authority": "https://login.microsoftonline.com/", + "TenantId": "TenantId", + "ClientSecret": "ClientSecret", + "ClientId": "ClientId" }, "ConnectionStrings": { "VideoApi": "Server=(LocalDb)\\MSSQLLocalDB;Database=VhVideoApi;Trusted_Connection=True;" }, "KinlyConfiguration": { + "ApiSecret": "provide api key", + "SelfTestApiSecret": "provide api key", + "CallbackSecret": "provide api key", "Audience": "kinly.api.endpoints", - "Issuer": "hmcts.video.hearings.service" + "Issuer": "hmcts.video.hearings.service", + "ConferencePhoneNumber": "01234567890", + "ConferencePhoneNumberWelsh": "01234567890", + "KinlyApiUrl": "https://kinlyapi.url", + "KinlySelfTestApiUrl": "https://kinlyapi-selftest.url", + "CallbackUri": "https://callback.url", + "PexipNode": "pexipnode", + "PexipSelfTestNode": "pexipnode", + "ConferenceUsername": "conferenceUsername" }, "WowzaConfiguration": { "LoadBalancer": "https://wowza-example.net", - "RestApiEndpoints": [ - "https://wowza-example.net:0001", - "https://wowza-example.net:0000" - ], + "RestApiEndpoints:0": "https://wowza-example.net:0001", + "RestApiEndpoints:1": "https://wowza-example.net:0000", + "ServerName": "_defaultServer_", "StreamingEndpoint": "", "HostName": "", "Username": "", "Password": "", "StorageDirectory": "", "AzureStorageDirectory": "", - "StorageAccountName": "", - "StorageAccountKey": "", - "StorageContainerName": "", - "StorageEndpoint": "https://wowzestorageendpoint.net", + "StorageAccountName": "foo", + "StorageAccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "StorageContainerName": "bar", + "StorageEndpoint": "http://127.0.0.1:10000/", "ManagedIdentityClientId": "", "ApplicationName": "vh-recording-app" }, "CvpConfiguration": { - "StorageAccountName": "", - "StorageAccountKey": "", - "StorageContainerName": "", - "StorageEndpoint": "https://cvpstorageendpoint.net", + "StorageAccountName": "foo2", + "StorageAccountKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "StorageContainerName": "bar2", + "StorageEndpoint": "http://127.0.0.1:10000/", "ManagedIdentityClientId": "" }, "UseStub": "false", @@ -52,5 +65,9 @@ "RsaPrivateKey": "", "Issue": "https://vh-video-api-dev.azurewebsites.net", "ValidAudience": "vh-video-web" + }, + "Services:": { + "CallbackUri": "https://localhost:59390/callback", + "VideoApiResourceId": "VideoApiResourceId" } } diff --git a/VideoApi/VideoApi/global.json b/VideoApi/VideoApi/global.json new file mode 100644 index 000000000..5a0ab4af1 --- /dev/null +++ b/VideoApi/VideoApi/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "6.0.0", + "rollForward": "latestFeature" + } +} diff --git a/VideoApi/VideoApi/packages.lock.json b/VideoApi/VideoApi/packages.lock.json index bde5d190d..ca89af274 100644 --- a/VideoApi/VideoApi/packages.lock.json +++ b/VideoApi/VideoApi/packages.lock.json @@ -4,26 +4,27 @@ "net6.0": { "Azure.Identity": { "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "TTB+Od1T9Okr1QNhXY0pTvuOsNtHqykgR1YcTt8o7jlsk2AWiuCilaOMqESTAK7a103e7YWVqjv9v5O7MJJlTg==", + "requested": "[1.8.2, )", + "resolved": "1.8.2", + "contentHash": "ywnpn9MLhNTtBG12WOxSaomx0Dwu5HK5PyhHH/CApGrd1BCrhgEwdy4Uwy5IfAznJzVJKZRyKR9cp4aa61xYvA==", "dependencies": { - "Azure.Core": "1.0.2", - "Microsoft.Identity.Client": "4.1.0", - "System.Memory": "4.5.3", - "System.Security.Cryptography.ProtectedData": "4.5.0", - "System.Text.Json": "4.6.0", - "System.Threading.Tasks.Extensions": "4.5.2" + "Azure.Core": "1.25.0", + "Microsoft.Identity.Client": "4.49.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.25.3", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Storage.Blobs": { "type": "Direct", - "requested": "[12.4.2, )", - "resolved": "12.4.2", - "contentHash": "fhUwOl4qXy23StKvBHDHV5ALM34SczEETRgJWDJHwPW3sZNIYAi3GTBXlWAYPm4SNKR1JgpZSYTbMHrNYCr1DQ==", + "requested": "[12.14.1, )", + "resolved": "12.14.1", + "contentHash": "DvRBWUDMB2LjdRbsBNtz/LiVIYk56hqzSooxx4uq4rCdLj2M+7Vvoa1r+W35Dz6ZXL6p+SNcgEae3oZ+CkPfow==", "dependencies": { - "Azure.Core": "1.2.1", - "Azure.Storage.Common": "12.4.1" + "Azure.Storage.Common": "12.13.0", + "System.Text.Json": "4.7.2" } }, "FluentValidation.AspNetCore": { @@ -148,9 +149,9 @@ }, "SonarAnalyzer.CSharp": { "type": "Direct", - "requested": "[8.7.0.17535, )", - "resolved": "8.7.0.17535", - "contentHash": "c9f6HjLChuPcQpo6qUr/Bxmi6Q2ogOVINg2e9tjCeKT/hiL9Cxdw4XsNttiqAhY5AbmHJIs4rn/muXR4OOnAJg==" + "requested": "[8.56.0.67649, )", + "resolved": "8.56.0.67649", + "contentHash": "u5klyn4PBAOe38/CoPbxGjuMqJQ5K0M7SA17H2DHgHyQ+neSU+abneRGjSQSVD76kbYXzG7E1/KQwTuj+nnMZw==" }, "VH.Core.Configuration": { "type": "Direct", @@ -167,34 +168,36 @@ }, "ZymLabs.NSwag.FluentValidation": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "k57Y6NAlv1rqgHVbCV33gRfJWWX9JuI+zT4CdV/79P9kEecgtRI9tiLjL0DdMAT+PUWJSWG5VDBccSAQ3ZLuZw==", + "requested": "[0.6.2, )", + "resolved": "0.6.2", + "contentHash": "oo6Dx/D5pCMsCtSCuN9zpcykwLajW1qylUtpatpUBMdTuPca+9VLAJFOA9+AEsF7f4qPnyypQcN2e68sqXSYHA==", "dependencies": { - "FluentValidation": "9.0.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.5", - "NJsonSchema": "10.1.23" + "FluentValidation": "10.2.3", + "Microsoft.Extensions.Logging.Abstractions": "5.0.0", + "NJsonSchema": "10.4.4" } }, "Azure.Core": { "type": "Transitive", - "resolved": "1.2.1", - "contentHash": "U0zPuK0/ssiz0gvli1/sslqPKANZpCa7muDM3K4Vj6Pf6YKYNnpByQsnqFQTYafzr6cQ41mr1nM07I8jOm5UkA==", + "resolved": "1.25.0", + "contentHash": "X8Dd4sAggS84KScWIjEbFAdt2U1KDolQopTPoHVubG2y3CM54f9l6asVrP5Uy384NWXjsspPYaJgz5xHc+KvTA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.0.0", - "System.Buffers": "4.5.0", + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", "System.Diagnostics.DiagnosticSource": "4.6.0", - "System.Memory": "4.5.3", + "System.Memory.Data": "1.0.2", "System.Numerics.Vectors": "4.5.0", - "System.Threading.Tasks.Extensions": "4.5.2" + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" } }, "Azure.Storage.Common": { "type": "Transitive", - "resolved": "12.4.1", - "contentHash": "Q1/w9P9wJCKo+q2LF4pgZxNwgmqmArkxHjPW+Q1pugdc894T6HU4+3hmrFda1otS9CbAPhBLG98WOZ37jMPmFg==", + "resolved": "12.13.0", + "contentHash": "jDv8xJWeZY2Er9zA6QO25BiGolxg87rItt9CwAp7L/V9EPJeaz8oJydaNL9Wj0+3ncceoMgdiyEv66OF8YUwWQ==", "dependencies": { - "Azure.Core": "1.2.1" + "Azure.Core": "1.25.0", + "System.IO.Hashing": "6.0.0" } }, "Castle.Core": { @@ -508,8 +511,8 @@ }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==" + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" }, "Microsoft.CSharp": { "type": "Transitive", @@ -780,34 +783,27 @@ }, "Microsoft.Identity.Client": { "type": "Transitive", - "resolved": "4.21.1", - "contentHash": "vycgk7S/HAbHaUaK4Tid1fsWHsXdFRRP2KavAIOHCVV27zvuQfYAjXmMvctuuF4egydSumG58CwPZob3gWeYgQ==" + "resolved": "4.50.0", + "contentHash": "zCgRgMTYTkcgeNgryKyHKFJa6I7JPiepKBTnPvlvsSjBilXObn+fRwe8hvkzAcTWMBQna2TpGvwkVm1XTxnxBA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "2.25.3", + "contentHash": "I6/Od0d3OMD9b7RPxW1l25A8oA94H+r9ZtrOe4Ogk49Ftxhs9RS+pbzPE5dLe0i7nQy+1aob7mR22YsNcc0BiQ==", + "dependencies": { + "Microsoft.Identity.Client": "4.49.1", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } }, "Microsoft.IdentityModel.Abstractions": { "type": "Transitive", "resolved": "6.25.0", "contentHash": "70MbUvri/xthpVpSEve7X6ysNtTe5MgLEgNyhnZ5z7WXVgFOkUfI7RNtqS6oenLoaaMpnRJrrZFt9Pps5NknBQ==" }, - "Microsoft.IdentityModel.Clients.ActiveDirectory": { - "type": "Transitive", - "resolved": "5.2.8", - "contentHash": "VIi6Bzt0UWEeannuEjtRFr/LgUXXw70a9LlIVfoCGorztZhzHgKiof6UJE1ETRYlf/L+kepsUZeekYZwqb6xPg==", - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Net.Http": "4.3.4", - "System.Private.Uri": "4.3.2", - "System.Runtime.Serialization.Formatters": "4.3.0", - "System.Runtime.Serialization.Json": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.SecureString": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "Microsoft.IdentityModel.JsonWebTokens": { "type": "Transitive", "resolved": "6.25.0", @@ -870,8 +866,8 @@ }, "Microsoft.NETCore.Targets": { "type": "Transitive", - "resolved": "1.1.3", - "contentHash": "3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==" + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, "Microsoft.OpenApi": { "type": "Transitive", @@ -1049,18 +1045,18 @@ }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==" + "resolved": "4.3.0", + "contentHash": "HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==" }, "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==" + "resolved": "4.3.0", + "contentHash": "+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==" }, "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==" + "resolved": "4.3.0", + "contentHash": "c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==" }, "runtime.native.System": { "type": "Transitive", @@ -1099,30 +1095,30 @@ }, "runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", + "resolved": "4.3.0", + "contentHash": "NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==" + "resolved": "4.3.0", + "contentHash": "b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==" }, "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==" + "resolved": "4.3.0", + "contentHash": "KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==" }, "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": { "type": "Transitive", @@ -1131,28 +1127,28 @@ }, "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==" + "resolved": "4.3.0", + "contentHash": "X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==" }, "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==" + "resolved": "4.3.0", + "contentHash": "nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==" }, "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==" + "resolved": "4.3.0", + "contentHash": "ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==" }, "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==" + "resolved": "4.3.0", + "contentHash": "I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==" }, "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": { "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==" + "resolved": "4.3.0", + "contentHash": "VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==" }, "Swashbuckle.AspNetCore.Swagger": { "type": "Transitive", @@ -1255,8 +1251,8 @@ }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" }, "System.ComponentModel.Primitives": { "type": "Transitive", @@ -1530,11 +1526,11 @@ }, "System.IO.FileSystem.AccessControl": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "vMToiarpU81LR1/KZtnT7VDPvqAZfw9oOS5nY6pPP78nGYz3COLsQH3OfzbR+SjTgltd31R6KmKklz/zDpTmzw==", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", "dependencies": { - "System.Security.AccessControl": "4.7.0", - "System.Security.Principal.Windows": "4.7.0" + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" } }, "System.IO.FileSystem.Primitives": { @@ -1545,6 +1541,11 @@ "System.Runtime": "4.3.0" } }, + "System.IO.Hashing": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Rfm2jYCaUeGysFEZjDe7j1R4x6Z6BzumS/vUT5a1AA/AWJuGX71PoGB0RmpyX3VmrGqVnAwtfMn39OHR8Y/5+g==" + }, "System.IO.Pipelines": { "type": "Transitive", "resolved": "4.7.3", @@ -1603,15 +1604,24 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Memory.Data": { + "type": "Transitive", + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" + } }, "System.Net.Http": { "type": "Transitive", - "resolved": "4.3.4", - "contentHash": "aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", + "resolved": "4.3.0", + "contentHash": "sYg+FtILtRQuYWSIAuNOELwVuVsxVyJGWQyOnlAzhV4xvhyFnON1bAzYYC+jjRW8JREM45R0R5Dgi8MTC5sEwA==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Platforms": "1.1.0", "System.Collections": "4.3.0", "System.Diagnostics.Debug": "4.3.0", "System.Diagnostics.DiagnosticSource": "4.3.0", @@ -1636,7 +1646,7 @@ "System.Threading.Tasks": "4.3.0", "runtime.native.System": "4.3.0", "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" } }, "System.Net.Primitives": { @@ -1680,47 +1690,6 @@ "System.Threading": "4.3.0" } }, - "System.Private.DataContractSerialization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XmlDocument": "4.3.0", - "System.Xml.XmlSerializer": "4.3.0" - } - }, - "System.Private.Uri": { - "type": "Transitive", - "resolved": "4.3.2", - "contentHash": "o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.1", - "Microsoft.NETCore.Targets": "1.1.3" - } - }, "System.Reflection": { "type": "Transitive", "resolved": "4.3.0", @@ -1882,37 +1851,6 @@ "System.Runtime.Extensions": "4.3.0" } }, - "System.Runtime.Serialization.Formatters": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - } - }, - "System.Runtime.Serialization.Json": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", - "dependencies": { - "System.IO": "4.3.0", - "System.Private.DataContractSerialization": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Serialization.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", - "dependencies": { - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - } - }, "System.Security.AccessControl": { "type": "Transitive", "resolved": "6.0.0", @@ -2065,23 +2003,8 @@ }, "System.Security.Principal.Windows": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==" - }, - "System.Security.SecureString": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - } + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" }, "System.Text.Encoding": { "type": "Transitive", @@ -2158,8 +2081,8 @@ }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.5.2", - "contentHash": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==" + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" }, "System.Threading.Timer": { "type": "Transitive", @@ -2237,30 +2160,6 @@ "System.Xml.ReaderWriter": "4.3.0" } }, - "System.Xml.XmlSerializer": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XmlDocument": "4.3.0" - } - }, "System.Xml.XPath": { "type": "Transitive", "resolved": "4.3.0", @@ -2331,7 +2230,7 @@ "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "[2.21.0, )", "Microsoft.Extensions.Caching.Abstractions": "[7.0.0, )", - "Microsoft.IdentityModel.Clients.ActiveDirectory": "[5.2.8, )", + "Microsoft.Identity.Client": "[4.50.0, )", "Newtonsoft.Json": "[13.0.2, )", "System.IdentityModel.Tokens.Jwt": "[6.25.0, )", "VideoApi.Domain": "[1.0.0, )" @@ -2340,7 +2239,7 @@ "videoapi.contract": { "type": "Project", "dependencies": { - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.dal": { @@ -2362,7 +2261,7 @@ "dependencies": { "Enums.NET": "[4.0.0, )", "RandomStringCreator": "[2.0.0, )", - "System.ComponentModel.Annotations": "[4.7.0, )" + "System.ComponentModel.Annotations": "[5.0.0, )" } }, "videoapi.events": { @@ -2378,7 +2277,7 @@ "videoapi.services": { "type": "Project", "dependencies": { - "Azure.Storage.Blobs": "[12.4.2, )", + "Azure.Storage.Blobs": "[12.14.1, )", "Microsoft.AspNetCore.Mvc.Abstractions": "[2.2.0, )", "Microsoft.Extensions.Configuration": "[7.0.0, )", "Polly": "[7.2.0, )", diff --git a/azure-pipelines.sds.pr-release.yml b/azure-pipelines.sds.pr-release.yml index 4d3bcf289..3adc878eb 100644 --- a/azure-pipelines.sds.pr-release.yml +++ b/azure-pipelines.sds.pr-release.yml @@ -9,408 +9,394 @@ resources: endpoint: hmcts parameters: -- name: pr_number - type: string - default: ' ' + - name: pr_number + type: string + default: " " -variables: -- name: pr_number - ${{ if eq(parameters.pr_number, ' ') }}: - value: $(System.PullRequest.PullRequestNumber) - ${{ else }}: - value: ${{ parameters.pr_number }} +variables: + - name: pr_number + ${{ if eq(parameters.pr_number, ' ') }}: + value: $(System.PullRequest.PullRequestNumber) + ${{ else }}: + value: ${{ parameters.pr_number }} trigger: none pr: - master -pool: +pool: vmImage: ubuntu-22.04 stages: -#################################################### -# CI Build Checks. ################################# -- stage: CI_Build - displayName: CI Build - variables: - - template: variables/shared.yaml - jobs: - - job: CI_Helm - displayName: "Helm CI" - steps: - - checkout: self - - - template: templates\Containerisation\helm\helm-lint.yaml@azTemplates - parameters: - chartPath: ${{ variables.chartPath }} - chartValuesPath: ${{ variables.chartPath }} - - - job: UnitTests - displayName: "Unit Tests" - steps: - - checkout: self - - - template: templates/sonarCloud/prepare.yml@azTemplates - parameters: - ExtraProperties: | - sonar.cs.opencover.reportsPaths=$(Common.TestResultsDirectory)\Coverage\coverage.opencover.xml - sonar.coverage.exclusions=**/Program.cs,**/Startup.cs,**/VideoApi/Extensions/**,**/VideoApiI/Swagger/**,**/VideoApi/ConfigureServicesExtensions.cs,**/Testing.Common/**/*,**/VideoApi.Common/**,**/VideoApi.DAL/Mappings/**,**/VideoApi.DAL/SeedData/**,**/VideoApi.DAL/VideoApiDbContext.cs,**/VideoApi.DAL/**/DesignTimeHearingsContextFactory.cs,**/VideoApi.DAL/Migrations/*,**/VideoApi.Domain/Ddd/*,**/VideoApi.Domain/Validations/* - sonar.cpd.exclusions=**/VideoApi.DAL/Migrations/** - sonar.issue.ignore.multicriteria=e1 - sonar.issue.ignore.multicriteria.e1.ruleKey=csharpsquid:S107 - sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.cs - - - template: stages\dotnet-tests\unit-tests.yml@azTemplates - parameters: - #vstsFeedId: 'Video Hearings/vh-packages' - dotnetCoreVersion: '6.x' - nugetConfigPath: ${{ variables.appName }} # Temp - Change To SDS Feed When Possible. - unitTestProjectPath: "${{ variables.appName }}/${{ variables.appName }}.UnitTests" - coverletCoverageExclusions: - - '[VideoApi.*Tests?]*' - - '[VideoApi]Startup' - - '[VideoApi.Common]*' - - '[VideoApi.Common]*' - - - template: templates/sonarCloud/runAnalysis.yml@azTemplates - -#################################################### -# Pre Release Tasks. ############################### -- stage: Pre_Release_Tasks - displayName: Pre-Release Tasks - variables: - - template: variables/shared.yaml - jobs: - - job: Generate_Entity_Framework_Script - displayName: "Generate Entity Framework Script" - steps: - - template: templates/Database/EntityFramework/generate-script.yaml@azTemplates + #################################################### + # CI Build Checks. ################################# + - stage: CI_Build + displayName: CI Build + variables: + - template: variables/shared.yaml + jobs: + - job: CI_Helm + displayName: "Helm CI" + steps: + - checkout: self + + - template: templates\Containerisation\helm\helm-lint.yaml@azTemplates + parameters: + chartPath: ${{ variables.chartPath }} + chartValuesPath: ${{ variables.chartPath }} + + - job: UnitAndIntegrationTests + displayName: "Unit and Integration Tests" + steps: + - checkout: self + + - template: templates/dotnet/build-test-analyse.yml@azTemplates + parameters: + nugetConfigPath: nuget.sds.config # remove this once the sds config file is removed + appName: ${{ variables.appName }} + dockerComposeTestFile: docker-compose.tests.yml + sonarExtraProperties: | + sonar.cs.opencover.reportsPaths=$(System.DefaultWorkingDirectory)/coverage.opencover.xml + sonar.exclusions=**/Program.cs, **/Startup.cs, **/Testing.Common/**/*, **/VideoApi/Swagger/**/*, VideoApi/VideoApi.DAL/Migrations/* + sonar.coverage.exclusions=**/VideoApi/Swagger/**/*, **/Program.cs, **/Startup.cs, **/Testing.Common/**/*, **/VideoApi.Common/**/*, **/VideoApi.IntegrationTests/**/*, **/VideoApi.UnitTests/**/*, **/VideoApi/Extensions/* + + #################################################### + # Pre Release Tasks. ############################### + - stage: Pre_Release_Tasks + displayName: Pre-Release Tasks + variables: + - template: variables/shared.yaml + jobs: + - job: Generate_Entity_Framework_Script + displayName: "Generate Entity Framework Script" + steps: + - template: templates/Database/EntityFramework/generate-script.yaml@azTemplates + parameters: + outputPath: $(Build.StagingDirectory) + contextName: ${{ variables.efContextName }} + workingPath: $(System.DefaultWorkingDirectory)/${{ variables.appName }}/${{ variables.appName }} + migrationsPath: ${{ variables.appName }}/${{ variables.appName }}.DAL/Migrations + projectName: ${{ variables.efProjectName }} + + - job: package_nuget + displayName: "Package NuGet Packages" + steps: + - template: templates\dotnet\package-nuget-packages.yml@azTemplates + parameters: + nugetProjectPath: "${{ variables.appName }}/${{ variables.nuget_package_name }}" + vstsFeed: "${{ variables.nuget_org_name }}/${{ variables.nuget_feed_name }}" + gitVersionConfigPath: ${{ variables.git_version_config_path }} + + - job: PublishAcceptanceTests + dependsOn: package_nuget + displayName: Publish Acceptance Tests + variables: + projectPath: "${{ variables.appName }}/${{ variables.appName }}" + steps: + - template: templates\dotnet\publish-acceptance-tests.yml@azTemplates + parameters: + netVersion: 6.x + coreProjectPath: $(projectPath) + nugetProjectPath: $(projectPath) + nugetConfigPath: ${{ variables.appName }} + useNugetConfig: true + + ##################################################### + # Build Docker Image. ############################### + - stage: Dock + displayName: Docker Build & Push Image + variables: + - group: aks-cluster-info + - template: variables/dev.yaml + - template: variables/shared.yaml parameters: - outputPath: $(Build.StagingDirectory) - contextName: ${{ variables.efContextName }} - workingPath: $(System.DefaultWorkingDirectory)/${{ variables.appName }}/${{ variables.appName }} - migrationsPath: ${{ variables.appName }}/${{ variables.appName }}.DAL/Migrations - projectName: ${{ variables.efProjectName }} - - - job: package_nuget - displayName: "Package NuGet Packages" - steps: - - template: templates\dotnet\package-nuget-packages.yml@azTemplates + env: ${{ variables.env }} + prNumber: ${{ variables.pr_number }} + - group: vh-github-app-credentials + jobs: + - job: Dock + displayName: "Build and Push Image ${{ variables.git_repo_name }}" + steps: + - checkout: self + + - template: templates\Github\get-app-token.yaml@azTemplates + parameters: + privateKeyFileName: ${{ variables.gh_app_private_key_file_name }} + appId: $(gh_app_app_id) + + - template: templates\Github\bump-chart-versions.yaml@azTemplates + parameters: + chartName: ${{ variables.chartName }} + chartPath: $(Build.SourcesDirectory) + chartBranch: $(System.PullRequest.SourceBranch) + githubToken: $(githubappinstall.token) + githubUsername: $(gh_app_name) + githubEmail: "$(gh_app_app_id)+$(gh_app_name)[bot]@users.noreply.github.com" + + - bash: | + sed -i "s|||" nuget.sds.config + displayName: Add NuGet Feed Authentication + workingDirectory: ${{ variables.appName }} + + - template: templates\Containerisation\docker\docker-compose.yaml@azTemplates + parameters: + azureSubscription: ${{ variables.acrSubscription }} + acrName: ${{ variables.acrName }} + repositoryName: ${{ variables.repositoryName }} + + - template: templates\Containerisation\docker\docker-push-azure.yaml@azTemplates + parameters: + azureSubscription: ${{ variables.acrSubscription }} + acrName: ${{ variables.acrName }} + repositoryName: ${{ variables.repositoryName }} + imageName: "${{ replace(variables.git_repo_name, '-', '') }}" + imageTags: + - "${{ variables.prTagName }}" + + ##################################################### + # Run Entity Framework Dev. ######################### + - stage: Run_Entity_Framework_Dev + displayName: Run Entity Framework Dev + dependsOn: Dock + variables: + - template: variables/dev.yaml + - template: variables/shared.yaml parameters: - nugetProjectPath: "${{ variables.appName }}/${{ variables.nuget_package_name }}" - vstsFeed: "${{ variables.nuget_org_name }}/${{ variables.nuget_feed_name }}" - gitVersionConfigPath: ${{ variables.git_version_config_path }} + env: ${{ variables.env }} + prNumber: ${{ variables.pr_number }} + jobs: + - job: Run_Entity_Framework_Dev + pool: + vmImage: "windows-latest" # This Job Must be Run on Windows + displayName: Run Entity Framework Dev + steps: + - download: current + displayName: Download Sql Artifact + + - template: templates/Database/EntityFramework/run-entity-framework.yaml@azTemplates + parameters: + sqlServerResourceGroup: ${{ variables.vhResourceGroup }} + sqlServerName: ${{ variables.vhSQLServerName }} + databaseName: ${{ variables.videoApiDbName }} + azureSubscription: ${{ variables.subscriptionName }} + sqlScriptLocation: "$(Pipeline.Workspace)/${{ variables.efContextName }}-$(Build.BuildId)/${{ variables.efContextName }}.sql" + kvfirewallRequired: false + kvName: ${{ variables.vhKeyVault }} + kvSqlPasswordSecret: ${{ variables.vhSqlPasswordSecret }} + kvSqlUsernameSecret: ${{ variables.vhSqlUsernameSecret }} - - job: PublishAcceptanceTests - dependsOn: package_nuget - displayName: Publish Acceptance Tests + ##################################################### + # Deploy Helm Chart to Dev. ######################### + - stage: Install + dependsOn: Run_Entity_Framework_Dev + displayName: Deploy Helm Chart Dev AKS variables: - projectPath: "${{ variables.appName }}/${{ variables.appName }}" - steps: - - template: templates\dotnet\publish-acceptance-tests.yml@azTemplates - parameters: - netVersion: 6.x - coreProjectPath: $(projectPath) - nugetProjectPath: $(projectPath) - nugetConfigPath: ${{ variables.appName }} - useNugetConfig: true - -##################################################### -# Build Docker Image. ############################### -- stage: Dock - displayName: Docker Build & Push Image - variables: - - group: aks-cluster-info - - template: variables/dev.yaml - - template: variables/shared.yaml - parameters: - env: ${{ variables.env }} - prNumber: ${{ variables.pr_number }} - - group: vh-github-app-credentials - jobs: - - job: Dock - displayName: "Build and Push Image ${{ variables.git_repo_name }}" - steps: - - checkout: self - - - template: templates\Github\get-app-token.yaml@azTemplates - parameters: - privateKeyFileName: ${{ variables.gh_app_private_key_file_name }} - appId: $(gh_app_app_id) - - - template: templates\Github\bump-chart-versions.yaml@azTemplates - parameters: - chartName: ${{ variables.chartName }} - chartPath: $(Build.SourcesDirectory) - chartBranch: $(System.PullRequest.SourceBranch) - githubToken: $(githubappinstall.token) - githubUsername: $(gh_app_name) - githubEmail: "$(gh_app_app_id)+$(gh_app_name)[bot]@users.noreply.github.com" - - - bash: | - sed -i "s|||" nuget.sds.config - displayName: Add NuGet Feed Authentication - workingDirectory: ${{ variables.appName }} - - - template: templates\Containerisation\docker\docker-compose.yaml@azTemplates - parameters: - azureSubscription: ${{ variables.acrSubscription }} - acrName: ${{ variables.acrName }} - repositoryName: ${{ variables.repositoryName }} - - - template: templates\Containerisation\docker\docker-push-azure.yaml@azTemplates - parameters: - azureSubscription: ${{ variables.acrSubscription }} - acrName: ${{ variables.acrName }} - repositoryName: ${{ variables.repositoryName }} - imageName: "${{ replace(variables.git_repo_name, '-', '') }}" - imageTags: - - '${{ variables.prTagName }}' - -##################################################### -# Run Entity Framework Dev. ######################### -- stage: Run_Entity_Framework_Dev - displayName: Run Entity Framework Dev - dependsOn: Dock - variables: - - template: variables/dev.yaml - - template: variables/shared.yaml - parameters: - env: ${{ variables.env }} - prNumber: ${{ variables.pr_number }} - jobs: - - job: Run_Entity_Framework_Dev - pool: - vmImage: 'windows-latest' # This Job Must be Run on Windows - displayName: Run Entity Framework Dev - steps: - - download: current - displayName: Download Sql Artifact + - group: vh-github-app-credentials + - template: variables/dev.yaml + - template: variables/shared.yaml + parameters: + env: ${{ variables.env }} + prNumber: ${{ variables.pr_number }} + - name: dnsRecordName + value: vh-${{ variables.git_repo_name }}-${{ variables.prTagPrefix }} + jobs: + - job: helm_uninstall + displayName: Uninstall Helm from Dev + steps: + - template: templates\Azure\Aks\get-active-cluster.yaml@azTemplates + parameters: + subscriptionName: "${{ variables.subscriptionName }}" + environment: ${{ variables.env }} - - template: templates/Database/EntityFramework/run-entity-framework.yaml@azTemplates + - template: templates/Containerisation/helm/helm-uninstall.yaml@azTemplates + parameters: + namespace: "vh" + releaseName: "${{ variables.chartName }}-${{ variables.prTagPrefix }}" + azureSubscription: "${{ variables.subscriptionName }}" + aksResourceGroupName: "$(aksCluster.resourceGroup)" + aksClusterName: "$(aksCluster.name)" + + - job: aks_push + displayName: Deploy To Dev AKS + dependsOn: helm_uninstall + steps: + - template: templates\Azure\Aks\get-active-cluster.yaml@azTemplates + parameters: + subscriptionName: "${{ variables.subscriptionName }}" + environment: ${{ variables.env }} + - template: templates/Containerisation/helm/helm-install.yaml@azTemplates + parameters: + privateKeyFileName: ${{ variables.gh_app_private_key_file_name }} + appId: $(gh_app_app_id) + envValuesTemplatePath: ${{ variables.envValuesTemplatePath }} + envValuesPath: ${{ variables.envValuesPath }} + acrName: ${{ variables.acrName }} + repositoryName: ${{ variables.repositoryName }} + prTagName: ${{ variables.prTagName }} + releaseName: "${{ variables.chartName }}-${{ variables.prTagPrefix }}" + dnsRecordName: ${{ variables.dnsRecordName }} + dnsZone: ${{ variables.dnsZone }} + env: ${{ variables.env }} + chartName: ${{ variables.chartName }} + chartPath: ${{ variables.chartPath }} + subscriptionName: "${{ variables.subscriptionName }}" + aksResourceGroupName: "$(aksCluster.resourceGroup)" + aksClusterName: "$(aksCluster.name)" + dnsSubscriptionName: "${{ variables.dnsZoneSubscription }}" + dnsResourceGroupName: "${{ variables.dnsZoneResourceGroup }}" + + ################################################## + # Deploy Nuget Packages. ######################### + - stage: Push_Nuget + dependsOn: Run_Entity_Framework_Dev + displayName: Deploy NuGet Packages + variables: + - template: variables/dev.yaml + - template: variables/shared.yaml parameters: - sqlServerResourceGroup: ${{ variables.vhResourceGroup }} - sqlServerName: ${{ variables.vhSQLServerName }} - databaseName: ${{ variables.videoApiDbName }} - azureSubscription: ${{ variables.subscriptionName }} - sqlScriptLocation: "$(Pipeline.Workspace)/${{ variables.efContextName }}-$(Build.BuildId)/${{ variables.efContextName }}.sql" - kvfirewallRequired: false - kvName: ${{ variables.vhKeyVault }} - kvSqlPasswordSecret: ${{ variables.vhSqlPasswordSecret }} - kvSqlUsernameSecret: ${{ variables.vhSqlUsernameSecret }} - -##################################################### -# Deploy Helm Chart to Dev. ######################### -- stage: Install - dependsOn: Run_Entity_Framework_Dev - displayName: Deploy Helm Chart Dev AKS - variables: - - group: vh-github-app-credentials - - template: variables/dev.yaml - - template: variables/shared.yaml - parameters: - env: ${{ variables.env }} - prNumber: ${{ variables.pr_number }} - - name: dnsRecordName - value: vh-${{ variables.git_repo_name }}-${{ variables.prTagPrefix }} - jobs: - - job: helm_uninstall - displayName: Uninstall Helm from Dev - steps: - - template: templates\Azure\Aks\get-active-cluster.yaml@azTemplates - parameters: - subscriptionName: "${{ variables.subscriptionName }}" - environment: ${{ variables.env }} - - - template: templates/Containerisation/helm/helm-uninstall.yaml@azTemplates - parameters: - namespace: 'vh' - releaseName: "${{ variables.chartName }}-${{ variables.prTagPrefix }}" - azureSubscription: "${{ variables.subscriptionName }}" - aksResourceGroupName: "$(aksCluster.resourceGroup)" - aksClusterName: "$(aksCluster.name)" - - - job: aks_push - displayName: Deploy To Dev AKS - dependsOn: helm_uninstall - steps: - - template: templates\Azure\Aks\get-active-cluster.yaml@azTemplates - parameters: - subscriptionName: "${{ variables.subscriptionName }}" - environment: ${{ variables.env }} - - template: templates/Containerisation/helm/helm-install.yaml@azTemplates - parameters: - privateKeyFileName: ${{ variables.gh_app_private_key_file_name }} - appId: $(gh_app_app_id) - envValuesTemplatePath: ${{ variables.envValuesTemplatePath }} - envValuesPath: ${{ variables.envValuesPath }} - acrName: ${{ variables.acrName }} - repositoryName: ${{ variables.repositoryName }} - prTagName: ${{ variables.prTagName }} - releaseName: "${{ variables.chartName }}-${{ variables.prTagPrefix }}" - dnsRecordName: ${{ variables.dnsRecordName }} - dnsZone: ${{ variables.dnsZone }} - env: ${{ variables.env }} - chartName: ${{ variables.chartName }} - chartPath: ${{ variables.chartPath }} - subscriptionName: "${{ variables.subscriptionName }}" - aksResourceGroupName: "$(aksCluster.resourceGroup)" - aksClusterName: "$(aksCluster.name)" - dnsSubscriptionName: "${{ variables.dnsZoneSubscription }}" - dnsResourceGroupName: "${{ variables.dnsZoneResourceGroup }}" - -################################################## -# Deploy Nuget Packages. ######################### -- stage: Push_Nuget - dependsOn: Run_Entity_Framework_Dev - displayName: Deploy NuGet Packages - variables: - - template: variables/dev.yaml - - template: variables/shared.yaml - parameters: - env: ${{ variables.env }} - prNumber: ${{ variables.pr_number }} - jobs: - - job: Publish_Nuget - displayName: Publish NuGet Packages - steps: - - template: templates\dotnet\push-nuget-packages.yml@azTemplates - parameters: - vstsFeed: "${{ variables.nuget_org_name }}/${{ variables.nuget_feed_name }}" - -################################################## -# Run Acceptance Tests. ########################## -- stage: Acceptance_Tests_Dev - dependsOn: Install - displayName: Acceptance Tests Dev - variables: - - group: vh-video-api - - template: variables/dev.yaml - - template: variables/shared.yaml - parameters: - env: ${{ variables.env }} - prNumber: ${{ variables.pr_number }} - - name: dnsRecordName - value: vh-${{ variables.git_repo_name }}-${{ variables.prTagPrefix }} - jobs: - - job: AcceptanceTestsDev - pool: VH Self Hosted + env: ${{ variables.env }} + prNumber: ${{ variables.pr_number }} + jobs: + - job: Publish_Nuget + displayName: Publish NuGet Packages + steps: + - template: templates\dotnet\push-nuget-packages.yml@azTemplates + parameters: + vstsFeed: "${{ variables.nuget_org_name }}/${{ variables.nuget_feed_name }}" + + ################################################## + # Run Acceptance Tests. ########################## + - stage: Acceptance_Tests_Dev + dependsOn: Install displayName: Acceptance Tests Dev - steps: - - template: templates/dotnet/run-acceptance-tests.yml@azTemplates - parameters: - environment: ${{ variables.env }} - azureSubscription: ${{ variables.subscriptionName }} - acceptanceTestSettings: - # App Insights - - name: ApplicationInsights:InstrumentationKey - value: applicationinsights--instrumentationkey - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - # Azure AD - - name: AzureAd:ClientId - value: azuread--clientid - keyVaultName: vh-video-api-${{ variables.env }} - secret: true - - name: AzureAd:ClientSecret - value: azuread--clientsecret - keyVaultName: vh-video-api-${{ variables.env }} - secret: true - - name: AzureAd:TenantId - value: azuread--tenantid - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - # Services Configuration - - name: Services:VideoApiResourceId - value: azuread--identifieruri - keyVaultName: vh-video-api-${{ variables.env }} - secret: true - - name: Services:CallbackUri - value: $(CallbackUri) - - name: Services:VideoApiUrl - value: "https://vh-video-api-pr-${{ variables.pr_number }}.dev.platform.hmcts.net" - - # Wowza Configuration - - name: WowzaConfiguration:RestApiEndpoints - value: wowzaconfiguration--endpoint-https - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StreamingEndpoint - value: wowzaconfiguration--endpoint-https - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:Username - value: wowzaconfiguration--username - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:Password - value: wowzaconfiguration--restPassword - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StorageDirectory - value: wowzaconfiguration--azure-storage-directory - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StorageAccountName - value: wowzaconfiguration--storage-account - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StorageAccountKey - value: wowzaconfiguration--storageaccountkey - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StorageContainerName - value: wowzaconfiguration--storage-account-container - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:StorageEndpoint - value: wowzaconfiguration--storage-account-endpoint - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: WowzaConfiguration:ManagedIdentityClientId - value: wowzaconfiguration--managedidentityclientid - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - # CVP Configuration - - name: CvpConfiguration:StorageAccountName - value: CvpConfiguration--StorageAccountName - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: CvpConfiguration:StorageAccountKey - value: CvpConfiguration--StorageAccountKey - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: CvpConfiguration:StorageContainerName - value: CvpConfiguration--StorageContainerName - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - name: CvpConfiguration:StorageEndpoint - value: CvpConfiguration--StorageEndpoint - keyVaultName: vh-infra-core-${{ variables.env }} - secret: true - - # Kinly Configuration - - name: KinlyConfiguration:ConferencePhoneNumber - value: $(ConferencePhoneNumber) - - name: KinlyConfiguration:ConferencePhoneNumberWelsh - value: $(ConferencePhoneNumberWelsh) - - name: KinlyConfiguration:KinlyApiUrl - value: $(KinlyApiUrl) - - name: KinlyConfiguration:KinlySelfTestApiUrl - value: $(KinlySelfTestApiUrl) - - name: KinlyConfiguration:ConferenceUsername - value: $(ConferenceUsername) - - name: KinlyConfiguration:CallbackUri - value: $(CallbackUri) - - # Quick Links Configuration - - name: QuickLinks:Issuer - value: $(Issuer) - - name: QuickLinks:RsaPrivateKey - value: $(RsaPrivateKey) - - name: QuickLinks:ValidAudience - value: $(ValidAudience) \ No newline at end of file + variables: + - group: vh-video-api + - template: variables/dev.yaml + - template: variables/shared.yaml + parameters: + env: ${{ variables.env }} + prNumber: ${{ variables.pr_number }} + - name: dnsRecordName + value: vh-${{ variables.git_repo_name }}-${{ variables.prTagPrefix }} + jobs: + - job: AcceptanceTestsDev + pool: VH Self Hosted + displayName: Acceptance Tests Dev + steps: + - template: templates/dotnet/run-acceptance-tests.yml@azTemplates + parameters: + environment: ${{ variables.env }} + azureSubscription: ${{ variables.subscriptionName }} + acceptanceTestSettings: + # App Insights + - name: ApplicationInsights:InstrumentationKey + value: applicationinsights--instrumentationkey + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + + # Azure AD + - name: AzureAd:ClientId + value: azuread--clientid + keyVaultName: vh-video-api-${{ variables.env }} + secret: true + - name: AzureAd:ClientSecret + value: azuread--clientsecret + keyVaultName: vh-video-api-${{ variables.env }} + secret: true + - name: AzureAd:TenantId + value: azuread--tenantid + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + + # Services Configuration + - name: Services:VideoApiResourceId + value: azuread--identifieruri + keyVaultName: vh-video-api-${{ variables.env }} + secret: true + - name: Services:CallbackUri + value: $(CallbackUri) + - name: Services:VideoApiUrl + value: "https://vh-video-api-pr-${{ variables.pr_number }}.dev.platform.hmcts.net" + + # Wowza Configuration + - name: WowzaConfiguration:RestApiEndpoints + value: wowzaconfiguration--endpoint-https + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StreamingEndpoint + value: wowzaconfiguration--endpoint-https + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:Username + value: wowzaconfiguration--username + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:Password + value: wowzaconfiguration--restPassword + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StorageDirectory + value: wowzaconfiguration--azure-storage-directory + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StorageAccountName + value: wowzaconfiguration--storage-account + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StorageAccountKey + value: wowzaconfiguration--storageaccountkey + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StorageContainerName + value: wowzaconfiguration--storage-account-container + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:StorageEndpoint + value: wowzaconfiguration--storage-account-endpoint + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: WowzaConfiguration:ManagedIdentityClientId + value: wowzaconfiguration--managedidentityclientid + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + + # CVP Configuration + - name: CvpConfiguration:StorageAccountName + value: CvpConfiguration--StorageAccountName + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: CvpConfiguration:StorageAccountKey + value: CvpConfiguration--StorageAccountKey + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: CvpConfiguration:StorageContainerName + value: CvpConfiguration--StorageContainerName + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + - name: CvpConfiguration:StorageEndpoint + value: CvpConfiguration--StorageEndpoint + keyVaultName: vh-infra-core-${{ variables.env }} + secret: true + + # Kinly Configuration + - name: KinlyConfiguration:ConferencePhoneNumber + value: $(ConferencePhoneNumber) + - name: KinlyConfiguration:ConferencePhoneNumberWelsh + value: $(ConferencePhoneNumberWelsh) + - name: KinlyConfiguration:KinlyApiUrl + value: $(KinlyApiUrl) + - name: KinlyConfiguration:KinlySelfTestApiUrl + value: $(KinlySelfTestApiUrl) + - name: KinlyConfiguration:ConferenceUsername + value: $(ConferenceUsername) + - name: KinlyConfiguration:CallbackUri + value: $(CallbackUri) + + # Quick Links Configuration + - name: QuickLinks:Issuer + value: $(Issuer) + - name: QuickLinks:RsaPrivateKey + value: $(RsaPrivateKey) + - name: QuickLinks:ValidAudience + value: $(ValidAudience) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5b73ef7fd..f9a6ebce9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,17 +17,17 @@ parameters: - name: RunUnitTests displayName: Run Unit Tests type: boolean - default: true + default: false - name: RunIntegTests displayName: Run Integration Tests type: boolean - default: true + default: false - name: RunSonarCloudTests displayName: Run Sonar Cloud Analysis type: boolean - default: true + default: false - name: RunMutationTests displayName: Run Mutation Tests @@ -37,7 +37,7 @@ parameters: - name: RunACTests displayName: Run Acceptance Tests type: boolean - default: true + default: false - name: testSettings type: object @@ -146,7 +146,7 @@ parameters: - name: AzureAd:Authority value: "https://login.microsoftonline.com/" - name: UseStub - value: 'false' + value: "false" # Services Configuration - name: Services:CallbackUri @@ -252,11 +252,6 @@ trigger: - release/* - hotfix/* -pr: - branches: - include: - - master - resources: repositories: - repository: templates @@ -307,10 +302,10 @@ extends: variables: - group: vh-video-api coverletCoverageExclusions: - - '[VideoApi.*Tests?]*' - - '[VideoApi]Startup' - - '[VideoApi.Common]*' - - '[VideoApi.Common]*' + - "[VideoApi.*Tests?]*" + - "[VideoApi]Startup" + - "[VideoApi.Common]*" + - "[VideoApi.Common]*" sonarCloud_ExtraProperties: | sonar.cs.opencover.reportsPaths=$(Common.TestResultsDirectory)\Coverage\coverage.opencover.xml sonar.coverage.exclusions=**/Program.cs,**/Startup.cs,**/VideoApi/Extensions/**,**/VideoApiI/Swagger/**,**/VideoApi/ConfigureServicesExtensions.cs,**/Testing.Common/**/*,**/VideoApi.Common/**,**/VideoApi.DAL/Mappings/**,**/VideoApi.DAL/SeedData/**,**/VideoApi.DAL/VideoApiDbContext.cs,**/VideoApi.DAL/**/DesignTimeHearingsContextFactory.cs,**/VideoApi.DAL/Migrations/*,**/VideoApi.Domain/Ddd/*,**/VideoApi.Domain/Validations/* diff --git a/docker-compose.tests.yml b/docker-compose.tests.yml new file mode 100644 index 000000000..bd2f9e305 --- /dev/null +++ b/docker-compose.tests.yml @@ -0,0 +1,64 @@ +version: '3.4' + +networks: + integration-tests: + driver: bridge + +services: + + vh-video-api-tests: + image: vh-api-tests + build: + context: ./ + dockerfile: tests/Dockerfile + entrypoint: + [ + "/wait-for-it.sh", + "test-db:1433", + "-t", + "120", + "--", + "/run-tests.sh" + ] + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ConnectionStrings__VideoApi=Data Source=test-db;Database=VideoApi;User Id=SA;Password=R4ndomP@assword;Trust Server Certificate=True;Encrypt=False + - Azure__StorageConnectionString=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1; + volumes: + - ./TestResults:/TestResults:rw + - ./Coverage:/Coverage:rw + - ./:/app:rw + depends_on: + - test-db + - azurite + networks: + - integration-tests + + azurite: + image: mcr.microsoft.com/azure-storage/azurite + hostname: azurite + restart: always + command: "azurite --blobHost 0.0.0.0 --blobPort 10000 --location /workspace --debug /workspace/debug.log" + ports: + - 11000:10000 + - 11001:10000 + - 11002:10000 + volumes: + - ./azurite:/workspace + networks: + - integration-tests + + test-db: + hostname: test-db + image: mcr.microsoft.com/azure-sql-edge + container_name: vh.videoapi.sql.testing + expose: + - 14330 + - 1433 + ports: + - 14330:1433 + environment: + - ACCEPT_EULA=Y + - SA_PASSWORD=R4ndomP@assword + networks: + - integration-tests diff --git a/docker-compose.yml b/docker-compose.yml index 3624c4711..7adb3172f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,4 +5,12 @@ services: image: ${DOCKER_REGISTRY-}videoapi:latest build: context: . - dockerfile: VideoApi/VideoApi/Dockerfile \ No newline at end of file + dockerfile: VideoApi/VideoApi/Dockerfile + + azurite: + image: mcr.microsoft.com/azure-storage/azurite + hostname: azurite + restart: always + command: "azurite --blobHost 0.0.0.0 --blobPort 10000" + ports: + - "10000:10000" diff --git a/scripts/tests/run-tests.sh b/scripts/tests/run-tests.sh new file mode 100755 index 000000000..f9c9413c0 --- /dev/null +++ b/scripts/tests/run-tests.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -x + +exclusions="[Testing.Common]*,[VideoApi.Common]VideoApi.Common.*,[VideoApi.Domain]*.Ddd*,[VideoApi.DAL]*.Migrations*,[VideoApi]*.Swagger,[VideoApi.Services]*" +configuration=Release + +# Script is for docker compose tests where the script is at the root level +dotnet test VideoApi/VideoApi.UnitTests/VideoApi.UnitTests.csproj -c $configuration --results-directory ./TestResults --logger "trx;LogFileName=VideoApi-Unit-Tests-TestResults.trx" \ + "/p:CollectCoverage=true" \ + "/p:Exclude=\"${exclusions}\"" \ + "/p:CoverletOutput=${PWD}/Coverage/" \ + "/p:MergeWith=${PWD}/Coverage/coverage.json" \ + "/p:CoverletOutputFormat=\"opencover,json,cobertura,lcov\"" + +dotnet test VideoApi/VideoApi.IntegrationTests/VideoApi.IntegrationTests.csproj -c $configuration --results-directory ./TestResults --logger "trx;LogFileName=VideoApi-Integration-Tests-TestResults.trx" \ + "/p:CollectCoverage=true" \ + "/p:Exclude=\"${exclusions}\"" \ + "/p:CoverletOutput=${PWD}/Coverage/" \ + "/p:MergeWith=${PWD}/Coverage/coverage.json" \ + "/p:CoverletOutputFormat=\"opencover,json,cobertura,lcov\"" diff --git a/tests/Dockerfile b/tests/Dockerfile new file mode 100644 index 000000000..ea887d7df --- /dev/null +++ b/tests/Dockerfile @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim +WORKDIR /app + +# Copy wait-for-it.sh to wait for sql before running integration tests +ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /wait-for-it.sh +# Make it executable, in Linux +RUN chmod +x /wait-for-it.sh + +COPY ["scripts/tests/run-tests.sh", "/"] +RUN chmod +x /run-tests.sh \ No newline at end of file diff --git a/variables/shared.yaml b/variables/shared.yaml index 72403fbed..17a827056 100644 --- a/variables/shared.yaml +++ b/variables/shared.yaml @@ -4,25 +4,25 @@ parameters: default: "" - name: prNumber type: string - default: '' + default: "" variables: - name: appName value: VideoApi - + - name: nuget_org_name - value: 'Video Hearings/vh-packages' + value: "Video Hearings/vh-packages" - name: nuget_feed_name - value: 'vh-packages' + value: "vh-packages" - name: git_version_config_path value: $(Build.SourcesDirectory)/sds-git-version-config.yml - name: nuget_package_name - value: 'VideoApi.Client' + value: "VideoApi.Client" - name: git_repo_name - value: 'video-api' + value: "video-api" - name: sonar_exclusion - value: '**/VideoApi.Contract/**,**/Video.API/Program.cs, **/Video.API/Startup.cs, **/Video.API/Extensions/**, **/Video.API/Swagger/**, **/Video.API/ConfigureServicesExtensions.cs, **/Testing.Common/**, **/Video.Common/**, **/Video.DAL/Mappings/**, **/Video.DAL/SeedData/**, **/Video.DAL/VideoDbContext.cs, **/Video.DAL/**/DesignTimeHearingsContextFactory.cs, Video.DAL/Migrations/**, **/Video.Domain/Ddd/**, **/Video.DAL/Commands/Core/**, **/Video.DAL/Queries/Core/**, **/Testing.Common/**, **/Video.DAL/Migrations/*, **/Video.DAL/Migrations/**, **/Migrations/*' + value: "**/VideoApi.Contract/**,**/Video.API/Program.cs, **/Video.API/Startup.cs, **/Video.API/Extensions/**, **/Video.API/Swagger/**, **/Video.API/ConfigureServicesExtensions.cs, **/Testing.Common/**, **/Video.Common/**, **/Video.DAL/Mappings/**, **/Video.DAL/SeedData/**, **/Video.DAL/VideoDbContext.cs, **/Video.DAL/**/DesignTimeHearingsContextFactory.cs, Video.DAL/Migrations/**, **/Video.Domain/Ddd/**, **/Video.DAL/Commands/Core/**, **/Video.DAL/Queries/Core/**, **/Testing.Common/**, **/Video.DAL/Migrations/*, **/Video.DAL/Migrations/**, **/Migrations/*" - name: prNumber ${{ if eq(parameters.prNumber, '')}}: @@ -30,30 +30,29 @@ variables: ${{ else }}: value: ${{ parameters.prNumber }} - name: prTagPrefix - value: 'pr-${{ variables.prNumber }}' + value: "pr-${{ variables.prNumber }}" - name: prTagName - value: '${{ variables.prTagPrefix }}-$(Build.BuildNumber)' + value: "${{ variables.prTagPrefix }}-$(Build.BuildNumber)" - name: imageName value: "${{ replace(variables.git_repo_name, '-', '') }}" - name: subscriptionName value: "DTS-SHAREDSERVICES-${{ upper(parameters.env) }}-Video Hearings" - name: acrSubscription - value: 'DTS-SHAREDSERVICES-PROD-Video Hearings' + value: "DTS-SHAREDSERVICES-PROD-Video Hearings" - name: acrName - value: 'sdshmctspublic' + value: "sdshmctspublic" - name: repositoryName - value: 'vh/${{ variables.git_repo_name }}' + value: "vh/${{ variables.git_repo_name }}" - name: gitRepoName value: vh-${{ variables.git_repo_name }} - - name: chartName value: "vh-${{ variables.git_repo_name }}" - name: chartRepoPath - value: '$(Build.SourcesDirectory)/' + value: "$(Build.SourcesDirectory)/" - name: chartPath - value: '$(Build.SourcesDirectory)/charts/vh-${{ variables.git_repo_name }}' + value: "$(Build.SourcesDirectory)/charts/vh-${{ variables.git_repo_name }}" - name: envValuesPath value: "${{ variables.chartPath }}/values.${env}.yaml" - name: envValuesTemplatePath @@ -68,7 +67,6 @@ variables: - name: gh_app_private_key_file_name value: hmcts-ado-cnp-app.private-key.pem - - name: vhSQLServerName value: vh-infra-core-${{ parameters.env }} - name: VideoApiDbName @@ -85,4 +83,4 @@ variables: - name: vhSqlUsernameSecret value: "vh-infra-core-${{ parameters.env }}-sql-username" - name: vhSqlPasswordSecret - value: "vh-infra-core-${{ parameters.env }}-sql-password" \ No newline at end of file + value: "vh-infra-core-${{ parameters.env }}-sql-password"