From: Luke A. K. <lu...@ma...> - 2002-06-29 17:34:33
|
Hi all, I'm currently working on an LDAP CLI shell, just something which will basically let me walk an ldap tree using 'cd' and 'ls', and couple other basic commands, although also hopefully with the ability to edit single entries. I've actually already got the basic functionality done--I can connect to the database, cd around, do listings on branch nodes, that kind of thing. I have a couple of questions as to etiquette, though: It doesn't really seem to make sense to put this under Net::LDAP, even though it obviously relies quite heavily on Net::LDAP. I notice that there are no packages under just plain "LDAP", so I was thinking of using that namespace. If I had an LDAP.pm package at all, it would merely be a few simple, useful routines; most of the real work would be done in subpackages. At this point, I have: LDAP A couple of useful routines, but I don't really need this. LDAP::Shell The package for the interactive shell itself. LDAP::CLI For the CLI auth routines (it caches the username, so you don't have to keep entering it, like you do with ldapsearch and the like). LDAP::Connect Some routines making host connections easier. Specifically there is a routine for connecting to the first live host from a list. LDAP::Config A place to store a list of ldap servers and their basic configurations. Information I am storing so far is: server list, dn (usually null and overridden), password (usually null and overridden), description, objectclass to search for by default (usually inetOrgPerson or posixAccount), attributes required to create one of those objectclasses, and attributes to return by default from that objectlass. This is used heavily by the other packages, so you can just type something like "ldapsh" and be connected to the default server as your default user, with default ssl/nossl settings. LDAP::Desc A simple package for storing descriptions of LDAP attributes. This is useful for prompting people for information, either on the CLI or on a web page; instead of prompting for 'uid', you can prompt for 'Login ID' or whatever. So my main question is, does anyone have a problem with me using this namespace, or is there already a better namespace to put this under? I can't seem to find an appropriate one, but that doesn't mean it's not there. And if someone has already done any or all of this, I would love to hear about it. I'm not planning on devoting a ton of time to this, but it's something I've wanted for a long time, and I've got enough of a foundation of routines that it's not taking me much extra work (I already had everything except the LDAP::Shell package done, but that's the package I think people would be the most interested in). Lastly, I have a few coding questions: I am planning on autoloading each command from something like LDAP::Shell::Commands, so that I don't take the hit of compiling everything at once. This also makes it easy for anyone to add new commands to the shell. I'm also planning on providing the ability to set some kind of search path, so that the package will search other directories for commands to load. Does that sound like an extensible, sensible solution, or does someone else have some amazingly obvious or great solution for me? Also, because I want the commands available in this shell to resemble Unix commands, I am using Getopt::Long to parse their options. It appears that Getopt::Long will only look at @ARGV, so I am setting @ARGV = @_ before I call the routines. Is that retarded, and is there a better way to do it? I'm mainly writing this for myself, because I'm tired of dealing with GUI apps, and it just isn't that hard, but I figure if I do it, I might as well make it available. The reason I want to make it available with this many packages is that it relies on a number of packages I've written over the years, and they've finally gotten to the point where I really can't do much without them. Anyway, I'd love to hear feedback. And BTW Graham, thanks ever so much for Net::LDAP! Luke Kanies -- The Number 1 Sign You Have Nothing to Do at Work... The 4th Division of Paperclips has overrun the Pushpin Infantry and General White-Out has called for a new skirmish. |
From: Graham B. <gb...@po...> - 2002-07-01 10:43:38
|
You are really asking the wrong list for namespace issues. You should contact mo...@pe.... But adding new top-level is normally frowed upon. I would suggest you use Net::LDAP::Shell as a top level and place all your other code in Net::LDAP::Shell::* Graham. On Sat, Jun 29, 2002 at 12:34:30PM -0500, Luke A. Kanies wrote: > Hi all, > > I'm currently working on an LDAP CLI shell, just something which will > basically let me walk an ldap tree using 'cd' and 'ls', and couple other > basic commands, although also hopefully with the ability to edit single > entries. > > I've actually already got the basic functionality done--I can connect to > the database, cd around, do listings on branch nodes, that kind of thing. > > I have a couple of questions as to etiquette, though: It doesn't really > seem to make sense to put this under Net::LDAP, even though it obviously > relies quite heavily on Net::LDAP. I notice that there are no packages > under just plain "LDAP", so I was thinking of using that namespace. > > If I had an LDAP.pm package at all, it would merely be a few simple, > useful routines; most of the real work would be done in subpackages. > At this point, I have: > LDAP > A couple of useful routines, but I don't really need this. > LDAP::Shell > The package for the interactive shell itself. > LDAP::CLI > For the CLI auth routines (it caches the username, so you don't have to > keep entering it, like you do with ldapsearch and the like). > LDAP::Connect > Some routines making host connections easier. Specifically there is a > routine for connecting to the first live host from a list. > LDAP::Config > A place to store a list of ldap servers and their basic > configurations. Information I am storing so far is: server list, dn > (usually null and overridden), password (usually null and overridden), > description, objectclass to search for by default (usually inetOrgPerson > or posixAccount), attributes required to create one of those > objectclasses, and attributes to return by default from that objectlass. > This is used heavily by the other packages, so you can just type something > like "ldapsh" and be connected to the default server as your default user, > with default ssl/nossl settings. > LDAP::Desc > A simple package for storing descriptions of LDAP attributes. This is > useful for prompting people for information, either on the CLI or on a web > page; instead of prompting for 'uid', you can prompt for 'Login ID' or > whatever. > > So my main question is, does anyone have a problem with me using this > namespace, or is there already a better namespace to put this under? I > can't seem to find an appropriate one, but that doesn't mean it's not > there. > > And if someone has already done any or all of this, I would love to hear > about it. I'm not planning on devoting a ton of time to this, but it's > something I've wanted for a long time, and I've got enough of a foundation > of routines that it's not taking me much extra work (I already had > everything except the LDAP::Shell package done, but that's the package I > think people would be the most interested in). > > Lastly, I have a few coding questions: > > I am planning on autoloading each command from something like > LDAP::Shell::Commands, so that I don't take the hit of compiling > everything at once. This also makes it easy for anyone to add new > commands to the shell. I'm also planning on providing the ability to set > some kind of search path, so that the package will search other > directories for commands to load. Does that sound like an extensible, > sensible solution, or does someone else have some amazingly obvious or > great solution for me? > > Also, because I want the commands available in this shell to resemble Unix > commands, I am using Getopt::Long to parse their options. It appears that > Getopt::Long will only look at @ARGV, so I am setting @ARGV = @_ before I > call the routines. Is that retarded, and is there a better way to do it? > > I'm mainly writing this for myself, because I'm tired of dealing with GUI > apps, and it just isn't that hard, but I figure if I do it, I might as > well make it available. The reason I want to make it available with this > many packages is that it relies on a number of packages I've written over > the years, and they've finally gotten to the point where I really can't do > much without them. > > Anyway, I'd love to hear feedback. And BTW Graham, thanks ever so much > for Net::LDAP! > > Luke Kanies > > -- > The Number 1 Sign You Have Nothing to Do at Work... > The 4th Division of Paperclips has overrun the Pushpin Infantry > and General White-Out has called for a new skirmish. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > No, I will not fix your computer. > http://thinkgeek.com/sf |