File tree Expand file tree Collapse file tree
ldap_protocol/ldap_schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828from ldap_protocol .utils .queries import get_domain_object_class
2929from models import (
3030 Attribute ,
31- AttributeType ,
3231 Directory ,
3332 DirectoryMembership ,
3433 Group ,
@@ -186,28 +185,6 @@ async def setup_enviroment(
186185 domain .rdname = ""
187186
188187 async with session .begin_nested ():
189- session .add (
190- AttributeType (
191- oid = "1.2.3.4.5.6.7.8" ,
192- name = "attr_with_bvalue" ,
193- syntax = "1.3.6.1.4.1.1466.115.121.1.40" , # Octet String
194- single_value = True ,
195- no_user_modification = False ,
196- is_system = True ,
197- )
198- )
199- session .add (
200- AttributeType (
201- oid = "1.2.3.4.5.6.7.8.9" ,
202- name = "testing_attr" ,
203- syntax = "1.3.6.1.4.1.1466.115.121.1.15" ,
204- single_value = True ,
205- no_user_modification = False ,
206- is_system = True ,
207- )
208- )
209- await session .flush ()
210-
211188 session .add (domain )
212189 session .add (
213190 NetworkPolicy (
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ async def _count_exists_object_class_by_names(
161161 count_query = (
162162 select (func .count ())
163163 .select_from (ObjectClass )
164- .where (ObjectClass .name .in_ (object_class_names ))
164+ .where (func . lower ( ObjectClass .name ) .in_ (object_class_names ))
165165 )
166166 result = await self .__session .scalars (count_query )
167167 return result .one ()
@@ -176,7 +176,9 @@ async def is_all_object_classes_exists(
176176 :raise ObjectClassNotFoundError: If Object Class not found.
177177 :return bool.
178178 """
179- object_class_names = set (object_class_names )
179+ object_class_names = set (
180+ object_class .lower () for object_class in object_class_names
181+ )
180182
181183 count_ = await self ._count_exists_object_class_by_names (
182184 object_class_names
Original file line number Diff line number Diff line change 6060from ldap_protocol .server import PoolClientHandler
6161from ldap_protocol .session_storage import RedisSessionStorage , SessionStorage
6262from ldap_protocol .utils .queries import get_user
63- from models import Directory
63+ from models import AttributeType , Directory
6464
6565
6666class TestProvider (Provider ):
@@ -431,6 +431,26 @@ async def setup_session(session: AsyncSession) -> None:
431431 groups = ["cn=domain admins,cn=groups," + domain .path_dn ],
432432 session = session ,
433433 )
434+ session .add (
435+ AttributeType (
436+ oid = "1.2.3.4.5.6.7.8" ,
437+ name = "attr_with_bvalue" ,
438+ syntax = "1.3.6.1.4.1.1466.115.121.1.40" , # Octet String
439+ single_value = True ,
440+ no_user_modification = False ,
441+ is_system = True ,
442+ )
443+ )
444+ session .add (
445+ AttributeType (
446+ oid = "1.2.3.4.5.6.7.8.9" ,
447+ name = "testing_attr" ,
448+ syntax = "1.3.6.1.4.1.1466.115.121.1.15" ,
449+ single_value = True ,
450+ no_user_modification = False ,
451+ is_system = True ,
452+ )
453+ )
434454 await session .commit ()
435455
436456
You can’t perform that action at this time.
0 commit comments