diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-26 07:26:15 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-26 07:26:15 +0000 |
| commit | beac410b62b8ae5e3bf26487484d9bcc53dc4c35 (patch) | |
| tree | d8b05fcb2fb7b0fbac9567331b7b531d1a666fdc /lib/net | |
| parent | ad5dc798c8dc1fcfe20b529c536e4bc2a0749b7c (diff) | |
| download | ruby-beac410b62b8ae5e3bf26487484d9bcc53dc4c35.tar.gz ruby-beac410b62b8ae5e3bf26487484d9bcc53dc4c35.tar.xz ruby-beac410b62b8ae5e3bf26487484d9bcc53dc4c35.zip | |
* lib/net/imap.rb (Net::IMAP::PlainAuthenticator): added a new class
to support the PLAIN authentication mechanism. Thanks, Benjamin
Stiglitz.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
| -rw-r--r-- | lib/net/imap.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 7886c66fd..0a992844d 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -3130,6 +3130,22 @@ module Net end add_authenticator "LOGIN", LoginAuthenticator + # Authenticator for the "PLAIN" authentication type. See + # #authenticate(). + class PlainAuthenticator + def process(data) + return "\0#{@user}\0#{@password}" + end + + private + + def initialize(user, password) + @user = user + @password = password + end + end + add_authenticator "PLAIN", PlainAuthenticator + # Authenticator for the "CRAM-MD5" authentication type. See # #authenticate(). class CramMD5Authenticator |
