omniauth-twitter2 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f46f460692cde04fdefa508e5ee2393ba6aa4e330987ea760c3cf9671c6015c6
4
- data.tar.gz: 83e8e366704f172d37c5d5dc005f4bcdbb1fb6f9d71b2ee79eac558e62cf9bd5
3
+ metadata.gz: b48323455ad42312548826f0ac3744440d158379a99da8be7eac364dceef0197
4
+ data.tar.gz: f6173a09259fb8e82ba02be3061dea0d57c426b749207a0b6d618c522c857047
5
5
  SHA512:
6
- metadata.gz: 280543b64cbeccc177c4bbecb9714b84d63e97da6abdd864cedcb90c6be6e147aeb6ad3847409a6a8c67456794270fa6e2e04b73b14c7425636805ca6eb44e02
7
- data.tar.gz: b634f91a0b28fc6d3bf1d5da2d2a78101bf5da8a070691da193c59c51d038cadb7fe172c603273ab08ae07f63b03fb987e8fbf8d8e8f175024965592e5967fc7
6
+ metadata.gz: 94d5e8d0597b524e9071f5171ddd8dc8dc2476fba13ba4d1d3455f84e839afbda25f58aa78827ed96ed939de6606b832564957bb30e3d5e8cdfcd0e75886bf54
7
+ data.tar.gz: c6a2a55f31c2fe8f246593979ead4f429a89f94b36ebd695dea0201429bdb8d8d0c3531ddffedb62a3d8677b201c15369b1ad278f85e905de2bcf7797e1f4d62
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-01-10
3
+ ## [1.0.0] - 2025-08-03
4
+
5
+ - Update api endpoints from `twitter.com` to `x.com` ([#7](https://github.com/unasuke/omniauth-twitter2/pull/7))
6
+
7
+ ## [0.1.0] - 2022-01-13
4
8
 
5
9
  - Initial release
data/Gemfile CHANGED
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in omniauth-twitter2.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
11
-
12
- gem "rubocop", "~> 1.21"
8
+ gem "minitest"
9
+ gem "rake"
10
+ gem "rubocop"
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # OmniAuth::Twitter2
2
+ [![test](https://github.com/unasuke/omniauth-twitter2/actions/workflows/main.yml/badge.svg)](https://github.com/unasuke/omniauth-twitter2/actions/workflows/main.yml)
3
+ [![GitHub license](https://img.shields.io/github/license/unasuke/omniauth-twitter2)](https://github.com/unasuke/omniauth-twitter2/blob/main/LICENSE.txt)
4
+ [![Gem Version](https://badge.fury.io/rb/omniauth-twitter2.svg)](https://rubygems.org/gems/omniauth-twitter2)
2
5
 
3
6
  This gem provides a OmniAuth strategy for authenticating with Twitter OAuth2.
4
7
 
@@ -30,7 +33,7 @@ $ gem install omniauth-twitter2
30
33
  ```ruby
31
34
  # config/initializers/omniauth.rb
32
35
  Rails.application.config.middleware.use OmniAuth::Builder do
33
- provider :twitter2, ENV["TWITTER_API_KEY"], ENV["TWITTER_API_SECRET"], callback_path: '/auth/twitter2/callback', scope: "tweet.read users.read"
36
+ provider :twitter2, ENV["TWITTER_CLIENT_ID"], ENV["TWITTER_CLIENT_SECRET"], callback_path: '/auth/twitter2/callback', scope: "tweet.read users.read"
34
37
  end
35
38
  ```
36
39
 
@@ -47,7 +50,7 @@ end
47
50
  "image" => "https://pbs.twimg.com/profile_images/580019517608218624/KzEZSzUy_normal.jpg",
48
51
  "urls" => {
49
52
  "Website" => "https://t.co/NCFLB8wDkx",
50
- "Twitter" => "https://twitter.com/yu_suke1994"
53
+ "Twitter" => "https://x.com/yu_suke1994"
51
54
  }
52
55
  },
53
56
  "credentials" => {
@@ -98,12 +101,16 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
98
101
  ## References
99
102
 
100
103
  * Twitter official resources
101
- * [twitterdev/Twitter-API-v2-sample-code: Sample code for the Twitter API v2 endpoints](https://github.com/twitterdev/Twitter-API-v2-sample-code)
102
- * [OAuth 2.0 Making requests on behalf of users | Docs | Twitter Developer Platform](https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token)
104
+ * [xdevplatform/Twitter-API-v2-sample-code: Sample code for the Twitter API v2 endpoints](https://github.com/xdevplatform/Twitter-API-v2-sample-code)
105
+ * [OAuth 2.0 - X](https://docs.x.com/fundamentals/authentication/oauth-2-0/overview)
103
106
  * [arunagw/omniauth-twitter: OmniAuth strategy for Twitter](https://github.com/arunagw/omniauth-twitter)
104
107
  * [omniauth/omniauth-oauth2: An abstract OAuth2 strategy for OmniAuth.](https://github.com/omniauth/omniauth-oauth2)
105
108
  * [nov/twitter_oauth2: Twitter OAuth 2.0 Client Library in Ruby](https://github.com/nov/twitter_oauth2)
106
109
 
110
+ ## Sample App
111
+ * <https://twitter-login-app.onrender.com/>
112
+ * <https://github.com/unasuke/twitter-login-app>
113
+
107
114
  ## Contributing
108
115
 
109
116
  Bug reports and pull requests are welcome on GitHub at https://github.com/unasuke/omniauth-twitter2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/unasuke/omniauth-twitter2/blob/main/CODE_OF_CONDUCT.md).
@@ -7,10 +7,11 @@ module OmniAuth
7
7
  module Strategies
8
8
  class Twitter2 < OmniAuth::Strategies::OAuth2 # :nodoc:
9
9
  option :name, "twitter2"
10
+ # https://docs.x.com/fundamentals/authentication/oauth-2-0/overview
10
11
  option :client_options, {
11
- site: "https://api.twitter.com",
12
+ site: "https://api.x.com",
12
13
  token_url: "2/oauth2/token",
13
- authorize_url: "https://twitter.com/i/oauth2/authorize"
14
+ authorize_url: "https://x.com/i/oauth2/authorize"
14
15
  }
15
16
  option :pkce, true
16
17
 
@@ -25,7 +26,7 @@ module OmniAuth
25
26
  image: raw_info["data"]["profile_image_url"],
26
27
  urls: {
27
28
  Website: raw_info["data"]["url"],
28
- Twitter: "https://twitter.com/#{raw_info["data"]["username"]}"
29
+ Twitter: "https://x.com/#{raw_info["data"]["username"]}"
29
30
  }
30
31
  }
31
32
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Twitter2
5
- VERSION = "0.1.0"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
19
- # spec.metadata["changelog_uri"] = "TBA"
19
+ spec.metadata["changelog_uri"] = "https://github.com/unasuke/omniauth-twitter2/blob/main/CHANGELOG.md"
20
20
  spec.metadata["rubygems_mfa_required"] = "true"
21
21
 
22
22
  # Specify which files should be added to the gem when it is released.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-twitter2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Nakamura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
10
+ date: 2025-08-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: omniauth
@@ -46,10 +45,10 @@ extensions: []
46
45
  extra_rdoc_files: []
47
46
  files:
48
47
  - ".rubocop.yml"
48
+ - ".ruby-version"
49
49
  - CHANGELOG.md
50
50
  - CODE_OF_CONDUCT.md
51
51
  - Gemfile
52
- - Gemfile.lock
53
52
  - LICENSE.txt
54
53
  - README.md
55
54
  - Rakefile
@@ -66,8 +65,8 @@ licenses:
66
65
  metadata:
67
66
  homepage_uri: https://github.com/unasuke/omniauth-twitter2
68
67
  source_code_uri: https://github.com/unasuke/omniauth-twitter2
68
+ changelog_uri: https://github.com/unasuke/omniauth-twitter2/blob/main/CHANGELOG.md
69
69
  rubygems_mfa_required: 'true'
70
- post_install_message:
71
70
  rdoc_options: []
72
71
  require_paths:
73
72
  - lib
@@ -82,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
81
  - !ruby/object:Gem::Version
83
82
  version: '0'
84
83
  requirements: []
85
- rubygems_version: 3.2.22
86
- signing_key:
84
+ rubygems_version: 3.6.2
87
85
  specification_version: 4
88
86
  summary: Twitter OAuth2 strategy for OmniAuth
89
87
  test_files: []
data/Gemfile.lock DELETED
@@ -1,89 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- omniauth-twitter2 (0.1.0)
5
- omniauth
6
- omniauth-oauth2 (~> 1.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.2)
12
- faraday (1.9.3)
13
- faraday-em_http (~> 1.0)
14
- faraday-em_synchrony (~> 1.0)
15
- faraday-excon (~> 1.1)
16
- faraday-httpclient (~> 1.0)
17
- faraday-multipart (~> 1.0)
18
- faraday-net_http (~> 1.0)
19
- faraday-net_http_persistent (~> 1.0)
20
- faraday-patron (~> 1.0)
21
- faraday-rack (~> 1.0)
22
- faraday-retry (~> 1.0)
23
- ruby2_keywords (>= 0.0.4)
24
- faraday-em_http (1.0.0)
25
- faraday-em_synchrony (1.0.0)
26
- faraday-excon (1.1.0)
27
- faraday-httpclient (1.0.1)
28
- faraday-multipart (1.0.3)
29
- multipart-post (>= 1.2, < 3)
30
- faraday-net_http (1.0.1)
31
- faraday-net_http_persistent (1.2.0)
32
- faraday-patron (1.0.0)
33
- faraday-rack (1.0.0)
34
- faraday-retry (1.0.3)
35
- hashie (5.0.0)
36
- jwt (2.3.0)
37
- minitest (5.15.0)
38
- multi_json (1.15.0)
39
- multi_xml (0.6.0)
40
- multipart-post (2.1.1)
41
- oauth2 (1.4.7)
42
- faraday (>= 0.8, < 2.0)
43
- jwt (>= 1.0, < 3.0)
44
- multi_json (~> 1.3)
45
- multi_xml (~> 0.5)
46
- rack (>= 1.2, < 3)
47
- omniauth (2.0.4)
48
- hashie (>= 3.4.6)
49
- rack (>= 1.6.2, < 3)
50
- rack-protection
51
- omniauth-oauth2 (1.7.2)
52
- oauth2 (~> 1.4)
53
- omniauth (>= 1.9, < 3)
54
- parallel (1.21.0)
55
- parser (3.1.0.0)
56
- ast (~> 2.4.1)
57
- rack (2.2.3)
58
- rack-protection (2.1.0)
59
- rack
60
- rainbow (3.0.0)
61
- rake (13.0.6)
62
- regexp_parser (2.2.0)
63
- rexml (3.2.5)
64
- rubocop (1.24.1)
65
- parallel (~> 1.10)
66
- parser (>= 3.0.0.0)
67
- rainbow (>= 2.2.2, < 4.0)
68
- regexp_parser (>= 1.8, < 3.0)
69
- rexml
70
- rubocop-ast (>= 1.15.1, < 2.0)
71
- ruby-progressbar (~> 1.7)
72
- unicode-display_width (>= 1.4.0, < 3.0)
73
- rubocop-ast (1.15.1)
74
- parser (>= 3.0.1.1)
75
- ruby-progressbar (1.11.0)
76
- ruby2_keywords (0.0.5)
77
- unicode-display_width (2.1.0)
78
-
79
- PLATFORMS
80
- x86_64-linux
81
-
82
- DEPENDENCIES
83
- minitest (~> 5.0)
84
- omniauth-twitter2!
85
- rake (~> 13.0)
86
- rubocop (~> 1.21)
87
-
88
- BUNDLED WITH
89
- 2.3.4