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 +4 -4
- data/README.md +1 -2
- data/lib/net/imap/authenticators/xoauth2.rb +20 -0
- data/lib/net/imap/authenticators.rb +1 -0
- data/lib/net/imap.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a032f39f4325733e1c68595d730ae6eafe48702fd416480cfe37a0082f3ec340
|
4
|
+
data.tar.gz: e7f0d60f53ed135dea9f1262814902735c537adc97198c1284f32cf4e599da8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/net/imap.rb
CHANGED
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.
|
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-
|
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
|