Skip to content

Commit

Permalink
Resolve #13 - Library is now multi-targeted
Browse files Browse the repository at this point in the history
  • Loading branch information
craigfowler committed Aug 17, 2020
1 parent 8608214 commit a9d6a4b
Show file tree
Hide file tree
Showing 36 changed files with 274 additions and 390 deletions.
20 changes: 0 additions & 20 deletions CSF.Security.Tests/App.config

This file was deleted.

255 changes: 216 additions & 39 deletions CSF.Security.Tests/Authentication/Authentication.feature.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
using CSF.Security.Tests.Stubs;
using Moq;
using NUnit.Framework;
using Ploeh.AutoFixture.NUnit3;
using AutoFixture.NUnit3;

namespace CSF.Security.Tests.Authentication
{
Expand Down
8 changes: 4 additions & 4 deletions CSF.Security.Tests/AutoMoqDataAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Ploeh.AutoFixture.NUnit3;
using AutoFixture;
using AutoFixture.AutoMoq;
using AutoFixture.NUnit3;

namespace CSF.Security.Tests
{
[AttributeUsage(AttributeTargets.Method)]
public class AutoMoqDataAttribute : AutoDataAttribute
{
public AutoMoqDataAttribute() : base(new Fixture().Customize(new AutoMoqCustomization())) {}
public AutoMoqDataAttribute() : base(() => new Fixture().Customize(new AutoMoqCustomization())) {}
}
}
115 changes: 19 additions & 96 deletions CSF.Security.Tests/CSF.Security.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,104 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{11DCF35A-6E2A-4C62-B536-14B83FF5AE07}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>CSF.Security.Tests</RootNamespace>
<AssemblyName>CSF.Security.Tests</AssemblyName>
<TargetFramework>netcoreapp2.2</TargetFramework>
<ReleaseVersion>2.0.2</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Ploeh.AutoFixture">
<HintPath>..\packages\AutoFixture.3.50.2\lib\net40\Ploeh.AutoFixture.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Ploeh.AutoFixture.NUnit3">
<HintPath>..\packages\AutoFixture.NUnit3.3.50.2\lib\net40\Ploeh.AutoFixture.NUnit3.dll</HintPath>
</Reference>
<Reference Include="Ploeh.AutoFixture.AutoMoq">
<HintPath>..\packages\AutoFixture.AutoMoq.3.50.2\lib\net40\Ploeh.AutoFixture.AutoMoq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.0.1\lib\net45\nunit.framework.dll</HintPath>
<Package>nunit</Package>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.1.1308.2120\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="TechTalk.SpecFlow">
<HintPath>..\packages\SpecFlow.2.1.0\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference>
<Reference Include="nunit.core.interfaces">
<HintPath>..\packages\NUnit.Console.3.0.0\tools\addins\nunit.core.interfaces.dll</HintPath>
<Package>nunit</Package>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Authentication\PasswordAuthenticationServiceTests.cs" />
<Compile Include="AutoMoqDataAttribute.cs" />
<Compile Include="Stubs\StubStoredCredentials.cs" />
<Compile Include="Stubs\StubAuthenticationRequest.cs" />
<Compile Include="Authentication\JsonCredentialsSerializerTests.cs" />
<Compile Include="Stubs\StubCredentials.cs" />
<Compile Include="Authentication\PBKDF2PasswordVerifierTests.cs" />
<Compile Include="SpecFlowNUnitExtension.cs" />
<Compile Include="Authentication\Authentication.feature.cs">
<DependentUpon>Authentication.feature</DependentUpon>
</Compile>
<Compile Include="Bindings\AuthenticationSteps.cs" />
<Compile Include="Controllers\UserAccountController.cs" />
<Compile Include="Stubs\UsernameAndPassword.cs" />
<Compile Include="Stubs\StoredUserAccount.cs" />
<Compile Include="Controllers\AuthenticationController.cs" />
<Compile Include="Stubs\AuthenticationRequest.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\CSF.Security\CSF.Security.csproj">
<Project>{D46ED91C-6D2F-4B18-82B3-6EB2F001C121}</Project>
<Name>CSF.Security</Name>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<None Include="App.config" />
<None Include="Authentication\Authentication.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>Authentication.feature.cs</LastGenOutput>
</None>
<PackageReference Include="AutoFixture" Version="4.11.0" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.11.0" />
<PackageReference Include="AutoFixture.NUnit3" Version="4.11.0" />
<PackageReference Include="coverlet.msbuild" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="NunitXml.TestLogger" Version="2.1.41" />
<PackageReference Include="SpecFlow.NUnit" Version="3.3.74" />
</ItemGroup>

<ItemGroup>
<Folder Include="Authentication\" />
<Folder Include="Stubs\" />
<Folder Include="Bindings\" />
<Folder Include="Controllers\" />
<ProjectReference Include="..\CSF.Security\CSF.Security.csproj" />
</ItemGroup>
</Project>
78 changes: 0 additions & 78 deletions CSF.Security.Tests/SpecFlowNUnitExtension.cs

This file was deleted.

14 changes: 0 additions & 14 deletions CSF.Security.Tests/packages.config

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace CSF.Security.Authentication
/// <summary>
/// Event arguments type for a step within the authentication process..
/// </summary>
#if !NETSTANDARD1_3
[System.Serializable]
#endif
public sealed class AuthenticationStepEventArgs<TRequest> : EventArgs
where TRequest : IPasswordAuthenticationRequest
{
Expand Down
94 changes: 27 additions & 67 deletions CSF.Security/CSF.Security.csproj
Original file line number Diff line number Diff line change
@@ -1,80 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D46ED91C-6D2F-4B18-82B3-6EB2F001C121}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>CSF.Security</RootNamespace>
<AssemblyName>CSF.Security</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworks>netstandard1.3;net45;netstandard2.0</TargetFrameworks>
<PackageId>CSF.Security</PackageId>
<Authors>craigfowler</Authors>
<Description>A miniature library providing types related to implementing password-based authentication systems.</Description>
<ReleaseVersion>2.0.2</ReleaseVersion>
<Version>$(ReleaseVersion)</Version>
<PackageVersion>$(ReleaseVersion)</PackageVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright 2020 - CSF Software Limited</Copyright>
<PackageProjectUrl>https://github.com/csf-dev/CSF.Security</PackageProjectUrl>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\CSF-Software-OSS.snk</AssemblyOriginatorKeyFile>
<RootNamespace>CSF.Security.Authentication</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\CSF.Security.xml</DocumentationFile>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DocumentationFile>bin\Debug\CSF.Security.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\Release\CSF.Security.xml</DocumentationFile>
<DebugType></DebugType>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\CSF.Security.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Authentication\IPasswordAuthenticationService.cs" />
<Compile Include="Authentication\IPasswordAuthenticationRequest.cs" />
<Compile Include="Authentication\IStoredCredentials.cs" />
<Compile Include="Authentication\IPassword.cs" />
<Compile Include="Authentication\IAuthenticationResult.cs" />
<Compile Include="Authentication\AuthenticationResult.cs" />
<Compile Include="Authentication\PasswordAuthenticationRequest`3.cs" />
<Compile Include="Authentication\CredentialsWithPassword.cs" />
<Compile Include="Authentication\PasswordAuthenticationService`1.cs" />
<Compile Include="Authentication\IStoredCredentialsRepository.cs" />
<Compile Include="Authentication\IPasswordVerifier.cs" />
<Compile Include="Authentication\IPasswordVerifierFactory.cs" />
<Compile Include="Authentication\IRequestFactory`1.cs" />
<Compile Include="Authentication\IRequestFactory.cs" />
<Compile Include="Authentication\AuthenticationStepEventArgs.cs" />
<Compile Include="Authentication\ICredentialsSerializer.cs" />
<Compile Include="Authentication\JsonCredentialsSerializer.cs" />
<Compile Include="Authentication\PasswordVerifierFactory.cs" />
<Compile Include="Authentication\PBKDF2PasswordVerifier.cs" />
<Compile Include="Authentication\IPBKDF2Credentials.cs" />
<Compile Include="Authentication\IPBKDF2Parameters.cs" />
<Compile Include="Authentication\ICredentialsCreator.cs" />
<Compile Include="Authentication\PBKDF2Parameters.cs" />
<Compile Include="Authentication\PBKDF2Credentials.cs" />
<Compile Include="Authentication\SimpleRequestFactory.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="CSF.Security.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Authentication\" />
<!-- I'm intentionally not-capping the max version of Newtonsoft.Json, because the functionality I
use is unlikely to be broken, and new major versions of that library have been released quite
a few times. I don't want to prevent usage of a future version which is *likely* to be compatible,
just for the sake of being certain. If a version of Newtonsoft.Json is released which breaks this
package, then please raise a bug to have the max version capped accordingly. -->
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
<PackageReference Include="System.Security.Cryptography.Csp" Version="4.3.0" Condition="'$(TargetFramework)' != 'net45'" />
</ItemGroup>

</Project>
Loading

0 comments on commit a9d6a4b

Please sign in to comment.