This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Fake.NDepend | |
| open Fake | |
| open System | |
| open System.IO | |
| open System.Text | |
| let getWorkingDir workingDir = | |
| Seq.find isNotNullOrEmpty [workingDir; environVar("teamcity.build.workingDir"); "."] | |
| |> Path.GetFullPath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AntiForgeryTokenFilter : IAuthorizationFilter | |
| { | |
| private readonly AcceptVerbsAttribute _verbs; | |
| public AntiForgeryTokenFilter(HttpVerbs verbs) | |
| { | |
| _verbs = new AcceptVerbsAttribute(verbs); | |
| } | |
| public void OnAuthorization(AuthorizationContext filterContext) | |
| { | |
| if (_verbs.IsValidForRequest(filterContext, null)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class JsonValidatingModelBinder : DefaultModelBinder | |
| { | |
| public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) | |
| { | |
| var result = base.BindModel(controllerContext, bindingContext); | |
| if (!IsJsonRequest(controllerContext)) | |
| { | |
| return result; | |
| } | |
| if (!bindingContext.ModelMetadata.RequestValidationEnabled) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Security.Claims; | |
| using Microsoft.Owin; | |
| namespace Owin.StatelessAuth | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| public class StatelessAuth : OwinMiddleware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Imported from Lokad.Shared, 2011-02-08 | |
| using System; | |
| namespace Lokad.Cloud.Storage | |
| { | |
| /// <summary> | |
| /// Helper class that indicates nullable value in a good-citizenship code | |
| /// </summary> | |
| /// <typeparam name="T">underlying type</typeparam> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Startup | |
| { | |
| public void Configuration(IAppBuilder app) | |
| { | |
| app | |
| .Use<StatusCodeFromExceptionMiddleware>() | |
| .UseNancy(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GlobalExceptionHandlingMiddleware : OwinMiddleware | |
| { | |
| private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); | |
| public GlobalExceptionHandlingMiddleware(OwinMiddleware next) : base(next) | |
| { | |
| } | |
| public override async Task Invoke(IOwinContext context) | |
| { | |
| try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace FundApps.DocumentGenerator.FeatureTests.OwinMiddleware | |
| { | |
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using FundApps.DocumentGenerator.Web.Infrastructure.Owin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <appSettings> | |
| <add key="owin:HandleAllRequests" value="true" /> | |
| </appSettings> | |
| <system.web> | |
| <compilation debug="true" targetFramework="4.5.1" /> | |
| <httpRuntime targetFramework="4.5" /> | |
| </system.web> | |
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Target "PowerShell" (fun _ -> | |
| let result = ExecProcess (fun info -> | |
| info.FileName <- "powershell.exe" | |
| info.WorkingDirectory <- (currentDirectory @@ "deploy") | |
| info.Arguments <- "-ExecutionPolicy RemoteSigned -Command \"Import-Module Carbon\"") System.TimeSpan.MaxValue | |
| if result <> 0 then failwithf "Error deploying local" | |
| ) |