net-imap 0.3.3 → 0.3.5

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: '089cd0567b2a11a7de9343e693481902eca127a4274a6fc3b6cec5e44d2ee333'
4
+ data.tar.gz: fae6680c26f1279ae1bca5b5561d65eafc06c688c9102be885f49b0520f2a852
5
5
  SHA512:
6
- metadata.gz: de02b12debf1989068fd4df18b074513d7c1fe8744915453a6491633a1d64222b1f1c2eb1f6c2ced6d1b3cddac0b32faf7dc882cd25082ea322656c488539d32
7
- data.tar.gz: b25e3dd246cf6f8b4ae1b0fc71c0c1e853f437cc41fd9b31e74516e8c272c73f4fb4228e4adf9fca54c90db7d5b7db93ee914427637968557bbd7ec750ee444f
6
+ metadata.gz: 9dded5abb87e2ea4b9c82b7f50c141acb6d3affe4f93f6dfd26beb6309fdd111c1ab93adc31fefdac4a0fef3cb4e5f6eda29f179c602c2a0fc7cd389ae832861
7
+ data.tar.gz: fe3b168f4f6a5807d63499e0ae8b0e507ad950e2c22eadcb9dc55e10df79da5618889047ef6fcebf0a3fdce06b3aac78f123340832a93fe02a82326344d4316b
@@ -3,11 +3,18 @@ name: ubuntu
3
3
  on: [push, pull_request]
4
4
 
5
5
  jobs:
6
+ ruby-versions:
7
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
8
+ with:
9
+ engine: cruby
10
+ min_version: 2.6
11
+
6
12
  build:
13
+ needs: ruby-versions
7
14
  name: build (${{ matrix.ruby }} / ${{ matrix.os }})
8
15
  strategy:
9
16
  matrix:
10
- ruby: [ head, '3.1', '3.0', '2.7' ]
17
+ ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
11
18
  os: [ ubuntu-latest, macos-latest ]
12
19
  experimental: [false]
13
20
  include:
@@ -7,7 +7,7 @@ class Net::IMAP::XOauth2Authenticator
7
7
 
8
8
  private
9
9
 
10
- def initialize(user, oauth2_token)
10
+ def initialize(user, oauth2_token, **_)
11
11
  @user = user
12
12
  @oauth2_token = oauth2_token
13
13
  end
@@ -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
@@ -54,9 +54,9 @@ module Net
54
54
  # Net::IMAP does _not_ automatically encode and decode
55
55
  # mailbox names to and from UTF-7.
56
56
  def self.decode_utf7(s)
57
- return s.gsub(/&([^-]+)?-/n) {
58
- if $1
59
- ($1.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
57
+ return s.gsub(/&([A-Za-z0-9+,]+)?-/n) {
58
+ if base64 = $1
59
+ (base64.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
60
60
  else
61
61
  "&"
62
62
  end
@@ -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)