Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FrendsPlatform/Frends.LDAP
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Hoglandets-IT/Frends.LDAP
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 2 commits
  • 18 files changed
  • 1 contributor

Commits on Feb 19, 2024

  1. Added ignore certificates option

    Lars committed Feb 19, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    HighCrit HighCrit
    Copy the full SHA
    e23873a View commit details
  2. Update version numbers

    Lars committed Feb 19, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    HighCrit HighCrit
    Copy the full SHA
    2c21aea View commit details
Showing with 80 additions and 12 deletions.
  1. +7 −1 Frends.LDAP.AddUserToGroups/Frends.LDAP.AddUserToGroups/AddUserToGroups.cs
  2. +5 −0 Frends.LDAP.AddUserToGroups/Frends.LDAP.AddUserToGroups/Definitions/Connection.cs
  3. +1 −1 Frends.LDAP.AddUserToGroups/Frends.LDAP.AddUserToGroups/Frends.LDAP.AddUserToGroups.csproj
  4. +7 −1 Frends.LDAP.CreateUser/Frends.LDAP.CreateUser/CreateUser.cs
  5. +5 −0 Frends.LDAP.CreateUser/Frends.LDAP.CreateUser/Definitions/Connection.cs
  6. +1 −1 Frends.LDAP.CreateUser/Frends.LDAP.CreateUser/Frends.LDAP.CreateUser.csproj
  7. +5 −0 Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser/Definitions/Connection.cs
  8. +7 −1 Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser/DeleteUser.cs
  9. +1 −1 Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser.csproj
  10. +5 −0 Frends.LDAP.RemoveUserFromGroups/Frends.LDAP.RemoveUserFromGroups/Definitions/Connection.cs
  11. +1 −1 ...DAP.RemoveUserFromGroups/Frends.LDAP.RemoveUserFromGroups/Frends.LDAP.RemoveUserFromGroups.csproj
  12. +7 −1 Frends.LDAP.RemoveUserFromGroups/Frends.LDAP.RemoveUserFromGroups/RemoveUserFromGroups.cs
  13. +5 −0 Frends.LDAP.SearchObjects/Frends.LDAP.SearchObjects/Definitions/Connection.cs
  14. +1 −1 Frends.LDAP.SearchObjects/Frends.LDAP.SearchObjects/Frends.LDAP.SearchObjects.csproj
  15. +9 −1 Frends.LDAP.SearchObjects/Frends.LDAP.SearchObjects/SearchObjects.cs
  16. +5 −0 Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser/Definitions/Connection.cs
  17. +1 −1 Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser.csproj
  18. +7 −1 Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser/UpdateUser.cs
Original file line number Diff line number Diff line change
@@ -22,7 +22,13 @@ public static Result AddUserToGroups([PropertyTab] Input input, [PropertyTab] Co
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("AddUserToGroups error: Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
8 changes: 7 additions & 1 deletion Frends.LDAP.CreateUser/Frends.LDAP.CreateUser/CreateUser.cs
Original file line number Diff line number Diff line change
@@ -21,7 +21,13 @@ public static Result CreateUser([PropertyTab] Input input, [PropertyTab] Connect
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
8 changes: 7 additions & 1 deletion Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser/DeleteUser.cs
Original file line number Diff line number Diff line change
@@ -21,7 +21,13 @@ public static Result DeleteUser([PropertyTab] Input input, [PropertyTab] Connect
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Original file line number Diff line number Diff line change
@@ -22,7 +22,13 @@ public static Result RemoveUserFromGroups([PropertyTab] Input input, [PropertyTa
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("RemoveUserFromGroups error: Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Security.Cryptography.X509Certificates;

namespace Frends.LDAP.SearchObjects;

@@ -25,7 +26,14 @@ public static Result SearchObjects([PropertyTab] Input input, [PropertyTab] Conn
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

var conn = new LdapConnection();

LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);
var defaultPort = connection.SecureSocketLayer ? 636 : 389;
var atr = new List<string>();
var searchResults = new List<SearchResult>();
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.1.0</Version>
<Version>1.2.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
8 changes: 7 additions & 1 deletion Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser/UpdateUser.cs
Original file line number Diff line number Diff line change
@@ -36,7 +36,13 @@ public static Result UpdateUser([PropertyTab] Input input, [PropertyTab] Connect
if (input.Attributes.Length == 0)
throw new Exception("UpdateUser error: Attributes missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{