Skip to content

Commit

Permalink
Update Marain.TenantManagement to v3 (#313)
Browse files Browse the repository at this point in the history
* Update Marain.TenantManagement to v3
* Increase version
* Update build script version
  • Loading branch information
idg10 authored Dec 16, 2022
1 parent 0b41d67 commit 9ea8131
Show file tree
Hide file tree
Showing 26 changed files with 1,825 additions and 3,531 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ branches:
- feature
- support
- hotfix
next-version: "0.3"
next-version: "0.4"

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Corvus.Tenancy.Abstractions" Version="3.2.0" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PackageReference Include="Corvus.Tenancy.Abstractions" Version="3.5.0" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Corvus.Json.Abstractions" Version="2.0.6" />
<PackageReference Include="Corvus.Json.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.1.46">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ public static UserNotification AddDeliveryChannelConfiguredPerCommunicationType(
throw new ArgumentNullException(nameof(notification));
}

if (deliveryChannelConfiguredPerCommunicationType is null)
{
throw new ArgumentNullException(nameof(deliveryChannelConfiguredPerCommunicationType));
}

return new UserNotification(
notification.Id,
notification.NotificationType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.0" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1,585 changes: 549 additions & 1,036 deletions Solutions/Marain.UserNotifications.ApiDeliveryChannel.Host/packages.lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RestoreLockedMode Condition="$(ContinuousIntegrationBuild) == 'true'">true</RestoreLockedMode>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<!--
The reference to Microsoft.CodeAnalysis.CSharp is to prevent warnings from appearing for this project
in Visual Studio 2022. With version 17.1.0, and with version 6.0.200 of the .NET SDK installed, Visual
Expand All @@ -35,7 +35,7 @@
in the future. We don't really want it in here - it's not like this project uses that library directly. It's just
necessary with the current versions of everything on 2nd March 2022 if we are to avoid spurious warnings in VS.
-->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="[6.0.*,)" />
Expand Down
518 changes: 142 additions & 376 deletions Solutions/Marain.UserNotifications.Benchmarks/packages.lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Corvus.Extensions.Newtonsoft.Json" Version="2.0.6" />
<PackageReference Include="Corvus.Identity.Azure" Version="3.0.0" />
<PackageReference Include="Corvus.Identity.MicrosoftRest" Version="3.0.0" />
<PackageReference Include="Corvus.Extensions.Newtonsoft.Json" Version="3.0.0" />
<PackageReference Include="Corvus.Identity.Azure" Version="3.2.0" />
<PackageReference Include="Corvus.Identity.MicrosoftRest" Version="3.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.Extensions.Http" Version="[6.0.*,)" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.1.46">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@
],
"requiredConfigurationEntries": [
{
"contentType": "application/vnd.marain.tenancy.servicemanifests.requiredconfigurationentries.azuretablestorage",
"key": "userNotificationStore",
"containerDefinition": {
"tableName": "usernotifications"
},
"contentType": "application/vnd.marain.tenancy.servicemanifests.requiredconfigurationentries.azuretablestorage.v3",
"key": "Marain:UserNotifications:TableConfiguration:UserNotificationsMarain:UserNotifications:TableConfiguration:UserNotifications",
"legacyV2Key": "StorageConfiguration__Table__usernotifications",
"description": "User notifications store."
},
{
"contentType": "application/vnd.marain.tenancy.servicemanifests.requiredconfigurationentries.azureblobstorage",
"key": "templateStore",
"containerDefinition": {
"containerName": "templates"
},
"contentType": "application/vnd.marain.tenancy.servicemanifests.requiredconfigurationentries.azureblobstorage.v3",
"key": "Marain:UserNotifications:BlobContainerConfiguration:Templates",
"legacyV2Key": "StorageConfiguration__templates",
"description": "Template Store"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

<ItemGroup>
<PackageReference Include="Corvus.Monitoring.ApplicationInsights" Version="1.3.2" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Marain.Tenancy.ClientTenantProvider" Version="2.0.5" />
<PackageReference Include="Menes.Hosting.AspNetCore" Version="3.1.3" />
<PackageReference Include="Marain.Operations.ControlClient" Version="2.0.2" />
<PackageReference Include="Marain.Tenancy.ClientTenantProvider" Version="3.0.0" />
<PackageReference Include="Menes.Hosting.AspNetCore" Version="4.0.0" />
<PackageReference Include="Marain.Operations.ControlClient" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.1.46">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Corvus.DotLiquidAsync" Version="1.7.4" />
<PackageReference Include="Corvus.Identity.Azure" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.6.1" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.2">
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

namespace Marain.UserNotifications.Management.Host.Helpers
{
using System;
using System.Threading.Tasks;
using Microsoft.Azure.KeyVault;

using Azure;
using Azure.Security.KeyVault.Secrets;

using Microsoft.Extensions.Configuration;

/// <summary>
/// Helper methods to work with the <see cref="Microsoft.Azure.KeyVault"/>.
/// Helper methods to work with the <see cref="SecretClient"/>.
/// </summary>
public static class KeyVaultHelper
{
Expand All @@ -22,11 +26,13 @@ public static class KeyVaultHelper
public static async Task<string> GetDeliveryChannelSecretAsync(IConfiguration configuration, string deliveryChannelSecretUrl)
{
string? azureConnectionString = configuration.GetValue<string>("AzureServicesAuthConnectionString");
var azureServiceTokenProvider = new Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProvider(azureConnectionString);
using var keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
var azureCredentials = Corvus.Identity.ClientAuthentication.Azure.LegacyAzureServiceTokenProviderConnectionString.ToTokenCredential(azureConnectionString);

Microsoft.Azure.KeyVault.Models.SecretBundle accountKey = await keyVaultClient.GetSecretAsync(deliveryChannelSecretUrl).ConfigureAwait(false);
return accountKey.Value;
Uri secretUri = new(deliveryChannelSecretUrl);
Uri vaultUri = new(secretUri, "/");
SecretClient keyVaultClient = new(vaultUri, azureCredentials);
Response<KeyVaultSecret> accountKey = await keyVaultClient.GetSecretAsync(deliveryChannelSecretUrl).ConfigureAwait(false);
return accountKey.Value.Value;
}
}
}
Loading

0 comments on commit 9ea8131

Please sign in to comment.