Exemple #1
0
        public override void Alter(ActionCallBase call)
        {
            if (call is ActionCall)
            {
                var chain = call.ParentChain();
                var alias = call.As <ActionCall>().BuildRouteForPattern(_pattern);

                chain.As <RoutedChain>().AddRouteAlias(alias);
            }
        }
Exemple #2
0
        private static void AppendMethod(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore)
        {
            var part = RemovePattern(call.Method.Name, ignore);

            Append(route, properties, part);
            if (call.HasInput)
            {
                route.ApplyInputType(call.InputType());
            }
        }
        public override void Alter(ActionCallBase call)
        {
            if (call is ActionCall)
            {
                var chain = call.ParentChain();
                var alias = call.As<ActionCall>().BuildRouteForPattern(_pattern);

                chain.As<RoutedChain>().AddRouteAlias(alias);
            }
        }
        public static bool IsRedirectable(ActionCallBase action)
        {
            var outputType = action.OutputType();

            if (outputType == null)
            {
                return(false);
            }

            return(outputType.CanBeCastTo <FubuContinuation>() || outputType.CanBeCastTo <IRedirectable>());
        }
 private static void ConstrainToHttpMethod(
     IRouteDefinition route, ActionCallBase call, IEnumerable<Configuration.HttpConstraintPattern> patterns)
 {
     Func<Configuration.Segment, string> getName = s =>
     {
         switch (s)
         {
             case Configuration.Segment.Namespace: return call.HandlerType.Namespace;
             case Configuration.Segment.Class: return call.HandlerType.Name;
             case Configuration.Segment.Method: return call.Method.Name;
         } return null;
     };
     patterns.Where(x => x.Regex.IsMatch(getName(x.Type))).ToList().
                 ForEach(x => route.AddHttpMethodConstraint(x.Method));
 }
Exemple #6
0
        private static void ConstrainToHttpMethod(
            IRouteDefinition route, ActionCallBase call, IEnumerable <Configuration.HttpConstraintPattern> patterns)
        {
            Func <Configuration.Segment, string> getName = s =>
            {
                switch (s)
                {
                case Configuration.Segment.Namespace: return(call.HandlerType.Namespace);

                case Configuration.Segment.Class: return(call.HandlerType.Name);

                case Configuration.Segment.Method: return(call.Method.Name);
                }
                return(null);
            };

            patterns.Where(x => x.Regex.IsMatch(getName(x.Type))).ToList().
            ForEach(x => route.AddHttpMethodConstraint(x.Method));
        }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Authorization.AddPolicy(new MustBeAuthenticated());
 }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().As <RoutedChain>().UrlCategory.Category = Category;
 }
Exemple #9
0
        public override void Alter(ActionCallBase call)
        {
            var chain = call.ParentChain();

            _roles.Each(role => chain.Authorization.AddPolicy(new RequireRole(role)));
        }
Exemple #10
0
        public override void Alter(ActionCallBase call)
        {
            var filter = new ActionFilter(_filterType, _method);

            call.AddBefore(filter);
        }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Authorization.AddPolicy(new MustBeAuthenticated());
 }
Exemple #12
0
        public override void Alter(ActionCallBase call)
        {
            var inputNode = call.ParentChain().Input;

            _types.Each(inputNode.Add);
        }
 private static void AppendMethod(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore)
 {
     var part = RemovePattern(call.Method.Name, ignore);
     Append(route, properties, part);
     if (call.HasInput) route.ApplyInputType(call.InputType());
 }
 public override void Alter(ActionCallBase call)
 {
     call.AddBefore(new AntiForgeryNode(Salt));
 }
 private static void AppendNamespace(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore)
 {
     var parts = RemovePattern(call.HandlerType.Namespace, ignore).Split('.').ToArray();
     Append(route, properties, parts);
 }
 private static void AppendClass(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore)
 {
     var part = RemovePattern(call.HandlerType.Name, ignore);
     Append(route, properties, part);
 }
Exemple #17
0
        public override void Alter(ActionCallBase call)
        {
            var authorizationNode = call.ParentChain().Authorization;

            Types.Each(authorizationNode.Add);
        }
 public override void Alter(ActionCallBase call)
 {
     var filter = new ActionFilter(_filterType, _method);
     call.AddBefore(filter);
 }
Exemple #19
0
        public override void Alter(ActionCallBase call)
        {
            var authorizationNode = call.ParentChain().Authorization;

            _roles.Each(r => authorizationNode.AddRole(r));
        }
Exemple #20
0
 public override void Alter(ActionCallBase call)
 {
     call.Chain.ApplyCompression();
 }
Exemple #21
0
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Authorization.FailureHandler(_type);
 }
Exemple #22
0
 public override void Alter(ActionCallBase call)
 {
     var authorizationNode = call.ParentChain().Authorization;
     _roles.Each(r => authorizationNode.AddRole(r));
 }
 public override void Alter(ActionCallBase call)
 {
     _behaviorTypes.Each(x => call.WrapWith(x));
 }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().As <RoutedChain>().UrlCategory.Creates.Add(Type);
 }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Authorization.FailureHandler(_type);
 }
Exemple #26
0
        public override void Alter(ActionCallBase call)
        {
            var outputNode = call.ParentChain().Output;

            _types.Each(t => outputNode.Add(t));
        }
        public override void Alter(ActionCallBase call)
        {
            var authorizationNode = call.ParentChain().Authorization;

            Types.Each(authorizationNode.Add);
        }
Exemple #28
0
        public override void Alter(ActionCallBase call)
        {
            var chain = call.ParentChain();

            chain.Prepend(ActionFilter.For <PassThroughAuthenticationFilter>(a => a.Filter()));
        }
Exemple #29
0
        private static void AppendNamespace(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore)
        {
            var parts = RemovePattern(call.HandlerType.Namespace, ignore).Split('.').ToArray();

            Append(route, properties, parts);
        }
Exemple #30
0
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().InsertFirst(Wrapper.For <WonkyWrapper>());
 }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().As<RoutedChain>().UrlCategory.Creates.Add(Type);
 }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Input.Add(typeof(NewtonSoftBindingReader<>));
 }
 public abstract void Alter(ActionCallBase call);
 public abstract void Alter(ActionCallBase call);
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().As<RoutedChain>().UrlCategory.Category = Category;
 }
Exemple #36
0
 public override void Alter(ActionCallBase call)
 {
     var chain = call.ParentChain();
     _roles.Each(role => chain.Authorization.AddPolicy(new RequireRole(role)));
 }
Exemple #37
0
 public override void Alter(ActionCallBase call)
 {
     var chain = call.ParentChain();
     chain.Tags.Fill(_tags);
 }
Exemple #38
0
        private static void AppendClass(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore)
        {
            var part = RemovePattern(call.HandlerType.Name, ignore);

            Append(route, properties, part);
        }
 public override void Alter(ActionCallBase call)
 {
     _behaviorTypes.Each(x => call.WrapWith(x));
 }
	    public override void Alter(ActionCallBase call)
	    {
	        var chain = call.ParentChain();

            chain.Prepend(ActionFilter.For<PassThroughAuthenticationFilter>(a => a.Filter()));
	    }
 public override void Alter(ActionCallBase call)
 {
     call.ParentChain().Input.Add(typeof(NewtonSoftBindingReader <>));
 }
Exemple #42
0
        public override void Alter(ActionCallBase call)
        {
            var chain = call.ParentChain();

            chain.Tags.Fill(_tags);
        }
Exemple #43
0
 public override void Alter(ActionCallBase call)
 {
     call.AddBefore(new AntiForgeryNode(Salt));
 }