Skip to content

Commit f0b088d

Browse files
committed
Allow Activity.AllowUnauthenticated flag to be null so it can bubble up like Default
Change from Common.Logging to Meerkat.Logging, unifies logging framework across libraries Migrate config base classes to our own namespace to avoid clashes with core project Updated to latest Fake build
1 parent 441efef commit f0b088d

37 files changed

+270
-94
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,5 @@ Desktop.ini
224224

225225
# Recycle Bin used on file shares
226226
$RECYCLE.BIN/
227+
/.paket/paket.exe
228+
/packages/build

.paket/paket.bootstrapper.exe

27.5 KB
Binary file not shown.

.paket/paket.targets

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Enable the restore command to run before builds -->
5+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
6+
<!-- Download Paket.exe if it does not already exist -->
7+
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
8+
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
9+
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
10+
</PropertyGroup>
11+
<PropertyGroup>
12+
<!-- Paket command -->
13+
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
14+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
15+
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
16+
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>
17+
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
18+
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>
19+
<!-- Commands -->
20+
<PaketReferences>$(MSBuildProjectDirectory)\paket.references</PaketReferences>
21+
<RestoreCommand>$(PaketCommand) restore --references-files $(PaketReferences)</RestoreCommand>
22+
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
23+
<!-- We need to ensure packages are restored prior to assembly resolve -->
24+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
25+
</PropertyGroup>
26+
<Target Name="CheckPrerequisites">
27+
<!-- Raise an error if we're unable to locate paket.exe -->
28+
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
29+
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
30+
</Target>
31+
<Target Name="DownloadPaket">
32+
<Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
33+
</Target>
34+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
35+
<Exec Command="$(RestoreCommand)" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" />
36+
</Target>
37+
</Project>

Meerkat.Security.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.40629.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meerkat.Security", "code\Meerkat.Security\Meerkat.Security.csproj", "{0C370A50-0D00-49BE-B305-36860F2978BC}"
77
EndProject
@@ -17,6 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
ProjectSection(SolutionItems) = preProject
1818
build.fsx = build.fsx
1919
License.md = License.md
20+
nuget\Meerkat.Security.Mvc.nuspec = nuget\Meerkat.Security.Mvc.nuspec
21+
nuget\Meerkat.Security.nuspec = nuget\Meerkat.Security.nuspec
22+
nuget\Meerkat.Security.WebApi.nuspec = nuget\Meerkat.Security.WebApi.nuspec
2023
README.md = README.md
2124
RELEASE_NOTES.md = RELEASE_NOTES.md
2225
EndProjectSection

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#### 2.2.1 (2017-02-04)
2+
* Allow Activity.AllowUnauthenticated flag to be null so it can bubble up like Default.
3+
* Change from Common.Logging to Meerkat.Logging, unifies logging framework across libraries.
4+
15
#### 2.2.0 (2016-09-22)
26
* Introduce IControllerActivityMapper to allow resource/action names to be mapped from controller/action e.g. Get -> Read
37
* Revised MVC and WebApi ActivityAuthorize attributes, removed extension points InferredResource/Activity should be done via IControllerActivityMapper

build.cmd

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
@echo off
2+
SETLOCAL
3+
24
cls
35

4-
if not exist packages\FAKE\tools\Fake.exe (
5-
nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
6+
.paket\paket.bootstrapper.exe
7+
if errorlevel 1 (
8+
exit /b %errorlevel%
69
)
710

8-
SET TARGET="Default"
11+
.paket\paket.exe restore
12+
if errorlevel 1 (
13+
exit /b %errorlevel%
14+
)
915

10-
if NOT [%1]==[] (set TARGET="%1")
16+
SET FAKE_PATH=packages\build\FAKE\tools\Fake.exe
17+
SET Platform=
1118

12-
"packages\FAKE\tools\FAKE.exe" "build.fsx" "target=%TARGET%" %*
13-
pause
19+
IF [%1]==[] (
20+
"%FAKE_PATH%" "build.fsx" "Default"
21+
) ELSE (
22+
"%FAKE_PATH%" "build.fsx" %*
23+
)

build.fsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ let release = LoadReleaseNotes "RELEASE_NOTES.md"
2020
let buildDir = "./build"
2121
let toolsDir = getBuildParamOrDefault "tools" "./tools"
2222
let nugetDir = "./nuget"
23+
let solutionFile = "Meerkat.Security.sln"
2324

2425
let nunitPath = toolsDir @@ "NUnit-2.6.3/bin"
2526

@@ -42,7 +43,7 @@ Target "SetVersion" (fun _ ->
4243
)
4344

4445
Target "Build" (fun _ ->
45-
!! "./code/**/*.csproj"
46+
!! solutionFile
4647
|> MSBuildRelease buildDir "Build"
4748
|> Log "AppBuild-Output: "
4849
)

code/Meerkat.Security.Mvc/Meerkat.Security.Mvc.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
<AssemblyOriginatorKeyFile>..\..\Meerkat.Security.snk</AssemblyOriginatorKeyFile>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
41-
<HintPath>..\..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll</HintPath>
40+
<Reference Include="GitLink, Version=2.4.1.0, Culture=neutral, processorArchitecture=MSIL">
41+
<HintPath>..\..\packages\gitlink.2.4.1\lib\net45\GitLink.exe</HintPath>
4242
<Private>True</Private>
4343
</Reference>
44-
<Reference Include="Common.Logging.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
45-
<HintPath>..\..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll</HintPath>
44+
<Reference Include="Meerkat.Logging, Version=1.0.1.0, Culture=neutral, PublicKeyToken=48420f6ca18bf904, processorArchitecture=MSIL">
45+
<HintPath>..\..\packages\Meerkat.Logging.1.0.1\lib\net45\Meerkat.Logging.dll</HintPath>
4646
<Private>True</Private>
4747
</Reference>
4848
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

code/Meerkat.Security.Mvc/Web/Mvc/ActivityAuthorizeAttribute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
using System.Web;
44
using System.Web.Mvc;
55

6-
using Common.Logging;
7-
6+
using Meerkat.Logging;
87
using Meerkat.Security.Activities;
98
using Meerkat.Security.Web;
109

@@ -18,7 +17,7 @@ namespace Meerkat.Web.Mvc
1817
/// </summary>
1918
public class ActivityAuthorizeAttribute : AuthorizeAttribute
2019
{
21-
private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
20+
private static readonly ILog Logger = LogProvider.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
2221

2322
private IActivityAuthorizer authorizer;
2423
private IControllerActivityMapper inferrer;

code/Meerkat.Security.Mvc/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Common.Logging" version="3.3.1" targetFramework="net45" />
4-
<package id="Common.Logging.Core" version="3.3.1" targetFramework="net45" />
3+
<package id="gitlink" version="2.4.1" targetFramework="net45" developmentDependency="true" />
4+
<package id="Meerkat.Logging" version="1.0.1" targetFramework="net45" />
55
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
66
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
77
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />

0 commit comments

Comments
 (0)