Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Description

This product features an Archetypes storage that stores field values in
an LDAP directory.

Usage

See directory 'examples/' for some examples of content types using
LDAPStorage.

There are some issues regarding LDAPStorage and Archetypes:

- the storage initialization requires the following parameters:

- the LDAP RDN attribute. For example, in the folowing LDAP
entry, the RDN attribute is 'cn':

dn: cn=johndoe,dc=localhost,dc=localdomain
objectClass: inetOrgPerson
uid: johndoe
cn: johndoe
sn: John Doe

- the attribute that should be used to get the RDN value. It can
be a method, archetypes field or instance variable from which
the value will be retrieved to construct the entry DN.

NOTES:

1) If an archetypes field is used, it must be using
LDAPStorage and you must ensure that the field is the RDN
field that you defined and its attribute is the RDN attribute.

2) If you want to use a field that is not in LDAP,
you should use its accessor, but note that LDAPStorage won't be
able to know when its value changes. So, be sure that methods or
variables used as RDN mapping are not mutable.

- the LDAP attribute to store the value from this field;

The following example is correct:

...
StringField(
'name',
storage = LDAPStorage(
'cn',
'name',
'cn',
default_attrs = {
'objectClass': ['inetOrgPerson'],
},
required_attrs = ['sn', 'cn'],
),
),
...

The following example would raise the exception
'InvalidRDNError':

...
StringField(
'name',
storage = LDAPStorage(
'cn',
'organization',
'cn',
default_attrs = {
'objectClass': ['inetOrgPerson'],
},
required_attrs = ['sn', 'cn'],
),
),
...

- it has also some additional parameters:

- a dictionary of common attributes. This dictionary will be
used to set default values in certain LDAP attributes, at the
creation of new entries. For example, this dictionary could be:

>>> default_attrs = {'objectClass': 'inetOrgPerson'}

- list of required attributes in LDAP schema. It will tell the
storage what fields are required in LDAP, so it knows they must
be included in initialization. For example, the list, assuming
that the only object class used is 'inetOrgPerson', would be:

>>> required_attrs = ['sn', 'cn']

- the usage of this storage assumes that the defined schemas
(LDAP and Archetypes) are compatible. Attributes that are required
in LDAP schema, should be also required in Archetypes schema.

Tests

To run unit tests you need to have a configured LDAP server, and fill
the settings in tests/config file.

Requirements

- CMFPlone 3.0

- Archetypes 1.4

- python-ldap

- LDAPConnection 0.1a1 or newer

Todo

Read file todo.txt for details.


Copyright

Ricardo Alves <rsa at eurotux dot com>

Eurotux Development Team <udp at eurotux dot com>

License

This software is released under GPL v2. Read LICENSE.txt

Changelog
=========

0.1 - Unreleased
----------------

* Initial release

Release files for archetypes.ldapstorage 0.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for archetypes.ldapstorage 0.1a1
File Size Uploaded
archetypes.ldapstorage-0.1a1.tar.gz 70.6 kB Details

Release files / archetypes.ldapstorage-0.1a1.tar.gz

Download URL archetypes.ldapstorage-0.1a1.tar.gz
Size 70.6 kB
Tags Source
SHA-256 checksum
How to use checksums
93f21d678010b5b52af39af680c40fd468a3d8a9474c2620c9689b01f297fc59
BLAKE2b-256 checksum
How to use checksums
8c762f748579c5e2802c40cf822900a4e53f4a242acb0fae4d9918d78a9221a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1a1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page