Tags:
create new tag
, view all tags

Use DBM Files for the User Database

The site where I've just set up a restricted-access wiki uses DBM files (AuthDBUserFile) instead of flat files to store user password information. I was a little surprised to find that TWiki didn't support a setup like this, but it didn't take long to fix.

The attached patch adds a new file in lib/TWiki/User, makes a small patch to User.pm to use the new file, and adds a few variables and comments to TWiki.cfg. The changes for the DEVELOP branch are similar in scope but a few more places needed to be fixed up.

What do you think, sirs?

-- CloyceSpradling - 02 Jan 2005

How does this patch relate to your AddDBMGroupPlugin?

-- PeterThoeny - 03 Jan 2005

It's complementary. It's certainly possible to use a DBM-based user file with a flat group file, or vice-versa. The TWiki that I'm setting up uses DBM for both, and the functionality from AddDBMGroupPlugin was originally not in a plugin. But in the interest of making as little impact in the core code as possible, I put it into a module. That had the added nice effect of making the DBMManageUser module identical in functionality to the existing HtPasswdUser module.

-- CloyceSpradling - 03 Jan 2005

Great work, Cloyce! The one thing that seems to be missing (maybe I'm just blind) is user documentation..... ?

Sorry, I don't see any tests either; how can I test this, bearing in mind that I don't use DBM authentication on my own site?

-- CrawfordCurrie - 04 Jan 2005

All of the documentation that exists is in TWiki.cfg. As far as I could tell that was also the case for the settings needed for HtPasswdUser, so I thought it'd be okay for DBMManageUser as well. I'm new to TWiki (and wikis in general), and I was in a hurry to get this one set up, so I read a minimum of documentation. That did cause me a small amount of pain, relating to setting up registration with passwords, but I'm going to try to fix that one myself once I get a little time.

As far as documenting this feature goes, should I edit the doc pages here and reference the feature along with the patches needed to get it? It seems silly to make a patch that definitely won't apply, and it also seems silly to make a whole configuration topic for just this. I mean, HtPasswdUser doesn't have one, does it? Hmmm... maybe they both should.

As far as testing, that's pretty easy to do by hand. You need to set up the variables in TWiki.cfg according to the excellent (hahaha!) comments therein, and then register a user using TWikiRegistrationPub. Then it's just a simple matter of dumping the database that was created to see if your user is in there. Depending on which modules you selected in TWiki.cfg, the method may differ, but if the default first choice DB_File is available, you can dump it with dbmmanage. As to whether your Apache will use said file for authentication... well, that's more a matter of whether the versions of the DB libraries involved in the build of Apache and the build of Perl are compatible. But I figure that chances are that if a site has an existing database which they manage with dbmmanage that the above conditions are satisfied.

But perhaps you were thinking about more automated tests? How is HtPasswdUser tested?

-- CloyceSpradling - 06 Jan 2005

this can be considered implemented as HTTPDUserAdminContrib which has both User, authentication and Group support built in.

-- SvenDowideit - 13 Aug 2008

Category: TWikiPatches

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch TWiki.DEVELOP.dbmmanage.patch r1 manage 15.7 K 2005-01-02 - 21:53 CloyceSpradling Untested patch against the DEVELOP branch as of 2 Jan 2005
Unknown file formatpatch TWiki.dbmmanage.patch r1 manage 12.5 K 2005-01-02 - 20:43 CloyceSpradling Patch to add DBM user database handling
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2008-08-13 - SvenDowideit
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.