Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strong name assembly #148

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7
6
8
- name: Install .NET Framework (add MSBuild to Path)
uses: microsoft/setup-msbuild@v1.3

uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" test/Amazon.SecretsManager.Extensions.Caching.UnitTests
# Strong name requires disabling xUnit app domains in order to get coverage using coverlet
# https://github.com/MarcoRossignoli/coverlet/blob/master/Documentation/KnownIssues.md#tests-fail-if-assembly-is-strong-named
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" test/Amazon.SecretsManager.Extensions.Caching.UnitTests -- RunConfiguration.DisableAppDomain=true
- name: Codecov
uses: codecov/codecov-action@v3.1.4
uses: codecov/codecov-action@v4
with:
directory: test/Amazon.SecretsManager.Extensions.Caching.UnitTests/TestResults
env:
CODECOV_TOKEN: #{{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can get the latest release from `Nuget`:

```xml
<ItemGroup>
<PackageReference Include="AWSSDK.SecretsManager.Caching" Version="1.0.6" />
<PackageReference Include="AWSSDK.SecretsManager.Caching" Version="2.*" />
</ItemGroup>
```

Expand Down
Binary file added aws-secretsmanager-caching-net.snk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<OutputType>Library</OutputType>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<PackageId>AWSSDK.SecretsManager.Caching</PackageId>
<PackageVersion>1.0.6</PackageVersion>
<PackageVersion>2.0.0</PackageVersion>
<Title>AWS Secrets Manager Caching for .NET</Title>
<Authors>Amazon Web Services</Authors>
<Description>The AWS Secrets Manager .NET caching client enables in-process caching of secrets for .NET applications.</Description>
Expand All @@ -17,14 +17,16 @@
<PackageIconUrl>https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</PackageIconUrl>
<RepositoryUrl>https://github.com/aws/aws-secretsmanager-caching-net</RepositoryUrl>
<PackageTags>AWS;Amazon;cloud;aws-sdk-v3;secrets;secret manager;secretsmanager;caching;cache</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\aws-secretsmanager-caching-net.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.SecretsManager" Version="3.7.102.54" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PackageReference Include="AWSSDK.SecretsManager" Version="3.*" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.*" />
<PackageReference Include="StyleCop.Analyzers" Version="1.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\aws-secretsmanager-caching-net.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0"/>
<PackageReference Include="Moq" Version="4.18.4"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Include="coverlet.collector" Version="3.1.2"/>
<PackageReference Include="coverlet.collector" Version="6.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="Moq" Version="4.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Amazon.SecretsManager.Extensions.Caching\Amazon.SecretsManager.Extensions.Caching.csproj"/>
<ProjectReference Include="..\..\src\Amazon.SecretsManager.Extensions.Caching\Amazon.SecretsManager.Extensions.Caching.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ private async Task<string> Setup(TestType type)
}

[Fact]
public async void GetSecretStringTest()
public async Task GetSecretStringTest()
{
String testSecretName = await Setup(TestType.SecretString);
cache = new SecretsManagerCache(TestBase.Client);
Assert.Equal(await cache.GetSecretString(testSecretName), testSecretString);
}

[Fact]
public async void SecretCacheTTLTest()
public async Task SecretCacheTTLTest()
{
String testSecretName = await Setup(TestType.SecretString);
cache = new SecretsManagerCache(TestBase.Client, new SecretCacheConfiguration { CacheItemTTL = 1000 });
Expand All @@ -111,7 +111,7 @@ public async void SecretCacheTTLTest()
}

[Fact]
public async void SecretCacheRefreshTest()
public async Task SecretCacheRefreshTest()
{
String testSecretName = await Setup(TestType.SecretString);
cache = new SecretsManagerCache(TestBase.Client);
Expand All @@ -124,31 +124,31 @@ public async void SecretCacheRefreshTest()
}

[Fact]
public async void NoSecretBinaryTest()
public async Task NoSecretBinaryTest()
{
String testSecretName = await Setup(TestType.SecretString);
cache = new SecretsManagerCache(TestBase.Client);
Assert.Null(await cache.GetSecretBinary(testSecretName));
}

[Fact]
public async void GetSecretBinaryTest()
public async Task GetSecretBinaryTest()
{
String testSecretName = await Setup(TestType.SecretBinary);
cache = new SecretsManagerCache(TestBase.Client);
Assert.Equal(await cache.GetSecretBinary(testSecretName), testSecretBinary.ToArray());
}

[Fact]
public async void NoSecretStringTest()
public async Task NoSecretStringTest()
{
String testSecretName = await Setup(TestType.SecretBinary);
cache = new SecretsManagerCache(TestBase.Client);
Assert.Null(await cache.GetSecretString(testSecretName));
}

[Fact]
public async void CacheHookTest()
public async Task CacheHookTest()
{
String testSecretName = await Setup(TestType.SecretString);
TestHook testHook = new TestHook();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\aws-secretsmanager-caching-net.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0"/>
<PackageReference Include="Moq" Version="4.18.4"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Include="coverlet.collector" Version="3.1.2"/>
<PackageReference Include="coverlet.collector" Version="6.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="Moq" Version="4.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading