paddle v0.1.4 Paddle.Class protocol View Source
Protocol used to allow some objects (mainly structs) to represent an LDAP entry.
Implementing this protocol for your specific classes will enable you to manipulate LDAP entries in an easier way than using DNs (hopefully).
If the class you want to implement is simple enough, you might want to use
the Paddle.Class.Helper.gen_class_from_schema/3
or
Paddle.Class.Helper.gen_class/2
macros.
For now, only two “classes” implementing this protocol are provided:
Paddle.PosixAccount
and Paddle.PosixGroup
.
Link to this section Summary
Functions
Return a list of attributes to be generated using the given functions
Return the parent subDN (where to add / get entries of this type)
Must return the class or the list of classes which this “object class” belongs to
Return the list of required attributes for this “class”
Return the name of the attribute used in the DN to uniquely identify entries
Link to this section Types
Link to this section Functions
Return a list of attributes to be generated using the given functions.
Warning: do not use functions with side effects, as this function may be called even if adding some LDAP entries fails.
Example: [uid: &Paddle.PosixAccount.get_next_uid/1]
This function must take 1 parameter which will be the current class object (useful if you have interdependent attribute values) and must return the generated value.
For example, with %Paddle.PosixGroup{uid: "myUser", ...}
the function will
be called like this:
Paddle.PosixAccount.get_next_uid(%Paddle.PosixAccount{uid: "myUser", ...}
Return the parent subDN (where to add / get entries of this type).
Example for users: "ou=People"
The top base (e.g. "dc=organisation,dc=org"
) must not be specified.
Must return the class or the list of classes which this “object class” belongs to.
For example, a posixAccount could have the following object classes:
["account", "posixAccount"]
The "top"
class is not required.
Return the list of required attributes for this “class”
For example, for the posixAccount class, the following attributes are required:
[:uid, :cn, :uidNumber, :gidNumber, :homeDirectory]
Return the name of the attribute used in the DN to uniquely identify entries.
For example, the identifier for an account would be :uid
because an account
DN would be like: "uid=testuser,ou=People,..."