From 48ebdbb03ac4cc1bae2e67456483cf92dd3594ae Mon Sep 17 00:00:00 2001 From: ljf Date: Sat, 14 Jan 2023 23:40:23 +0100 Subject: [PATCH 1/3] [fix] LDAP connector with erland 24.3+ --- lib/service/auth/ldap_authenticator.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/service/auth/ldap_authenticator.ex b/lib/service/auth/ldap_authenticator.ex index 6dba56edd..7a31b1997 100644 --- a/lib/service/auth/ldap_authenticator.ex +++ b/lib/service/auth/ldap_authenticator.ex @@ -132,9 +132,11 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticator do ) :: String.t() | {:error, :ldap_registration_missing_attributes} | any() defp search_user(connection, ldap, base, uid, email, group) do + Logger.debug("Searching for user") # We may need to bind before performing the search res = if Keyword.get(ldap, :require_bind_for_search, true) do + Logger.debug("Doing binding before search as it's required") admin_field = Keyword.get(ldap, :bind_uid) admin_password = Keyword.get(ldap, :bind_password) bind_user(connection, base, uid, admin_field, admin_password) @@ -153,7 +155,9 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticator do @spec do_search_user(any(), String.t(), String.t(), String.t(), String.t() | boolean()) :: String.t() | {:error, :ldap_registration_missing_attributes} | any() defp do_search_user(connection, base, uid, email, group) do - with {:ok, {:eldap_search_result, [{:eldap_entry, _, attributes}], _}} <- + Logger.debug("Searching user") + + with {:ok, {:eldap_search_result, [{:eldap_entry, _, attributes}], _, _}} <- :eldap.search(connection, [ {:base, to_charlist(base)}, {:filter, search_filter(email, group)}, From cef536d5b9573f78adf0b6771b3e976998c18d8c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 16 Jan 2023 12:00:06 +0100 Subject: [PATCH 2/3] Fix LDAP authentificator tests Signed-off-by: Thomas Citharel --- test/service/auth/ldap_authentificator_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/service/auth/ldap_authentificator_test.exs b/test/service/auth/ldap_authentificator_test.exs index 6168f8594..9136c2171 100644 --- a/test/service/auth/ldap_authentificator_test.exs +++ b/test/service/auth/ldap_authentificator_test.exs @@ -62,7 +62,8 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do wholeSubtree: fn -> :ok end, search: fn _connection, _options -> {:ok, - {:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], []}} + {:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], [], + []}} end, close: fn _connection -> send(self(), :close_connection) @@ -110,7 +111,8 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticatorTest do wholeSubtree: fn -> :ok end, search: fn _connection, _options -> {:ok, - {:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], []}} + {:eldap_search_result, [{:eldap_entry, '', [{'cn', [to_charlist("MyUser")]}]}], [], + []}} end, close: fn _connection -> send(self(), :close_connection) From 20fc9d1f6b7fe0e08aa28f495fba7c0eb1ce4686 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 20 Mar 2023 16:38:43 +0100 Subject: [PATCH 3/3] Fetch config for export event participant formats Signed-off-by: Thomas Citharel --- js/src/graphql/config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/graphql/config.ts b/js/src/graphql/config.ts index b55fb06de..e122f9650 100644 --- a/js/src/graphql/config.ts +++ b/js/src/graphql/config.ts @@ -112,6 +112,9 @@ export const CONFIG = gql` isDefault } } + exportFormats { + eventParticipants + } } } `;