protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterGeneric(typeof(Webhook.RouteHandler <>)).InstancePerDependency();
            builder.RegisterType <Webhook.SendGrid.EventRequestHandler>().SingleInstance();
            builder.RegisterType <Webhook.Notifications.SubscribeRequestHandler>().SingleInstance();
            builder.ActivateOnApplicationStart <Webhook.RouteInitializer>(e => e.InitializeRoutes());

            builder
            .RegisterInstance(new LocationSettings
            {
                Path      = "/" + Webhook.RouteInitializer.MailTrackEventRoute,
                Providers =
                {
                    //Called by SendGrid, which will pass credentials as basic HTTP auth
                    new ProviderSettings
                    {
                        Name = "basic",
                        Type = typeof(PX.SM.PXBasicAuthenticationModule).AssemblyQualifiedName
                    }
                }
            });

            builder
            .RegisterInstance(new LocationSettings
            {
                Path      = "/" + Webhook.RouteInitializer.MailTrackNotificationSubscribeRoute,
                Providers =
                {
                    //Called by the MailTrackPushSetup.html page for a logged in user
                    new ProviderSettings
                    {
                        Name = "coockie",
                        Type = typeof(CoockieAuthenticationModule).AssemblyQualifiedName
                    },
                    new ProviderSettings
                    {
                        Name = "anonymous",
                        Type = typeof(AnonymousAuthenticationModule).AssemblyQualifiedName
                    }
                }
            });
        }
Exemple #2
0
        protected override void Load(ContainerBuilder builder)
        {
            //HTTP Web Handler
            builder.RegisterGeneric(typeof(RouteHandler <>)).SingleInstance();
            builder.RegisterType <SampleWebHookRequestHandler>().SingleInstance();
            builder.ActivateOnApplicationStart <RouteInitializer>(e => e.InitializeRoutes());

            builder
            .RegisterInstance(new LocationSettings
            {
                Path      = "/" + RouteInitializer.SampleRoute,
                Providers =
                {
                    new ProviderSettings
                    {
                        Name = "basic",
                        Type = typeof(BasicAuthenticationModule).AssemblyQualifiedName
                    }
                }
            });
        }
 protected override void Load(ContainerBuilder builder)
 {
     builder.ActivateOnApplicationStart <ExtensionSorting>();
 }