Catman...::LDAP(3pm)

πŸ’– Catman...::LDAP πŸ’–

okay bestie, welcome to the Catmandu::Importer::LDAP page β€” this is the manual page for Catman...::LDAP(3pm) from the User Contributed Perl Documentation, and she's a whole package that imports LDAP directories. yes. directories. from LDAP. we love her. 🫢


✨ NAME ✨

Catmandu::Importer::LDAP β€” a package that imports LDAP directories. that's the vibe. that's the whole job. πŸ‘‘


🌈 SYNOPSIS 🌈

first up, from the command line, no Perl required, just vibes:

# From the command line

# Anonymous bind to find all 'Patrick's
$ catmandu convert LDAP \
        --host ldaps://ldaps.ugent.be \
        --search-filter '(givenName=Patrick)' \
        --search-base 'dc=ugent, dc=be' to YAML

not me finding every single Patrick in Ghent through an anonymous bind 😭 iconic honestly.

and then from Perl, if you're feeling extra fancy:

# From Perl

use Catmandu;

my $importer = Catmandu->importer('LDAP',
                     host          => 'ldaps://ldaps.ugent.be' ,
                     search_filter => '(givenName=Patrick)' ,
                     search_base   => 'dc=ugent, dc=be'
                );

my $exporter = Catmandu->exporter('YAML');

$exporter->add_many($importer);

$exporter->commit;

importer in, exporter out, add_many, commit, done. slay. πŸ’…


πŸŽ€ CONFIGURATION πŸŽ€

these are the little knobs you get to turn, bestie. turn them gently.

  • host β€” the LDAP host you're connecting to. that's where the directory lives, go say hi. πŸ¦‹
  • base β€” the base you bind to. if you don't specify it, it's an anonymous bind β€” no name, no password, just vibes. πŸ™ˆ
  • password β€” the password needed for the bind. yes, the bind needs a password. no, we don't ask questions. πŸ”
  • search_base β€” the DN that is the base object entry relative to which the search is to be performed. like, "start looking from here, queen." πŸ’œ
  • search_filter β€” one or more search filters. e.g.:
(givenName=Patrick)    # search Patrick
(&(givenName=Patrick)(postalCode=9000))  # search Patrick AND postalcode=9000
(|)(givenName=Patrick)(postalCode=9000)) # search Patrick OR postcalcode=9000

look at her. AND logic, OR logic, she contains multitudes. 🌈


⭐ METHODS ⭐

every Catmandu::Importer is a Catmandu::Iterable, so literally all its methods are inherited. free methods, we love a generous queen. πŸ’–

but listen, and listen good: the methods are not idempotent β€” LDAP streams can only be read once. read it once, bestie. there is no rewind. no take-backs. it's giving one-shot. πŸ’€

🌸 SEE ALSO 🌸

go be nosy, these three are the family:

  • Catmandu
  • Catmandu::Importer
  • Catmandu::Iterable

and that's the page!! ✨ this was Catman...::LDAP(3pm) from the User Contributed Perl Documentation, footer edition: perl v5.36.0, dated 2023-02-04. mwah, take care of her, and remember β€” anonymous bind responsibly πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from