Example #1
0
        private string BuildTokenRequest(RESOClientSettings clientsettings)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("grant_type=");
            sb.Append(clientsettings.GetSetting(settings.oauth_granttype));
            if (clientsettings.GetSetting(settings.oauth_granttype) == "authorization_code")
            {
                sb.Append("&");
                sb.Append("code=");
                sb.Append(clientsettings.GetSetting(settings.openid_code));

                sb.Append("&");
                sb.Append("redirect_uri=");
                sb.Append(clientsettings.GetSetting(settings.oauth_redirecturi));
            }
            sb.Append("&");
            sb.Append("client_id=");
            sb.Append(clientsettings.GetSetting(settings.oauth_clientidentification));
            if (clientsettings.GetSetting(settings.oauth_granttype) == "client_credentials")
            {
                sb.Append("&");
                sb.Append("client_secret=");
                sb.Append(clientsettings.GetSetting(settings.oauth_clientsecret));
                sb.Append("&");
                sb.Append("scope=");
                sb.Append(clientsettings.GetSetting(settings.oauth_clientscope));
            }

            return(sb.ToString());
        }
Example #2
0
 public RuleControlImport(RESOClientSettings settings)
 {//System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Application.ExecutablePath), @"\config");
     clientsettings = settings;
     if (clientsettings != null)
     {
         inputpath  = clientsettings.GetSetting(RESOClientLibrary.settings.rulecontrolinput);
         outputpath = clientsettings.GetSetting(RESOClientLibrary.settings.rulecontroloutput);
     }
 }
Example #3
0
        public void BuildRuleControlList(RESOClientSettings settings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(settings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));

            //XmlNode node = doc.DocumentElement.SelectSingleNode("/rulescontrol");
            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            record          = new RuleControl();
                            record.rulename = value;
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                    }
                }
                //string text = node.InnerXml;
                //string json = JsonConvert.SerializeXmlNode(node);
                //RuleControl record = JsonConvert.DeserializeObject<RuleControl>(json);
            }
        }
Example #4
0
        private string BuildTokenRequest(RESOClientSettings clientsettings)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("grant_type=");
            sb.Append(clientsettings.GetSetting(settings.oauth_granttype));
            sb.Append("&");
            sb.Append("code=");
            sb.Append(clientsettings.GetSetting(settings.openid_code));
            sb.Append("&");
            sb.Append("redirect_uri=");
            sb.Append(clientsettings.GetSetting(settings.oauth_redirecturi));
            sb.Append("&");
            sb.Append("client_id=");
            sb.Append(clientsettings.GetSetting(settings.oauth_clientidentification));
            return(sb.ToString());
        }
 public ODataServiceTransaction(RESOClientSettings clientsettings)
     : base(clientsettings)
 {
 }
Example #6
0
        public void BuildRuleControlList(RESOClientSettings clientsettings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(clientsettings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));

            //XmlNode node = doc.DocumentElement.SelectSingleNode("/rulescontrol");
            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            else
                            {
                                record             = new RuleControl();
                                record.rulename    = value;
                                rulecontrol[value] = record;
                            }
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                        if (name == "RESOVersion")
                        {
                            record.RESOVersion = value;
                        }
                        if (name == "Description")
                        {
                            record.Description = value;
                        }
                        if (name == "ErrorMessage")
                        {
                            record.ErrorMessage = value;
                        }
                        if (name == "ODataSpecification")
                        {
                            record.ODataSpecification = value;
                        }
                        if (name == "V4ODataSpecification")
                        {
                            record.V4ODataSpecification = value;
                        }
                        if (name == "V4Specification")
                        {
                            record.V4Specification = value;
                        }
                        if (name == "ODataVersion")
                        {
                            record.ODataVersion = value;
                        }
                        if (name == "PayloadType")
                        {
                            record.PayloadType = value;
                        }
                        if (name == "PayloadFormat")
                        {
                            record.PayloadFormat = value;
                        }
                        if (name == "HelpLink")
                        {
                            record.HelpLink = value;
                        }

                        /*
                         *  <rulename>Common.Core.1000</rulename>
                         *      <notes></notes>
                         *      <cert_tr></cert_tr>
                         *      <cert_impact>Should</cert_impact>
                         *      <ttt_testing_results></ttt_testing_results>
                         *      <category>CORE</category>
                         *      <RESOVersion></RESOVersion>
                         *      <Description>A data service SHOULD expose a conceptual schema definition language (CSDL) based metadata endpoint that describes the structure and organization of all the resources exposed as HTTP endpoints.</Description>
                         *      <ErrorMessage>A data service SHOULD expose a conceptual schema definition language (CSDL) based metadata endpoint that describes the structure and organization of all the resources exposed as HTTP endpoints.</ErrorMessage>
                         *      <ODataSpecification>2.2.3.7.2</ODataSpecification>
                         *      <V4ODataSpecification></V4ODataSpecification>
                         *      <V4Specification></V4Specification>
                         *      <ODataVersion></ODataVersion>
                         *      <PayloadType>Entry</PayloadType>
                         *      <PayloadFormat></PayloadFormat>
                         *      <HelpLink></HelpLink>
                         */
                    }
                }
                //string text = node.InnerXml;
                //string json = JsonConvert.SerializeXmlNode(node);
                //RuleControl record = JsonConvert.DeserializeObject<RuleControl>(json);
            }
        }
Example #7
0
        public void BuildRuleControlList(string rulestorun, RESOClientSettings clientsettings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(clientsettings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));
            Hashtable hshrules = new Hashtable();

            string[] rulestorunarray = rulestorun.Split(',');
            for (int n = 0; n < rulestorunarray.Length; n++)
            {
                if (string.IsNullOrEmpty(rulestorunarray[n]))
                {
                    break;
                }
                hshrules[rulestorunarray[n]] = rulestorunarray[n] as string;
            }

            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (hshrules != null && hshrules.Count > 0 && hshrules[value] == null)
                        {
                            continue;
                        }
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            else
                            {
                                record             = new RuleControl();
                                record.rulename    = value;
                                rulecontrol[value] = record;
                            }
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                        if (name == "RESOVersion")
                        {
                            record.RESOVersion = value;
                        }
                        if (name == "Description")
                        {
                            record.Description = value;
                        }
                        if (name == "ErrorMessage")
                        {
                            record.ErrorMessage = value;
                        }
                        if (name == "ODataSpecification")
                        {
                            record.ODataSpecification = value;
                        }
                        if (name == "V4ODataSpecification")
                        {
                            record.V4ODataSpecification = value;
                        }
                        if (name == "V4Specification")
                        {
                            record.V4Specification = value;
                        }
                        if (name == "ODataVersion")
                        {
                            record.ODataVersion = value;
                        }
                        if (name == "PayloadType")
                        {
                            record.PayloadType = value;
                        }
                        if (name == "PayloadFormat")
                        {
                            record.PayloadFormat = value;
                        }
                        if (name == "HelpLink")
                        {
                            record.HelpLink = value;
                        }
                    }
                }
            }
        }
Example #8
0
 public ODataLoginTransaction(RESOClientSettings clientsettings) : base(clientsettings)
 {
 }
Example #9
0
 public ODataMetadataTransaction(RESOClientSettings clientsettings) : base(clientsettings)
 {
 }
 public ODataTestScriptTransaction(RESOClientSettings clientsettings)
     : base(clientsettings)
 {
 }
 public WebAPITransaction(RESOClientSettings clientsettings)
 {
     // TODO: Complete member initialization
     this.clientsettings = clientsettings;
 }
 public ODataTransaction(RESOClientSettings settings)
 {
     this.clientsettings = settings;
 }