Ejemplo n.º 1
0
        public ClientAccessRulesExecutionStatus Run(ClientAccessRulesEvaluationContext context)
        {
            RulesEvaluator rulesEvaluator = new RulesEvaluator(context);

            rulesEvaluator.Run();
            return(ClientAccessRulesExecutionStatus.Success);
        }
Ejemplo n.º 2
0
        public override bool Evaluate(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;
            ClientAccessProtocol protocol = clientAccessRulesEvaluationContext.Protocol;

            return(this.ProtocolList.Contains(protocol));
        }
Ejemplo n.º 3
0
        public override bool Evaluate(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;
            ClientAccessAuthenticationMethod   authenticationType = clientAccessRulesEvaluationContext.AuthenticationType;

            return(this.AuthenticationTypeList.Contains(authenticationType));
        }
        public override bool Evaluate(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;
            IPAddress discoveredValue = clientAccessRulesEvaluationContext.RemoteEndpoint.Address;

            return(this.TargetIpRanges.Any((IPRange target) => target.Contains(discoveredValue)));
        }
        public override bool Evaluate(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;
            string username = clientAccessRulesEvaluationContext.UserName;

            return(this.RegexPatterns.Any((Regex target) => target.IsMatch(username)));
        }
Ejemplo n.º 6
0
        protected override ExecutionControl OnExecute(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;

            if (clientAccessRulesEvaluationContext.WhatIf)
            {
                clientAccessRulesEvaluationContext.WhatIfActionDelegate(clientAccessRulesEvaluationContext.CurrentRule, ClientAccessRulesAction.AllowAccess);
                return(ExecutionControl.Execute);
            }
            return(ExecutionControl.SkipAll);
        }
        public override bool Evaluate(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;

            if (clientAccessRulesEvaluationContext.UserSchema != null && clientAccessRulesEvaluationContext.User != null)
            {
                try
                {
                    QueryParser queryParser = new QueryParser(this.UserRecipientFilter, clientAccessRulesEvaluationContext.UserSchema, QueryParser.Capabilities.All, null, new QueryParser.ConvertValueFromStringDelegate(QueryParserUtils.ConvertValueFromString));
                    return(OpathFilterEvaluator.FilterMatches(queryParser.ParseTree, clientAccessRulesEvaluationContext.User));
                }
                catch (ParsingException ex)
                {
                    ExTraceGlobals.ClientAccessRulesTracer.TraceDebug(0L, string.Format("Unexpected exception: {0}", ex.ToString()));
                }
                catch (DataSourceOperationException ex2)
                {
                    ExTraceGlobals.ClientAccessRulesTracer.TraceDebug(0L, string.Format("Missing information in property bag to process Monad Filter rule", ex2.ToString()));
                }
                return(false);
            }
            return(false);
        }
Ejemplo n.º 8
0
        protected override object OnGetValue(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;

            return(clientAccessRulesEvaluationContext.Protocol);
        }
        protected override object OnGetValue(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;

            return(clientAccessRulesEvaluationContext.RemoteEndpoint.Address);
        }
Ejemplo n.º 10
0
        protected override object OnGetValue(RulesEvaluationContext baseContext)
        {
            ClientAccessRulesEvaluationContext clientAccessRulesEvaluationContext = (ClientAccessRulesEvaluationContext)baseContext;

            return(clientAccessRulesEvaluationContext.AuthenticationType);
        }