Skip to content

Commit 5010507

Browse files
author
wwwlicious
committed
#4 WIP - updating project formats and framework targeting. Updating tests for apphost and self-contained redis instance
1 parent cd12bed commit 5010507

26 files changed

+182
-534
lines changed

src/ServiceStack.RateLimit.Redis/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 40 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,52 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{1BEF4F02-645E-4536-B15C-BC735F7058F7}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>ServiceStack.RateLimit.Redis</RootNamespace>
11-
<AssemblyName>ServiceStack.RateLimit.Redis</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
3+
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4+
<Configurations>Debug;Release</Configurations>
5+
<Title>ServiceStack.RateLimit.Redis</Title>
6+
<Description>Plugin for ServiceStack that adds rate limiting to ensure endpoints are protected from misuse</Description>
7+
<Authors>Donald Gray (@donaldgray);Scott Mackay (@wwwlicious)</Authors>
8+
<Owners>Scott Mackay (@wwwlicious)</Owners>
9+
<Copyright>Copyright (c) wwwlicious 2016 - Present</Copyright>
10+
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
11+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
12+
<NoWarn>CS1591</NoWarn>
13+
<RunCodeAnalysis>false</RunCodeAnalysis>
14+
<PackageId>ServiceStack.RateLimit.Redis</PackageId>
15+
<Version>$(Version)</Version>
16+
<PackageVersion>$(PackageVersion)</PackageVersion>
17+
<PackageOutputPath>$(PackageOutputPath)</PackageOutputPath>
18+
<PackageLicenseUrl>https://opensource.org/licenses/MPL-2.0</PackageLicenseUrl>
19+
<PackageProjectUrl>https://github.com/wwwlicious/servicestack-ratelimit-redis</PackageProjectUrl>
20+
<PackageIconUrl>https://servicestack.net/img/logo-32.png</PackageIconUrl>
21+
<ReleaseNotes>https://github.com/wwwlicious/servicestack-ratelimit-redis/releases</ReleaseNotes>
22+
<PackageTags>servicestack plugin rate limit ratelimit microservices redis protect</PackageTags>
23+
<IncludeSymbols>true</IncludeSymbols>
24+
<IncludeSource>true</IncludeSource>
25+
<RepositoryUrl>https://github.com/wwwlicious/servicestack-ratelimit-redis</RepositoryUrl>
1426
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>DEBUG;TRACE</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
27+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|net452'">
28+
<DefineConstants>TRACE;DEBUG;NET452;</DefineConstants>
29+
<DocumentationFile>bin\Debug\net452\ServiceStack.RateLimit.Redis.xml</DocumentationFile>
2330
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>pdbonly</DebugType>
26-
<Optimize>true</Optimize>
27-
<OutputPath>bin\Release\</OutputPath>
28-
<DefineConstants>TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
31+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|net452'">
32+
<DefineConstants>NET452</DefineConstants>
33+
<DocumentationFile>bin\Release\net452\ServiceStack.RateLimit.Redis.xml</DocumentationFile>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|netstandard2.0'">
36+
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0;</DefineConstants>
37+
<DocumentationFile>bin\Debug\netstandard2.0\ServiceStack.RateLimit.Redis.xml</DocumentationFile>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|netstandard2.0'">
40+
<DefineConstants>NETSTANDARD2_0</DefineConstants>
41+
<DocumentationFile>bin\Release\netstandard2.0\ServiceStack.RateLimit.Redis.xml</DocumentationFile>
3142
</PropertyGroup>
3243
<ItemGroup>
33-
<Reference Include="ServiceStack, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
34-
<HintPath>..\packages\ServiceStack.4.5.14\lib\net45\ServiceStack.dll</HintPath>
35-
<Private>True</Private>
36-
</Reference>
37-
<Reference Include="ServiceStack.Client, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\ServiceStack.Client.4.5.14\lib\net45\ServiceStack.Client.dll</HintPath>
39-
<Private>True</Private>
40-
</Reference>
41-
<Reference Include="ServiceStack.Common, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>..\packages\ServiceStack.Common.4.5.14\lib\net45\ServiceStack.Common.dll</HintPath>
43-
<Private>True</Private>
44-
</Reference>
45-
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
46-
<HintPath>..\packages\ServiceStack.Interfaces.4.5.14\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll</HintPath>
47-
<Private>True</Private>
48-
</Reference>
49-
<Reference Include="ServiceStack.Redis, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\ServiceStack.Redis.4.5.14\lib\net45\ServiceStack.Redis.dll</HintPath>
51-
<Private>True</Private>
52-
</Reference>
53-
<Reference Include="ServiceStack.Text, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
54-
<HintPath>..\packages\ServiceStack.Text.4.5.14\lib\net45\ServiceStack.Text.dll</HintPath>
55-
<Private>True</Private>
56-
</Reference>
57-
<Reference Include="System" />
58-
<Reference Include="System.Core" />
59-
</ItemGroup>
60-
<ItemGroup>
61-
<Compile Include="AttributeLimitProvider.cs" />
62-
<Compile Include="Headers\RateLimitStatus.cs" />
63-
<Compile Include="Headers\RateLimitHeader.cs" />
64-
<Compile Include="Headers\HttpHeaders.cs" />
65-
<Compile Include="Interfaces\ILimitKeyGenerator.cs" />
66-
<Compile Include="Interfaces\ILimitProvider.cs" />
67-
<Compile Include="LimitKeyGenerator.cs" />
68-
<Compile Include="AppSettingsLimitProvider.cs" />
69-
<Compile Include="LimitProviderConstants.cs" />
70-
<Compile Include="LimitRateAttribute.cs" />
71-
<Compile Include="Models\LimitPerSecond.cs" />
72-
<Compile Include="Models\LimitGroup.cs" />
73-
<Compile Include="Models\Limits.cs" />
74-
<Compile Include="Models\RateLimitResult.cs" />
75-
<Compile Include="Properties\AssemblyInfo.cs" />
76-
<Compile Include="RateLimitFeature.cs" />
77-
<Compile Include="Utilities\LuaScriptHelpers.cs" />
78-
<Compile Include="Utilities\Maybe.cs" />
79-
<Compile Include="Utilities\RequestExtensions.cs" />
44+
<None Remove="Scripts\RateLimitHash.lua" />
8045
</ItemGroup>
8146
<ItemGroup>
8247
<EmbeddedResource Include="Scripts\RateLimitHash.lua" />
8348
</ItemGroup>
8449
<ItemGroup>
85-
<None Include="packages.config">
86-
<SubType>Designer</SubType>
87-
</None>
50+
<PackageReference Include="ServiceStack.Server" Version="4.5.14" />
8851
</ItemGroup>
89-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
90-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
91-
Other similar extension points exist, see Microsoft.Common.targets.
92-
<Target Name="BeforeBuild">
93-
</Target>
94-
<Target Name="AfterBuild">
95-
</Target>
96-
-->
9752
</Project>

src/ServiceStack.RateLimit.Redis/ServiceStack.RateLimit.Redis.nuspec

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/ServiceStack.RateLimit.Redis/packages.config

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/DemoService/App.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5-
</startup>
63
<appSettings>
74
<add key="RedisConnectionString" value="192.168.56.101:6379"/>
85

test/DemoService/AppHost.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ private void SetupDependencies()
5555
Container.Register<IRedisClientsManager>(new BasicRedisClientManager(redisConnection));
5656

5757
// Setup basic auth
58-
Container.Register<ICacheClient>(new MemoryCacheClient());
5958
var userRep = new InMemoryAuthRepository();
6059
Container.Register<IUserAuthRepository>(userRep);
6160

Lines changed: 4 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{B0A54830-AA7B-4919-97CD-81D58C270EC4}</ProjectGuid>
3+
<TargetFrameworks>net462</TargetFrameworks>
4+
<Configurations>Debug;Release</Configurations>
85
<OutputType>Exe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>DemoService</RootNamespace>
11-
<AssemblyName>DemoService</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
156
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
</PropertyGroup>
35-
<ItemGroup>
36-
<Reference Include="ServiceStack, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
37-
<HintPath>..\..\src\packages\ServiceStack.4.5.14\lib\net45\ServiceStack.dll</HintPath>
38-
<Private>True</Private>
39-
</Reference>
40-
<Reference Include="ServiceStack.Client, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\..\src\packages\ServiceStack.Client.4.5.14\lib\net45\ServiceStack.Client.dll</HintPath>
42-
<Private>True</Private>
43-
</Reference>
44-
<Reference Include="ServiceStack.Common, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
45-
<HintPath>..\..\src\packages\ServiceStack.Common.4.5.14\lib\net45\ServiceStack.Common.dll</HintPath>
46-
<Private>True</Private>
47-
</Reference>
48-
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
49-
<HintPath>..\..\src\packages\ServiceStack.Interfaces.4.5.14\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll</HintPath>
50-
<Private>True</Private>
51-
</Reference>
52-
<Reference Include="ServiceStack.Redis, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
53-
<HintPath>..\..\src\packages\ServiceStack.Redis.4.5.14\lib\net45\ServiceStack.Redis.dll</HintPath>
54-
<Private>True</Private>
55-
</Reference>
56-
<Reference Include="ServiceStack.Text, Version=4.5.14.0, Culture=neutral, processorArchitecture=MSIL">
57-
<HintPath>..\..\src\packages\ServiceStack.Text.4.5.14\lib\net45\ServiceStack.Text.dll</HintPath>
58-
<Private>True</Private>
59-
</Reference>
60-
<Reference Include="System" />
61-
<Reference Include="System.Core" />
62-
</ItemGroup>
63-
<ItemGroup>
64-
<Compile Include="AppHost.cs" />
65-
<Compile Include="Program.cs" />
66-
<Compile Include="Properties\AssemblyInfo.cs" />
67-
</ItemGroup>
68-
<ItemGroup>
69-
<None Include="App.config" />
70-
<None Include="packages.config" />
71-
</ItemGroup>
727
<ItemGroup>
73-
<ProjectReference Include="..\..\src\ServiceStack.RateLimit.Redis\ServiceStack.RateLimit.Redis.csproj">
74-
<Project>{1BEF4F02-645E-4536-B15C-BC735F7058F7}</Project>
75-
<Name>ServiceStack.RateLimit.Redis</Name>
76-
</ProjectReference>
8+
<ProjectReference Include="..\..\src\ServiceStack.RateLimit.Redis\ServiceStack.RateLimit.Redis.csproj" />
779
</ItemGroup>
78-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
79-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
80-
Other similar extension points exist, see Microsoft.Common.targets.
81-
<Target Name="BeforeBuild">
82-
</Target>
83-
<Target Name="AfterBuild">
84-
</Target>
85-
-->
8610
</Project>

test/DemoService/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

test/DemoService/packages.config

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/ServiceStack.RateLimit.Redis.Tests/AppHostFixture.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)