mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 19:00:47 +00:00
Implement Enterprise LDAP Client
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Integration;
|
||||
using Xunit;
|
||||
|
||||
public class EnterpriseLdapClientTests
|
||||
{
|
||||
readonly IGitHubClient _github;
|
||||
readonly Team _context;
|
||||
readonly string _distinguishedNameUser = "uid=test-user,ou=users,dc=company,dc=com";
|
||||
readonly string _distinguishedNameTeam = "uid=DG-Test-Team,ou=groups,dc=company,dc=com";
|
||||
|
||||
public EnterpriseLdapClientTests()
|
||||
{
|
||||
_github = EnterpriseHelper.GetAuthenticatedClient();
|
||||
|
||||
NewTeam newTeam = new NewTeam(Helper.MakeNameWithTimestamp("test-team")) { Description = "Test Team" };
|
||||
_context = _github.Organization.Team.Create(EnterpriseHelper.Organization, newTeam).Result;
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanUpdateUserMapping()
|
||||
{
|
||||
var newLDAPMapping = new NewLdapMapping(_distinguishedNameUser);
|
||||
var ldapUser = await
|
||||
_github.Enterprise.Ldap.UpdateUserMapping(EnterpriseHelper.UserName, newLDAPMapping);
|
||||
|
||||
Assert.NotNull(ldapUser);
|
||||
|
||||
// Get user and check mapping was updated
|
||||
var checkUser = await _github.User.Get(EnterpriseHelper.UserName);
|
||||
Assert.Equal(checkUser.Login, ldapUser.Login);
|
||||
//Assert.Equal(checkUser.LdapDN, _distinguishedNameUser);
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanQueueSyncUserMapping()
|
||||
{
|
||||
var response = await
|
||||
_github.Enterprise.Ldap.QueueSyncUserMapping(EnterpriseHelper.UserName);
|
||||
|
||||
// Check response message indicates LDAP sync was queued
|
||||
Assert.NotNull(response);
|
||||
Assert.NotNull(response.Status);
|
||||
Assert.True(response.Status.All(m => m.Contains("was added to the indexing queue")));
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanUpdateTeamMapping()
|
||||
{
|
||||
var newLDAPMapping = new NewLdapMapping(_distinguishedNameTeam);
|
||||
var ldapTeam = await
|
||||
_github.Enterprise.Ldap.UpdateTeamMapping(_context.Id, newLDAPMapping);
|
||||
|
||||
Assert.NotNull(ldapTeam);
|
||||
|
||||
// Get Team and check mapping was updated
|
||||
var checkTeam = await _github.Organization.Team.Get(_context.Id);
|
||||
Assert.Equal(checkTeam.Name, ldapTeam.Name);
|
||||
//Assert.Equal(checkTeam.LDAPDN, _fixtureDistinguishedNameTeam);
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanQueueSyncTeamMapping()
|
||||
{
|
||||
var response = await
|
||||
_github.Enterprise.Ldap.QueueSyncTeamMapping(_context.Id);
|
||||
|
||||
// Check response message indicates LDAP sync was queued
|
||||
Assert.NotNull(response);
|
||||
Assert.NotNull(response.Status);
|
||||
Assert.True(response.Status.All(m => m.Contains("was added to the indexing queue")));
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,7 @@
|
||||
<Compile Include="Clients\AuthorizationClientTests.cs" />
|
||||
<Compile Include="Clients\BlobClientTests.cs" />
|
||||
<Compile Include="Clients\BranchesClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLicenseClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseAdminStatsClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseSearchIndexingClientTests.cs" />
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
{
|
||||
public class EnterpriseLdapClientTests
|
||||
{
|
||||
public class TheUpdateUserMappingMethod
|
||||
{
|
||||
readonly string _distinguishedNameUser = "uid=test-user,ou=users,dc=company,dc=com";
|
||||
|
||||
[Fact]
|
||||
public void RequestsCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
string expectedUri = "admin/ldap/users/test-user/mapping";
|
||||
client.UpdateUserMapping("test-user", new NewLdapMapping(_distinguishedNameUser));
|
||||
|
||||
connection.Received().Patch<LdapUser>(Arg.Is<Uri>(u => u.ToString() == expectedUri), Arg.Any<object>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PassesRequestObject()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
client.UpdateUserMapping("test-user", new NewLdapMapping(_distinguishedNameUser));
|
||||
|
||||
connection.Received().Patch<LdapUser>(
|
||||
Arg.Any<Uri>(),
|
||||
Arg.Is<NewLdapMapping>(a =>
|
||||
a.LdapDN == _distinguishedNameUser));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullArguments()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.UpdateUserMapping(null, new NewLdapMapping(_distinguishedNameUser)));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.UpdateUserMapping("test-user", null));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheQueueSyncUserMappingMethod
|
||||
{
|
||||
[Fact]
|
||||
public void RequestsCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
string expectedUri = "admin/ldap/users/test-user/sync";
|
||||
client.QueueSyncUserMapping("test-user");
|
||||
|
||||
connection.Received().Post<LdapSyncResponse>(
|
||||
Arg.Is<Uri>(u => u.ToString() == expectedUri),
|
||||
Arg.Any<object>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullArguments()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.QueueSyncUserMapping(null));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheUpdateTeamMappingMethod
|
||||
{
|
||||
readonly string _distinguishedNameTeam = "uid=DG-Test-Team,ou=groups,dc=company,dc=com";
|
||||
|
||||
[Fact]
|
||||
public void RequestsCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
string expectedUri = "admin/ldap/teams/1/mapping";
|
||||
client.UpdateTeamMapping(1, new NewLdapMapping(_distinguishedNameTeam));
|
||||
|
||||
connection.Received().Patch<LdapTeam>(
|
||||
Arg.Is<Uri>(u => u.ToString() == expectedUri),
|
||||
Arg.Any<object>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PassesRequestObject()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
client.UpdateTeamMapping(1, new NewLdapMapping(_distinguishedNameTeam));
|
||||
|
||||
connection.Received().Patch<LdapTeam>(
|
||||
Arg.Any<Uri>(),
|
||||
Arg.Is<NewLdapMapping>(a =>
|
||||
a.LdapDN == _distinguishedNameTeam));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonNullArguments()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.UpdateTeamMapping(1, null));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheQueueSyncTeamMappingMethod
|
||||
{
|
||||
[Fact]
|
||||
public void RequestsCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseLdapClient(connection);
|
||||
|
||||
string expectedUri = "admin/ldap/teams/1/sync";
|
||||
client.QueueSyncTeamMapping(1);
|
||||
|
||||
connection.Received().Post<LdapSyncResponse>(
|
||||
Arg.Is<Uri>(u => u.ToString() == expectedUri),
|
||||
Arg.Any<object>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Authentication\CredentialsTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseAdminStatsClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseOrganizationClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLicenseClientTests.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseSearchIndexingClientTests.cs" />
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
public EnterpriseClient(IApiConnection apiConnection) : base(apiConnection)
|
||||
{
|
||||
AdminStats = new EnterpriseAdminStatsClient(apiConnection);
|
||||
Ldap = new EnterpriseLdapClient(apiConnection);
|
||||
License = new EnterpriseLicenseClient(apiConnection);
|
||||
Organization = new EnterpriseOrganizationClient(apiConnection);
|
||||
SearchIndexing = new EnterpriseSearchIndexingClient(apiConnection);
|
||||
@@ -28,6 +29,14 @@
|
||||
///</remarks>
|
||||
public IEnterpriseAdminStatsClient AdminStats { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise LDAP API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/enterprise/ldap/">Enterprise LDAP API documentation</a> for more information.
|
||||
///</remarks>
|
||||
public IEnterpriseLdapClient Ldap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise License API
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise LDAP API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/enterprise/ldap/">Enterprise LDAP API documentation</a> for more information.
|
||||
///</remarks>
|
||||
public class EnterpriseLdapClient : ApiClient, IEnterpriseLdapClient
|
||||
{
|
||||
public EnterpriseLdapClient(IApiConnection apiConnection)
|
||||
: base(apiConnection)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Update the LDAP mapping for a user on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user
|
||||
/// </remarks>
|
||||
/// <param name="userName">The username to update LDAP mapping</param>
|
||||
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
|
||||
/// <returns>The <see cref="LdapUser"/> object.</returns>
|
||||
public async Task<LdapUser> UpdateUserMapping(string userName, NewLdapMapping newLdapMapping)
|
||||
{
|
||||
Ensure.ArgumentNotNull(userName, "userName");
|
||||
Ensure.ArgumentNotNull(newLdapMapping, "newLdapMapping");
|
||||
|
||||
var endpoint = ApiUrls.EnterpriseLdapUserMapping(userName);
|
||||
|
||||
return await ApiConnection.Patch<LdapUser>(endpoint, newLdapMapping);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queue an LDAP Sync job for a user on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user
|
||||
/// </remarks>
|
||||
/// <param name="username">The username to sync LDAP mapping</param>
|
||||
/// <returns>The <see cref="LdapSyncResponse"/> to the queue request.</returns>
|
||||
public async Task<LdapSyncResponse> QueueSyncUserMapping(string userName)
|
||||
{
|
||||
Ensure.ArgumentNotNull(userName, "userName");
|
||||
|
||||
var endpoint = ApiUrls.EnterpriseLdapUserSync(userName);
|
||||
|
||||
var response = await (Task<HttpStatusCode>)ApiConnection.Post(endpoint);
|
||||
return new LdapSyncResponse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the LDAP mapping for a team on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team
|
||||
/// </remarks>
|
||||
/// <param name="teamId">The teamId to update LDAP mapping</param>
|
||||
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
|
||||
/// <returns>The <see cref="LdapTeam"/> object.</returns>
|
||||
public async Task<LdapTeam> UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping)
|
||||
{
|
||||
Ensure.ArgumentNotNull(teamId, "teamId");
|
||||
Ensure.ArgumentNotNull(newLdapMapping, "newLdapMapping");
|
||||
|
||||
var endpoint = ApiUrls.EnterpriseLdapTeamMapping(teamId);
|
||||
|
||||
return await ApiConnection.Patch<LdapTeam>(endpoint, newLdapMapping);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team
|
||||
/// </remarks>
|
||||
/// <param name="teamId">The teamId to update LDAP mapping</param>
|
||||
/// <returns>The <see cref="LdapSyncResponse"/> to the queue request.</returns>
|
||||
public async Task<LdapSyncResponse> QueueSyncTeamMapping(int teamId)
|
||||
{
|
||||
Ensure.ArgumentNotNull(teamId, "teamId");
|
||||
|
||||
var endpoint = ApiUrls.EnterpriseLdapTeamSync(teamId);
|
||||
|
||||
return await ApiConnection.Post<LdapSyncResponse>(endpoint, new object());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,14 @@
|
||||
///</remarks>
|
||||
IEnterpriseAdminStatsClient AdminStats { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise LDAP API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/enterprise/ldap/">Enterprise LDAP API documentation</a> for more information.
|
||||
///</remarks>
|
||||
IEnterpriseLdapClient Ldap { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise License API
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
/// <summary>
|
||||
/// A client for GitHub's Enterprise LDAP API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/enterprise/ldap/">Enterprise LDAP API documentation</a> for more information.
|
||||
///</remarks>
|
||||
public interface IEnterpriseLdapClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Update the LDAP mapping for a user on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user
|
||||
/// </remarks>
|
||||
/// <param name="userName">The username to update LDAP mapping</param>
|
||||
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
|
||||
/// <returns>The <see cref="LdapUser"/> object.</returns>
|
||||
Task<LdapUser> UpdateUserMapping(string userName, NewLdapMapping newLdapMapping);
|
||||
|
||||
/// <summary>
|
||||
/// Queue an LDAP Sync job for a user on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user
|
||||
/// </remarks>
|
||||
/// <param name="userName">The username to sync LDAP mapping</param>
|
||||
/// <returns>The <see cref="LdapSyncResponse"/> to the queue request.</returns>
|
||||
Task<LdapSyncResponse> QueueSyncUserMapping(string userName);
|
||||
|
||||
/// <summary>
|
||||
/// Update the LDAP mapping for a team on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team
|
||||
/// </remarks>
|
||||
/// <param name="teamId">The teamId to update LDAP mapping</param>
|
||||
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
|
||||
/// <returns>The <see cref="LdapTeam"/> object.</returns>
|
||||
Task<LdapTeam> UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping);
|
||||
|
||||
/// <summary>
|
||||
/// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team
|
||||
/// </remarks>
|
||||
/// <param name="teamId">The teamId to update LDAP mapping</param>
|
||||
/// <returns>The <see cref="LdapSyncResponse"/> to the queue request.</returns>
|
||||
Task<LdapSyncResponse> QueueSyncTeamMapping(int teamId);
|
||||
}
|
||||
}
|
||||
@@ -1664,6 +1664,26 @@ namespace Octokit
|
||||
return EnterpriseAdminStats("all");
|
||||
}
|
||||
|
||||
public static Uri EnterpriseLdapTeamMapping(int teamId)
|
||||
{
|
||||
return "admin/ldap/teams/{0}/mapping".FormatUri(teamId);
|
||||
}
|
||||
|
||||
public static Uri EnterpriseLdapTeamSync(int teamId)
|
||||
{
|
||||
return "admin/ldap/teams/{0}/sync".FormatUri(teamId);
|
||||
}
|
||||
|
||||
public static Uri EnterpriseLdapUserMapping(string userName)
|
||||
{
|
||||
return "admin/ldap/users/{0}/mapping".FormatUri(userName);
|
||||
}
|
||||
|
||||
public static Uri EnterpriseLdapUserSync(string userName)
|
||||
{
|
||||
return "admin/ldap/users/{0}/sync".FormatUri(userName);
|
||||
}
|
||||
|
||||
public static Uri EnterpriseLicense()
|
||||
{
|
||||
return "enterprise/settings/license".FormatUri();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a new organization to create via the <see cref="IEnterpriseOrganizationClient.Create(NewOrganization)" /> method.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class NewLdapMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NewLdapMapping"/> class.
|
||||
/// </summary>
|
||||
/// <param name="ldapDn">The LDAP Distinguished Name</param>
|
||||
public NewLdapMapping(string ldapDN)
|
||||
{
|
||||
LdapDN = ldapDN;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The LDAP Distinguished Name (required)
|
||||
/// </summary>
|
||||
public string LdapDN { get; private set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "LdapDn: {0}", LdapDN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class LdapSyncResponse
|
||||
{
|
||||
public LdapSyncResponse() { }
|
||||
|
||||
public LdapSyncResponse(IReadOnlyList<string> status)
|
||||
{
|
||||
Status = status;
|
||||
}
|
||||
|
||||
public IReadOnlyList<string> Status
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "Status: {0}", string.Join("\r\n", Status));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class LdapTeam : Team
|
||||
{
|
||||
public LdapTeam() { }
|
||||
|
||||
public LdapTeam(Uri url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization, string ldapDN)
|
||||
: base(url, id, name, permission, membersCount, reposCount, organization)
|
||||
{
|
||||
LdapDN = ldapDN;
|
||||
}
|
||||
|
||||
public string LdapDN { get; protected set; }
|
||||
|
||||
internal new string DebuggerDisplay
|
||||
{
|
||||
get { return base.DebuggerDisplay; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class LdapUser : User
|
||||
{
|
||||
public LdapUser() { }
|
||||
|
||||
public LdapUser(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin, string ldapDN)
|
||||
: base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, url, siteAdmin)
|
||||
{
|
||||
LdapDN = ldapDN;
|
||||
}
|
||||
|
||||
public string LdapDN { get; protected set; }
|
||||
|
||||
internal new string DebuggerDisplay
|
||||
{
|
||||
get { return base.DebuggerDisplay; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -447,6 +447,12 @@
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\SearchIndexingTarget.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -455,6 +455,12 @@
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\SearchIndexingTarget.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -451,6 +451,12 @@
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\SearchIndexingTarget.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -444,6 +444,12 @@
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\SearchIndexingTarget.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
|
||||
|
||||
@@ -451,6 +451,12 @@
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\SearchIndexingTarget.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
|
||||
|
||||
@@ -59,10 +59,12 @@
|
||||
</Compile>
|
||||
<Compile Include="Clients\ActivitiesClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseAdminStatsClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseOrganizationClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseLicenseClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\EnterpriseSearchIndexingClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLdapClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseOrganizationClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseLicenseClient.cs" />
|
||||
<Compile Include="Clients\Enterprise\IEnterpriseAdminStatsClient.cs" />
|
||||
@@ -110,6 +112,7 @@
|
||||
<Compile Include="Http\ProductHeaderValue.cs" />
|
||||
<Compile Include="Http\RequestBody.cs" />
|
||||
<Compile Include="Models\Request\BranchUpdate.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewLdapMapping.cs" />
|
||||
<Compile Include="Models\Request\GistFileUpdate.cs" />
|
||||
<Compile Include="Models\Request\NewArbitraryMarkDown.cs" />
|
||||
<Compile Include="Models\Request\Enterprise\NewOrganization.cs" />
|
||||
@@ -150,6 +153,9 @@
|
||||
<Compile Include="Models\Response\Enterprise\AdminStatsPages.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\AdminStatsPulls.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\AdminStatsRepos.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapTeam.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapUser.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LdapSyncResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\SearchIndexingResponse.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\LicenseInfo.cs" />
|
||||
<Compile Include="Models\Response\Enterprise\AdminStatsUsers.cs" />
|
||||
|
||||
Reference in New Issue
Block a user