File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ class Net::IMAP::SASL::PlainAuthenticator
1616
1717 # Authentication identity: the identity that matches the #password.
1818 #
19+ # RFC-2831[https://tools.ietf.org/html/rfc2831] uses the term +username+.
20+ # "Authentication identity" is the generic term used by
21+ # RFC-4422[https://tools.ietf.org/html/rfc4422].
1922 # RFC-4616[https://tools.ietf.org/html/rfc4616] and many later RFCs abbreviate
2023 # this to +authcid+.
2124 attr_reader :username
@@ -53,6 +56,10 @@ class Net::IMAP::SASL::PlainAuthenticator
5356 # See attribute documentation for more details.
5457 def initialize ( user = nil , pass = nil ,
5558 username : nil , password : nil , authzid : nil , **)
59+ [ username , user ] . compact . count == 1 or
60+ raise ArgumentError , "conflicting values for username"
61+ [ password , pass ] . compact . count == 1 or
62+ raise ArgumentError , "conflicting values for password"
5663 username ||= user or raise ArgumentError , "missing username"
5764 password ||= pass or raise ArgumentError , "missing password"
5865 raise ArgumentError , "username contains NULL" if username . include? ( NULL )
You can’t perform that action at this time.
0 commit comments