net-imap 0.3.0 → 0.3.1

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: a91d908ae16db12c507a6cf5c0e5eef57e18c97473b2a13a0ab14cf655e9bcb7
4
- data.tar.gz: 1bdab36cf0779d14e2f414e00aee90d95d2584bfc8d591c11d5104b4071bebb8
3
+ metadata.gz: a032f39f4325733e1c68595d730ae6eafe48702fd416480cfe37a0082f3ec340
4
+ data.tar.gz: e7f0d60f53ed135dea9f1262814902735c537adc97198c1284f32cf4e599da8b
5
5
  SHA512:
6
- metadata.gz: 65133026b0746efbdc55a64bd1091da0524e5b922672767f334cec1d0357b31b973380bc8e787ff2430b831375f52050004d718b6308fa9203c9f6710ac2444b
7
- data.tar.gz: 7e5e9fcac352549585e38b5a86b0198cc1c5996ad129cf9e53ca92f2ef63ea4b37d26ab8c5efd641b19711b2ea04e42622ead203c3afcaa8d420ceaaaa9893c8
6
+ metadata.gz: 65d363c721fec3061313cdbe6a4746612699cf296a6434853b14c66d850cbd843389ccf8f88b77e658c966be1d9692324b03e0c4b0074acac8595795bda456ce
7
+ data.tar.gz: 03c8152b9fbd734ca4d5c1e6301a7d2c09bd3da1b5b5e937ce0b7c141ba7bce9f6ab3d4f291b6a4467dc88fdb02b1996579f9e404f3cd9f9d81b7eb69597609e
data/README.md CHANGED
@@ -51,11 +51,10 @@ imap.expunge
51
51
 
52
52
  ## Development
53
53
 
54
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
54
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
55
 
56
56
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
57
57
 
58
58
  ## Contributing
59
59
 
60
60
  Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/net-imap.
61
-
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Net::IMAP::XOauth2Authenticator
4
+ def process(_data)
5
+ build_oauth2_string(@user, @oauth2_token)
6
+ end
7
+
8
+ private
9
+
10
+ def initialize(user, oauth2_token)
11
+ @user = user
12
+ @oauth2_token = oauth2_token
13
+ end
14
+
15
+ def build_oauth2_string(user, oauth2_token)
16
+ format("user=%s\1auth=Bearer %s\1\1", user, oauth2_token)
17
+ end
18
+
19
+ Net::IMAP.add_authenticator 'XOAUTH2', self
20
+ end
@@ -45,3 +45,4 @@ require_relative "authenticators/plain"
45
45
  require_relative "authenticators/login"
46
46
  require_relative "authenticators/cram_md5"
47
47
  require_relative "authenticators/digest_md5"
48
+ require_relative "authenticators/xoauth2"
data/lib/net/imap.rb CHANGED
@@ -220,7 +220,7 @@ module Net
220
220
  # Unicode", RFC-2152[https://tools.ietf.org/html/rfc2152], May 1997.
221
221
  #
222
222
  class IMAP < Protocol
223
- VERSION = "0.3.0"
223
+ VERSION = "0.3.1"
224
224
 
225
225
  include MonitorMixin
226
226
  if defined?(OpenSSL::SSL)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-imap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-09-28 00:00:00.000000000 Z
12
+ date: 2022-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-protocol
@@ -74,6 +74,7 @@ files:
74
74
  - lib/net/imap/authenticators/digest_md5.rb
75
75
  - lib/net/imap/authenticators/login.rb
76
76
  - lib/net/imap/authenticators/plain.rb
77
+ - lib/net/imap/authenticators/xoauth2.rb
77
78
  - lib/net/imap/command_data.rb
78
79
  - lib/net/imap/data_encoding.rb
79
80
  - lib/net/imap/errors.rb