Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion tools/identity-resolution/Helpers/GitHubToAADConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Azure.Core;
using Azure.Identity;
using Microsoft.Extensions.Logging;
using Models.OpenSourcePortal;
using Newtonsoft.Json;

namespace Azure.Sdk.Tools.NotificationConfiguration.Helpers
Expand Down Expand Up @@ -51,7 +52,7 @@ public GitHubToAADConverter(
/// <returns>Aad user principal name</returns>
public string GetUserPrincipalNameFromGithub(string githubUserName)
{
return GetUserPrincipalNameFromGithubAsync(githubUserName).Result;
return GetUserPrincipalNameFromGithubAsync(githubUserName).Result;
}

public async Task<string> GetUserPrincipalNameFromGithubAsync(string githubUserName)
Expand All @@ -73,5 +74,23 @@ public async Task<string> GetUserPrincipalNameFromGithubAsync(string githubUserN

return null;
}

public async Task<UserLink[]> GetPeopleLinksAsync()
{
try
{
logger.LogInformation("Calling GET https://repos.opensource.microsoft.com/api/people/links");
var responseJsonString = await client.GetStringAsync($"https://repos.opensource.microsoft.com/api/people/links");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this call get logged anywhere? Especially if someone is running this locally it might help to let them know what they are waiting on?

var allLinks = JsonConvert.DeserializeObject<UserLink[]>(responseJsonString);

return allLinks;
}
catch (Exception ex)
{
logger.LogError(ex.Message);
}

return null;
}
}
}
15 changes: 15 additions & 0 deletions tools/identity-resolution/Models/OpenSourcePortal/AadUserDetail.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Models.OpenSourcePortal
{
public class AadUserDetail
{
public string Alias { get; set; }

public string PreferredName { get; set; }

public string UserPrincipalName { get; set; }

public string Id { get; set; }

public string EmailAddress { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Models.OpenSourcePortal
{
public class GitHubUserDetail
{
public int Id { get; set; }

public string Login { get; set; }

public string[] Organizations { get; set; }

public string Avatar { get; set; }
}
}
13 changes: 13 additions & 0 deletions tools/identity-resolution/Models/OpenSourcePortal/UserLink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Models.OpenSourcePortal
{
public class UserLink
{
public GitHubUserDetail GitHub { get; set; }

public AadUserDetail Aad { get; set; }

public bool IsServiceAccount { get; set; }

public string ServiceAccountContact { get; set; }
}
}

This file was deleted.

96 changes: 0 additions & 96 deletions tools/pipeline-codeowners-extractor/Extensions.cs

This file was deleted.

172 changes: 0 additions & 172 deletions tools/pipeline-codeowners-extractor/Program.cs

This file was deleted.

Loading