net-imap 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06bbd5924ea63864096450babeb1bde82f6235fa3542df192c39f0ee134ca7bf
4
- data.tar.gz: 959bb6e2a15902bc9422ba55bfc7271d164687ccd344ea297e84ac1933f01e82
3
+ metadata.gz: 7942e0dcda47ac417806fb03aec58b66b8bac3ccf51f53f2f7ac2c6a588e35af
4
+ data.tar.gz: 38530b6af862085a9d1ff3c59c6536152acc15bb7d925d8547cd4feebea42872
5
5
  SHA512:
6
- metadata.gz: de02b12debf1989068fd4df18b074513d7c1fe8744915453a6491633a1d64222b1f1c2eb1f6c2ced6d1b3cddac0b32faf7dc882cd25082ea322656c488539d32
7
- data.tar.gz: b25e3dd246cf6f8b4ae1b0fc71c0c1e853f437cc41fd9b31e74516e8c272c73f4fb4228e4adf9fca54c90db7d5b7db93ee914427637968557bbd7ec750ee444f
6
+ metadata.gz: 5bd29fb28b2b3ed9b1a0589e38f8844c47e671006d50deb4462fe5e8cfd97ad923ef0af3114a094d31cbb5943ff0ac9a15e549e67ac08be68eb04a0915eae67f
7
+ data.tar.gz: 7562e44288caa3538203d415f4d0b1dc4a44a77428e40c4b44046b86fb26b1abc2a4226229f4f494e54f21240cc96dea9106afded971829ec5873f507adab7c9
@@ -3,22 +3,42 @@
3
3
  # Registry for SASL authenticators used by Net::IMAP.
4
4
  module Net::IMAP::Authenticators
5
5
 
6
- # Adds an authenticator for use with Net::IMAP#authenticate. +auth_type+ is the
6
+ # Adds an authenticator for Net::IMAP#authenticate to use. +mechanism+ is the
7
7
  # {SASL mechanism}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
8
- # supported by +authenticator+ (for instance, "+PLAIN+"). The +authenticator+
9
- # is an object which defines a +#process+ method to handle authentication with
10
- # the server. See Net::IMAP::PlainAuthenticator, Net::IMAP::LoginAuthenticator,
11
- # Net::IMAP::CramMD5Authenticator, and Net::IMAP::DigestMD5Authenticator for
12
- # examples.
8
+ # implemented by +authenticator+ (for instance, <tt>"PLAIN"</tt>).
9
+ #
10
+ # The +authenticator+ must respond to +#new+ (or #call), receiving the
11
+ # authenticator configuration and return a configured authentication session.
12
+ # The authenticator session must respond to +#process+, receiving the server's
13
+ # challenge and returning the client's response.
13
14
  #
14
- # If +auth_type+ refers to an existing authenticator, it will be
15
- # replaced by the new one.
15
+ # See PlainAuthenticator, XOauth2Authenticator, and DigestMD5Authenticator for
16
+ # examples.
16
17
  def add_authenticator(auth_type, authenticator)
17
18
  authenticators[auth_type] = authenticator
18
19
  end
19
20
 
20
- # Builds an authenticator for Net::IMAP#authenticate. +args+ will be passed
21
- # directly to the chosen authenticator's +#initialize+.
21
+ # :call-seq:
22
+ # authenticator(mechanism, ...) -> authenticator
23
+ # authenticator(mech, *creds, **props) {|prop, auth| val } -> authenticator
24
+ # authenticator(mechanism, authnid, creds, authzid=nil) -> authenticator
25
+ # authenticator(mechanism, **properties) -> authenticator
26
+ # authenticator(mechanism) {|propname, authctx| value } -> authenticator
27
+ #
28
+ # Builds a new authentication session context for +mechanism+.
29
+ #
30
+ # [Note]
31
+ # This method is intended for internal use by connection protocol code only.
32
+ # Protocol client users should see refer to their client's documentation,
33
+ # e.g. Net::IMAP#authenticate for Net::IMAP.
34
+ #
35
+ # The call signatures documented for this method are recommendations for
36
+ # authenticator implementors. All arguments (other than +mechanism+) are
37
+ # forwarded to the registered authenticator's +#new+ (or +#call+) method, and
38
+ # each authenticator must document its own arguments.
39
+ #
40
+ # The returned object represents a single authentication exchange and <em>must
41
+ # not</em> be reused for multiple authentication attempts.
22
42
  def authenticator(mechanism, *authargs, **properties, &callback)
23
43
  authenticator = authenticators.fetch(mechanism.upcase) do
24
44
  raise ArgumentError, 'unknown auth type - "%s"' % mechanism
@@ -257,5 +257,6 @@ module Net
257
257
  # special use is likely not to be supported.
258
258
  TRASH = :Trash
259
259
 
260
+ # :section:
260
261
  end
261
262
  end
@@ -26,6 +26,9 @@ module Net::IMAP::SASL
26
26
  #
27
27
  # Also checks bidirectional characters, when <tt>bidi: true</tt>, which may
28
28
  # raise a BidiStringError.
29
+ #
30
+ # +profile+ is an optional string which will be added to any exception that
31
+ # is raised (it does not affect behavior).
29
32
  def check_prohibited!(string, *tables, bidi: false, profile: nil)
30
33
  tables = TABLE_TITLES.keys.grep(/^C/) if tables.empty?
31
34
  tables |= %w[C.8] if bidi
@@ -47,10 +50,11 @@ module Net::IMAP::SASL
47
50
  # RandALCat character MUST be the last character of the string.
48
51
  #
49
52
  # This is usually combined with #check_prohibited!, so table "C.8" is only
50
- # checked when +c_8: true+.
53
+ # checked when <tt>c_8: true</tt>.
51
54
  #
52
55
  # Raises either ProhibitedCodepoint or BidiStringError unless all
53
- # requirements are met.
56
+ # requirements are met. +profile+ is an optional string which will be
57
+ # added to any exception that is raised (it does not affect behavior).
54
58
  def check_bidi!(string, c_8: false, profile: nil)
55
59
  check_prohibited!(string, "C.8", profile: profile) if c_8
56
60
  if BIDI_FAILS_REQ2.match?(string)