Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump RestSharp from 106.6.10 to 106.12.0 in /TeamHub/src/TeamAlignment.Common #1

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RestSharp" Version="106.6.10" />
<PackageReference Include="RestSharp" Version="106.12.0" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions DevTools/Tools.sln → Tools/Tools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationConnectors.Commo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OctopusCertificateReferenceFinder", "src\OctopusCertificateReferenceFinder\OctopusCertificateReferenceFinder.csproj", "{41DB617A-081F-496E-9DDB-93948488FD21}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JiraReporting", "src\JiraReporting\JiraReporting.csproj", "{EB5D47D5-6702-4EC0-A1E3-CD48A16C1ECE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{16F9BA96-0BC1-4D3F-91AF-0D096BDCD174}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkCapture", "src\NetworkCapture\NetworkCapture.csproj", "{9F260947-AAD2-443E-851E-B7CE5305F7C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -41,6 +47,14 @@ Global
{41DB617A-081F-496E-9DDB-93948488FD21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41DB617A-081F-496E-9DDB-93948488FD21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41DB617A-081F-496E-9DDB-93948488FD21}.Release|Any CPU.Build.0 = Release|Any CPU
{EB5D47D5-6702-4EC0-A1E3-CD48A16C1ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB5D47D5-6702-4EC0-A1E3-CD48A16C1ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB5D47D5-6702-4EC0-A1E3-CD48A16C1ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB5D47D5-6702-4EC0-A1E3-CD48A16C1ECE}.Release|Any CPU.Build.0 = Release|Any CPU
{9F260947-AAD2-443E-851E-B7CE5305F7C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F260947-AAD2-443E-851E-B7CE5305F7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F260947-AAD2-443E-851E-B7CE5305F7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F260947-AAD2-443E-851E-B7CE5305F7C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.5.0" />
<PackageReference Include="Azure.Security.KeyVault.Keys" Version="4.2.0" />
<PackageReference Include="CommandLineParser" Version="2.8.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using CommandLine;
using Azure.Identity;
using Azure.Security.KeyVault.Keys;
using CommandLine;
using ConfigurationManager.Model;
using System;
using System.IO;
Expand Down Expand Up @@ -42,6 +44,13 @@ static void Main(string[] args)
else
{
//Get value from vault
//https://github.com/Azure/azure-sdk-for-net/blob/Azure.Security.KeyVault.Keys_4.2.0/sdk/keyvault/Azure.Security.KeyVault.Keys/README.md
var client = new KeyClient(vaultUri: new Uri("https://configuration-secrets.vault.azure.net/"), credential: new DefaultAzureCredential());
// Create a new key using the key client.
KeyVaultKey key = client.CreateKey("key-name", KeyType.Rsa);

// Retrieve a key using the key client.
key = client.GetKey("key-name");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ internal static void CheckRestService(string restUrl, string restVerb, string re
}
};


//Use proxy when proxyUri is supplied
if (!string.IsNullOrEmpty(proxyUri))
{
//Set credentials
Expand All @@ -98,10 +98,15 @@ internal static void CheckRestService(string restUrl, string restVerb, string re

var httpClient = new HttpClient(httpClientHandler);

var key = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{restUser}:{restPassword}"));
httpClient.DefaultRequestHeaders.Add("Authorization", $"Basic {key}");
//Use authentication when restUser and restPassword are supplied
if (!string.IsNullOrEmpty(restUser) && !string.IsNullOrEmpty(restPassword))
{
var key = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{restUser}:{restPassword}"));
httpClient.DefaultRequestHeaders.Add("Authorization", $"Basic {key}");
}

httpClient.DefaultRequestHeaders.Accept
.Add(new MediaTypeWithQualityHeaderValue("application/json"));//ACCEPT header
.Add(new MediaTypeWithQualityHeaderValue("application/json")); //ACCEPT header

if (restVerb.Equals("GET"))
{
Expand All @@ -112,13 +117,15 @@ internal static void CheckRestService(string restUrl, string restVerb, string re
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"REST Service: {restUrl} OK");
Console.WriteLine($"REST Response: {result.Content.ReadAsStringAsync().Result}");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"REST Service: {restUrl} Failed with Status Code {result.StatusCode} ({result.ReasonPhrase})");
}
Console.WriteLine($"REST Response: {result.Content.ReadAsStringAsync().Result}");


}

public static void SendTestEmail(string smtpHost, int smtpPort, string emailRecipient)
Expand Down
19 changes: 19 additions & 0 deletions Tools/src/JiraReporting/JiraReporting.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Hangfire" Version="1.7.28" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
<PackageReference Include="NPOI" Version="2.5.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\IntegrationConnectors\src\IntegrationConnectors.Common\IntegrationConnectors.Common.csproj" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/Assignee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class Assignee
{
public string DisplayName { get; set; }
}
}
6 changes: 6 additions & 0 deletions Tools/src/JiraReporting/Model/Field.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace JiraReporting.Model
{
public class Field
{
}
}
27 changes: 27 additions & 0 deletions Tools/src/JiraReporting/Model/Fields.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using JiraReporting.Model;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace JiraReporting.Model
{
public class Fields
{
public string Summary { get; set; }
public Parent Parent { get; set; }
public Status Status { get; set; }
public IssueType IssueType { get; set; }
public Assignee Assignee { get; set; }

[JsonPropertyName("customfield_10263")]
public Severity Severity { get; set; }

[JsonPropertyName("customfield_10018")]
public List<Sprint> Sprints { get; set; }

[JsonPropertyName("customfield_10281")]
public Points Points { get; set; }

[JsonPropertyName("customfield_10283")]
public RaidType RaidType { get; set; }
}
}
10 changes: 10 additions & 0 deletions Tools/src/JiraReporting/Model/Issue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections.Generic;

namespace JiraReporting.Model
{
public class Issue
{
public Fields Fields { get; set; }
public string Key { get; set; }
}
}
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/IssueType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class IssueType
{
public string Name { get; set; }
}
}
12 changes: 12 additions & 0 deletions Tools/src/JiraReporting/Model/JqlQueryResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;

namespace JiraReporting.Model
{
internal class JqlQueryResult
{
public int StartAt { get; set; }
public int MaxResults { get; set; }
public int Total { get; set; }
public List<Issue> Issues { get; set; }
}
}
8 changes: 8 additions & 0 deletions Tools/src/JiraReporting/Model/Parent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace JiraReporting.Model
{
public class Parent
{
public Fields Fields { get; set; }
public string Key { get; set; }
}
}
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/Points.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class Points
{
public string Value { get; set; }
}
}
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/RaidType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class RaidType
{
public string Value { get; set; }
}
}
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/Severity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class Severity
{
public string Value { get; set; }
}
}
10 changes: 10 additions & 0 deletions Tools/src/JiraReporting/Model/Sprint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace JiraReporting.Model
{
public class Sprint
{
public string Name { get; set; }
public string State { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
}
}
7 changes: 7 additions & 0 deletions Tools/src/JiraReporting/Model/Status.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JiraReporting.Model
{
public class Status
{
public string Name { get; set; }
}
}
23 changes: 23 additions & 0 deletions Tools/src/JiraReporting/Options.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using CommandLine;

namespace JiraReporting
{
public class Options
{
[Option("JiraEndpoint", Required = true, HelpText = "JIRA Endpoint")]
public string JiraEndpoint { get; set; }

[Option("JiraProject", Required = true, HelpText = "JIRA Project")]
public string JiraProject { get; set; }

[Option("JiraUsername", Required = true, HelpText = "JIRA Username")]
public string JiraUsername { get; set; }

[Option("JiraAuthenticationToken", Required = true, HelpText = "JIRA Authentication Token")]
public string JiraAuthenticationToken { get; set; }

[Option("PowerBiDatasetEndpoint", Required = true, HelpText = "PowerBI Endpoint")]
public string PowerBiDatasetEndpoint { get; set; }

}
}
Loading