Ticket #25 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

Authentication by password

Reported by: DevUrandom Assigned to: giblet
Priority: normal Milestone: rbot 1.0
Component: misc Version: 0.9.9
Severity: normal Keywords:
Cc: devurandom@gmx.net

Description

I added authentification by password, patch is attached.

Attachments

rbot.password_auth.patch (6.2 kB) - added by DevUrandom on 09/05/05 10:53:42.
Announced patch
rbot.password_auth.revised.patch (13.1 kB) - added by DevUrandom on 09/05/05 20:13:48.
Revised version of the password auth changeset
rbot.password_auth.revised.2.patch (12.9 kB) - added by DevUrandom on 09/05/05 20:59:59.
This is the real, bug fixed, one and only, revised patch with additional features. If you find any bugs left... Just blame me…
auth.rb (10.0 kB) - added by DevUrandom on 09/09/05 08:56:31.
Complete new auth.rb, as the patch would have been bigger than the original. ,) Hope it is stable. If not, tell me.

Change History

09/05/05 10:53:42 changed by DevUrandom

  • attachment rbot.password_auth.patch added.

Announced patch

09/05/05 20:13:48 changed by DevUrandom

  • attachment rbot.password_auth.revised.patch added.

Revised version of the password auth changeset

09/05/05 20:27:41 changed by DevUrandom

Small mistake: Line 106 : def usermod( mask, item, value ) needs to be def usermod( mask, item, value=nil )

09/05/05 20:59:59 changed by DevUrandom

  • attachment rbot.password_auth.revised.2.patch added.

This is the real, bug fixed, one and only, revised patch with additional features. If you find any bugs left... Just blame me...

09/06/05 12:37:11 changed by 0x002a@gmail.com

just in case anybody cares: I implemented the same feature by introducing a new openstruct based User class and reopening the Auth class to override the relevant methods. I found this to be a too invasive patch for the mainline to submit a ticket, but I can post the patch somewhere if you want..

09/06/05 12:44:03 changed by giblet

  • status changed from new to assigned.

Nothing's too invasive at this stage - 1.0 is coming up and IMO it's ok to change the way certain things work (for the better) for the 1.0 release.

I've been working with DevUrandom? on tweaking this patch and I the plan is currently to improve the user system by adding real identities before 1.0.

09/09/05 08:56:31 changed by DevUrandom

  • attachment auth.rb added.

Complete new auth.rb, as the patch would have been bigger than the original. ,) Hope it is stable. If not, tell me.

09/13/05 09:44:30 changed by DevUrandom

Will you include my new auth.rb?

09/13/05 15:35:45 changed by giblet

Yessir!

Sorry, work and moving house issues have kept me from doing any rbot development. I'll get caught up shortly and your patch is honestly the first I will apply!

12/02/05 05:57:49 changed by DevUrandom

Still not applied? :( If you dont like it or the way it works now, just tell me...

12/02/05 07:25:58 changed by anonymous

I just haven't gotten around to addressing the "FIXME" and the lack of backward compatibility with the old users.rbot.

Right now the first time you run with it, this happens: auth.rb:43:in initialize': undefined method default=' for #<String:0x404895e8> (NoMethodError?)

from /usr/local/lib/site_ruby/1.8/rbot/auth.rb:41:in `initialize' from /usr/local/lib/site_ruby/1.8/rbot/ircbot.rb:154:in `initialize' from /usr/bin/rbot:77

I'll get to it soon.

12/02/05 07:47:25 changed by giblet

also, this:

@users = Hash.new( Struct::UserData.new( @bot.config['defaultLevel'], '', [] ) )

means all users default to the same struct, and modifying one changes all the others. It should be:

      @users = Hash.new do
        Struct::UserData.new(@bot.config['auth.default_level'], '', [])
      end

But then you lose that when going to yaml and back. and Hash.default doesn't support procs.

Attempting to work around this...

12/02/05 08:00:43 changed by giblet

ok commiting - still needs some work though. users should be able to add themselves and get the default privs, we need to migrate users.rbot if possible (I switched the new format to use users.yaml). The user interface to auth (adduser etc) could be more helpful too.

But, it's a good start and allowing users to have identities independently of their hostmask is an important concept :) Thanks for the patch!

06/28/06 10:45:26 changed by giuseppe.bilotta

There is a bug which I haven't sorted out yet: if for any reason the rbot is interrupted at just the right time, users.yaml will be destroyed.

06/28/06 10:53:20 changed by giblet

Yep, see the way we handle conf.yaml in rbot/config.rb. It's important to be atomic - so we write out the new config to .new, and if successful we use rename (which is atomic) to replace the config file on disk.

06/28/06 18:01:38 changed by giuseppe.bilotta

Can this be implemented in a component-independent fashion? It would be useful for all the plugins that make use of textual configuration files: conf.yaml, of course, and users.yaml as discussed here, but even the quotes plugin could take advantage of it, for examples.

06/28/06 18:27:25 changed by giuseppe.bilotta

  • summary changed from Authentification by password to Authentication by password.

(grammar police fix for the Summary of this ticket)

10/19/06 20:05:26 changed by giuseppe.bilotta

  • status changed from assigned to closed.
  • resolution set to fixed.

I'm closing this issue: because of the total rework of the auth framework currently in trunk (0.9.11), these patches no longer apply.