@@ -41,7 +41,8 @@ class Net::IMAP::SASL::DigestMD5Authenticator
41
41
attr_reader :authzid
42
42
43
43
# :call-seq:
44
- # new(username, password, authzid = nil) -> authenticator
44
+ # new(username, password, authzid = nil, **options) -> authenticator
45
+ # new(username:, password:, authzid: nil, **options) -> authenticator
45
46
#
46
47
# Creates an Authenticator for the "+DIGEST-MD5+" SASL mechanism.
47
48
#
@@ -55,7 +56,12 @@ class Net::IMAP::SASL::DigestMD5Authenticator
55
56
# * +warn_deprecation+ — Set to +false+ to silence the warning.
56
57
#
57
58
# See the documentation for each attribute for more details.
58
- def initialize ( username , password , authzid = nil , warn_deprecation : true )
59
+ def initialize ( user = nil , pass = nil , authz = nil ,
60
+ username : nil , password : nil , authzid : nil ,
61
+ warn_deprecation : true , **)
62
+ username ||= user or raise ArgumentError , "missing username"
63
+ password ||= pass or raise ArgumentError , "missing password"
64
+ authzid ||= authz
59
65
if warn_deprecation
60
66
warn "WARNING: DIGEST-MD5 SASL mechanism was deprecated by RFC6331."
61
67
# TODO: recommend SCRAM instead.
0 commit comments