Exemple #1
0
        private static HttpClient GetClient(JiraCredentials credentials)
        {
            try
            {
                if (credentials == null)
                {
                    JiraSettings j = ModuleSettingsAccessor <JiraSettings> .GetSettings();

                    credentials = new JiraCredentials
                    {
                        JiraURL        = j.JiraURL,
                        Password       = j.Password,
                        User           = j.UserId,
                        JiraConnection = j.JiraConnection
                    };
                }

                HttpClient httpClient = new HttpClient {
                    BaseAddress = new Uri(credentials.JiraURL.TrimEnd('/') + BASEPATH)
                };
                httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");

                httpClient.DefaultRequestHeaders.Authorization = new AuthenticationManager().GetAuthHeader(credentials);
                return(httpClient);
            }
            catch (Exception ex)
            {
                throw new LoggedException($"Error setting up connection to {credentials.JiraURL}", ex);
            }
        }
Exemple #2
0
        public void Initialize()
        {
            JiraSettings me = ModuleSettingsAccessor <JiraSettings> .GetSettings();

            if (string.IsNullOrEmpty(Id))
            {
                ModuleSettingsAccessor <JiraSettings> .SaveSettings();
            }
        }
Exemple #3
0
        public HttpClient GetClient(JiraCredentials credentials)
        {
            if (credentials == null)
            {
                JiraSettings j = ModuleSettingsAccessor <JiraSettings> .GetSettings();

                credentials          = new JiraCredentials();
                credentials.JiraURL  = j.JiraURL;
                credentials.Password = j.Password;
                credentials.User     = j.UserId;
            }

            HttpClient httpClient = new HttpClient {
                BaseAddress = new Uri(credentials.JiraURL)
            };

            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");

            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationManager().GetAuthHeader(credentials);
            return(httpClient);
        }
Exemple #4
0
        public static string RunScript(InputParameter InputVariables)
        {
            PythonSettings settings = ModuleSettingsAccessor <PythonSettings> .GetSettings();

            //var pypath = "C:\\Users\\Corey\\AppData\\Local\\Programs\\Python\\Python37-32\\";
            //var path = "C:\\Users\\Corey\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe";
            var     pypath  = settings.PythonScriptDirectory;
            var     path    = settings.PythonDirectory;
            Process process = new Process();

            process.StartInfo.FileName = "cmd.exe";
            List <string> newArgs = new List <string>();

            newArgs.Add(pypath + InputVariables.fileName);
            newArgs.AddRange(InputVariables.args);

            process.StartInfo.Arguments              = "/c" + path + " " + String.Join(" ", newArgs); // Note the /c command (*)
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.RedirectStandardError  = true;
            process.Start();
            //* Read the output (or the error)
            string output = process.StandardOutput.ReadToEnd();

            Console.WriteLine(output);
            if (output == "")

            {
                string err = process.StandardError.ReadToEnd();
                Console.WriteLine(err);
                process.WaitForExit();
                return(err);
            }
            process.WaitForExit();
            return(output);
        }
Exemple #5
0
        public void Initialize()
        {
            ProfilerService.DetailWriter = this;
            // When data dog is in place we want the logs written without
            // json being on new lines.
            Log.WRITE_LOG_FILE_DELIMITER = false;
            Log.WRITE_JSON_WITH_INDENTS  = true;

            // Setup the static client.
            TEL_CLIENT = new TelemetryClient();
            if (string.IsNullOrEmpty(ModuleSettingsAccessor <AzureAppInsightsSettings> .GetSettings().InstrumentationKey))
            {
                AzureAppInsightsLog.LOG.Warn("Instrumentation Key is NOT set in settings and should be configured.  /System/Settings/AzureAppInsights");
            }
            else
            {
                TEL_CLIENT.InstrumentationKey =
                    ModuleSettingsAccessor <AzureAppInsightsSettings> .GetSettings().InstrumentationKey;

                Dictionary <string, string> props = new Dictionary <string, string>();
                props["Version"] = Version.VERSION;
                TEL_CLIENT.TrackEvent("SHM Started", props);
            }
        }
Exemple #6
0
 public void Initialize()
 {
     // this will create it
     ModuleSettingsAccessor <DocusignSettings> .GetSettings();
 }
Exemple #7
0
 public static SCOIntegrationSettings GetSettings()
 {
     return(ModuleSettingsAccessor <SCOIntegrationSettings> .GetSettings());
 }
 public void Initialize()
 {
     // Read the Settings here
     ModuleSettingsAccessor <EquifaxSettings> .GetSettings();
 }
        private void EnsureCustomSettingsObject()
        {
            ModuleSettingsAccessor <RollbarSettings> .GetSettings();

            ModuleSettingsAccessor <RollbarSettings> .SaveSettings();
        }
Exemple #10
0
 static public ObserveSettings Instance()
 {
     return(ModuleSettingsAccessor <ObserveSettings> .GetSettings());
 }
 static public LogzSettings Instance()
 {
     return(ModuleSettingsAccessor <LogzSettings> .GetSettings());
 }
Exemple #12
0
        private void SetBrandingExample()
        {
            ModuleSettingsAccessor <PortalSettings> .GetSettings().SloganText = "SDK Portal!";

            ModuleSettingsAccessor <DesignerSettings> .GetSettings().StudioSlogan = "Loan Rule Portal";
        }
Exemple #13
0
        private void EnsureCustomSettingsObject()
        {
            ModuleSettingsAccessor <GoogleDriveSettings> .GetSettings();

            ModuleSettingsAccessor <GoogleDriveSettings> .SaveSettings();
        }