@@ -26,24 +26,23 @@ class Authenticators
26
26
# This class is usually not instantiated directly. Use SASL.authenticators
27
27
# to reuse the default global registry.
28
28
#
29
- # By default, the registry will be empty--without any registrations. When
30
- # +add_defaults+ is +true+, authenticators for all standard mechanisms will
31
- # be registered.
32
- #
33
- def initialize ( use_defaults : false )
29
+ # When +use_defaults+ is +false+, the registry will start empty. When
30
+ # +use_deprecated+ is +false+, deprecated authenticators will not be
31
+ # included with the defaults.
32
+ def initialize ( use_defaults : true , use_deprecated : true )
34
33
@authenticators = { }
35
- if use_defaults
36
- add_authenticator "Anonymous"
37
- add_authenticator "External"
38
- add_authenticator "OAuthBearer"
39
- add_authenticator "Plain"
40
- add_authenticator "Scram-SHA-1"
41
- add_authenticator "Scram-SHA-256"
42
- add_authenticator "XOAuth2"
43
- add_authenticator "Login" # deprecated
44
- add_authenticator "Cram-MD5" # deprecated
45
- add_authenticator "Digest -MD5" # deprecated
46
- end
34
+ return unless use_defaults
35
+ add_authenticator "Anonymous"
36
+ add_authenticator "External"
37
+ add_authenticator "OAuthBearer"
38
+ add_authenticator "Plain"
39
+ add_authenticator "Scram-SHA-1"
40
+ add_authenticator "Scram-SHA-256"
41
+ add_authenticator "XOAuth2"
42
+ return unless use_deprecated
43
+ add_authenticator "Login" # deprecated
44
+ add_authenticator "Cram -MD5" # deprecated
45
+ add_authenticator "Digest-MD5" # deprecated
47
46
end
48
47
49
48
# Returns the names of all registered SASL mechanisms.
0 commit comments