Skip to content

Commit

Permalink
Update Unity to 5.11.7
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeniomiro committed Dec 21, 2020
1 parent 498a8b7 commit 1fa54fa
Show file tree
Hide file tree
Showing 33 changed files with 386 additions and 348 deletions.
26 changes: 13 additions & 13 deletions Bonobo.Git.Server.Test/Bonobo.Git.Server.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,30 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebDriver, Version=3.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.3.0\lib\net40\WebDriver.dll</HintPath>
Expand Down
6 changes: 5 additions & 1 deletion Bonobo.Git.Server.Test/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
Expand All @@ -54,6 +54,10 @@
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
Expand Down
8 changes: 5 additions & 3 deletions Bonobo.Git.Server.Test/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.Mvc.Futures" version="5.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net46" />
<package id="Microsoft.Net.Compilers" version="2.2.0" targetFramework="net46" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
Expand All @@ -17,4 +17,6 @@
<package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net46" />
<package id="System.Data.SQLite.EF6" version="1.0.104.0" targetFramework="net46" />
<package id="System.Data.SQLite.Linq" version="1.0.104.0" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net46" />
</packages>
47 changes: 47 additions & 0 deletions Bonobo.Git.Server/App_Start/UnityConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;

using Unity;

namespace Bonobo.Git.Server
{
/// <summary>
/// Specifies the Unity configuration for the main container.
/// </summary>
public static class UnityConfig
{
#region Unity Container
private static Lazy<IUnityContainer> container =
new Lazy<IUnityContainer>(() =>
{
var container = new UnityContainer();
RegisterTypes(container);
return container;
});

/// <summary>
/// Configured Unity Container.
/// </summary>
public static IUnityContainer Container => container.Value;
#endregion

/// <summary>
/// Registers the type mappings with the Unity container.
/// </summary>
/// <param name="container">The unity container to configure.</param>
/// <remarks>
/// There is no need to register concrete types such as controllers or
/// API controllers (unless you want to change the defaults), as Unity
/// allows resolving a concrete type even if it was not previously
/// registered.
/// </remarks>
public static void RegisterTypes(IUnityContainer container)
{
// NOTE: To load from web.config uncomment the line below.
// Make sure to add a Unity.Configuration to the using statements.
// container.LoadConfiguration();

// TODO: Register your type's mappings here.
// container.RegisterType<IProductRepository, ProductRepository>();
}
}
}
38 changes: 38 additions & 0 deletions Bonobo.Git.Server/App_Start/UnityMvcActivator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Linq;
using System.Web.Mvc;

using Unity.AspNet.Mvc;

[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Bonobo.Git.Server.UnityMvcActivator), nameof(Bonobo.Git.Server.UnityMvcActivator.Start))]
[assembly: WebActivatorEx.ApplicationShutdownMethod(typeof(Bonobo.Git.Server.UnityMvcActivator), nameof(Bonobo.Git.Server.UnityMvcActivator.Shutdown))]

namespace Bonobo.Git.Server
{
/// <summary>
/// Provides the bootstrapping for integrating Unity with ASP.NET MVC.
/// </summary>
public static class UnityMvcActivator
{
/// <summary>
/// Integrates Unity when the application starts.
/// </summary>
public static void Start()
{
FilterProviders.Providers.Remove(FilterProviders.Providers.OfType<FilterAttributeFilterProvider>().First());
FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(UnityConfig.Container));

DependencyResolver.SetResolver(new UnityDependencyResolver(UnityConfig.Container));

// TODO: Uncomment if you want to use PerRequestLifetimeManager
// Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule));
}

/// <summary>
/// Disposes the Unity container when the application is shut down.
/// </summary>
public static void Shutdown()
{
UnityConfig.Container.Dispose();
}
}
}
2 changes: 1 addition & 1 deletion Bonobo.Git.Server/Attributes/AllViewsAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Bonobo.Git.Server.App_GlobalResources;
using Bonobo.Git.Server.Models;
using Bonobo.Git.Server.Security;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Unity;

namespace Bonobo.Git.Server.Attributes
{
Expand Down
14 changes: 7 additions & 7 deletions Bonobo.Git.Server/Attributes/GitAuthorizeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.Helpers;
using Bonobo.Git.Server.Security;
using Serilog;
using System;
using System.Net;
using System.Security.Claims;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.Security;
using Microsoft.Practices.Unity;
using Bonobo.Git.Server.Helpers;
using Serilog;
using Unity;

namespace Bonobo.Git.Server
{
Expand All @@ -28,7 +28,7 @@ public class GitAuthorizeAttribute : AuthorizeAttribute

public static string GetRepoPath(string path, string applicationPath)
{
var repo = path.Replace(applicationPath, "").Replace("/","");
var repo = path.Replace(applicationPath, "").Replace("/", "");
return repo.Substring(0, repo.IndexOf(".git"));
}

Expand Down
17 changes: 6 additions & 11 deletions Bonobo.Git.Server/Attributes/IsValidRegexAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.App_GlobalResources;
using Microsoft.Practices.Unity;
using Bonobo.Git.Server.App_GlobalResources;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Bonobo.Git.Server.Models;
using System.Text.RegularExpressions;

namespace Bonobo.Git.Server.Attributes
Expand All @@ -22,10 +14,13 @@ protected override ValidationResult IsValid(object value, ValidationContext cont
return ValidationResult.Success;
}

try{
try
{
new Regex((string)value);
return ValidationResult.Success;
}catch(ArgumentException e){
}
catch (ArgumentException e)
{
return new ValidationResult(string.Format(Resources.Validation_Invalid_Regex, e.Message));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Web.Mvc;
using Bonobo.Git.Server.Data;
using Microsoft.Practices.Unity;
using System.Web.Mvc;
using Unity;

namespace Bonobo.Git.Server
{
Expand All @@ -26,7 +26,7 @@ public RepositoryNameNormalizerAttribute(string repositoryNameParameterName)
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
object incomingRepositoryNameParameter;
if(filterContext.ActionParameters.TryGetValue(_repositoryNameParameterName, out incomingRepositoryNameParameter))
if (filterContext.ActionParameters.TryGetValue(_repositoryNameParameterName, out incomingRepositoryNameParameter))
{
var incomingRepositoryName = (string)incomingRepositoryNameParameter;
var normalizedName = Repository.NormalizeRepositoryName(incomingRepositoryName, RepositoryRepository);
Expand Down
12 changes: 3 additions & 9 deletions Bonobo.Git.Server/Attributes/UniqueRepoNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.App_GlobalResources;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using Bonobo.Git.Server.App_GlobalResources;
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.Models;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Bonobo.Git.Server.Models;

namespace Bonobo.Git.Server.Attributes
{
public class UniqueRepoNameAttribute : ValidationAttribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Web.Mvc;
using System.Web.Routing;
using Bonobo.Git.Server.Data;
using Bonobo.Git.Server.Security;

using Microsoft.Practices.Unity;
using Bonobo.Git.Server.Security;
using System;
using System.Web.Mvc;
using Unity;

namespace Bonobo.Git.Server
{
Expand Down
Loading

0 comments on commit 1fa54fa

Please sign in to comment.