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
| var google = new GoogleOAuth2AuthenticationOptions | |
| { | |
| ClientId = ConfigurationManager.AppSettings.Get("Google.ClientId"), | |
| ClientSecret = ConfigurationManager.AppSettings.Get("Google.ClientSecret"), | |
| CallbackPath = new PathString("/callback"), | |
| AuthenticationType = "Google", | |
| SignInAsAuthenticationType = signInAsType | |
| }; | |
| app.UseGoogleAuthentication(google); |
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 static class TaskExtensions | |
| { | |
| public static async Task RetryWhileException<T>(this Task transientOperation, int retryCount, TimeSpan retryDelay) where T:Exception | |
| { | |
| int currentRetry = 0; | |
| while (true) | |
| { | |
| 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
| 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" | |
| ) |
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
| 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
| 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
| 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
| // 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
| 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
| 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) |