omniauth-twitchtv2 1.0.2 → 1.0.4

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: 567329f384848763a47bcd4c71509434544212a294656eb520fff9574178dd0c
4
- data.tar.gz: 3aee9529f2cffc81c67d1bc743993f7ed4485c32dbb903aeafbc71a9e6046d38
3
+ metadata.gz: 376b53f87af9c76da1099d614bba912b3f7d3642dc40e8837789977adaa15734
4
+ data.tar.gz: fd652cd3f043a6474c9c84ba957a06110ed0fb78b9b94573436d903b6f14f82d
5
5
  SHA512:
6
- metadata.gz: e4387d4e0bcd27638feee22e53403d48b3fc285a8f053971f8a16e354f777bc82c96e4dec968b89d27ef96d61a20ee9948417b0e17d3a2e8ee9d4f6cfcaeb0f5
7
- data.tar.gz: 3ea15c29e420eabe8bb1a51cbe13f88418784f313f55ce9a2819331d337d293d54dba72c5cd771faf6f1279364f9443509ad044d6d54969d7196959caacb8502
6
+ metadata.gz: dfae4ba08f4cc920fc5559bce0934f1ea7b521f71c8a1251aeb8d61b31a0f17b88f71c051caaa70747107e22e64562042dfd2764bef8dcaa23ecf84afb609589
7
+ data.tar.gz: 326c77e3df3c166d13526fb194a776c4f778ce39bda5b54423a62a61893013cb8a2f02f32a0797a1af543aaa277be1e0687634ff7850e536fbbba0b16b7838b7
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # OmniAuth Twitchtv2 Strategy
1
+ # OmniAuth Twitch Strategy
2
2
 
3
3
  [![Test](https://github.com/icoretech/omniauth-twitchtv2/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/icoretech/omniauth-twitchtv2/actions/workflows/test.yml?query=branch%3Amain)
4
- [![Gem Version](https://img.shields.io/gem/v/omniauth-twitchtv2.svg)](https://rubygems.org/gems/omniauth-twitchtv2)
4
+ [![Gem Version](https://badge.fury.io/rb/omniauth-twitchtv2.svg)](https://badge.fury.io/rb/omniauth-twitchtv2)
5
5
 
6
6
  `omniauth-twitchtv2` provides a Twitch OAuth2 strategy for OmniAuth.
7
7
 
@@ -110,7 +110,7 @@ RAILS_VERSION='~> 8.1.0' bundle exec rake test_rails_integration
110
110
  ## Compatibility
111
111
 
112
112
  - Ruby: `>= 3.2` (tested on `3.2`, `3.3`, `3.4`, `4.0`)
113
- - `omniauth-oauth2`: `>= 1.8`, `< 1.9`
113
+ - `omniauth-oauth2`: `>= 1.8`, `< 2.0`
114
114
  - Rails integration lanes: `~> 7.1.0`, `~> 7.2.0`, `~> 8.0.0`, `~> 8.1.0`
115
115
 
116
116
  ## Release
@@ -1,67 +1,67 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth-oauth2'
3
+ require "omniauth-oauth2"
4
4
 
5
5
  module OmniAuth
6
6
  module Strategies
7
7
  # OmniAuth strategy for Twitch OAuth2.
8
8
  class Twitchtv < OmniAuth::Strategies::OAuth2
9
- option :name, 'twitchtv'
9
+ option :name, "twitchtv"
10
10
 
11
11
  option :client_options,
12
- site: 'https://api.twitch.tv',
13
- authorize_url: 'https://id.twitch.tv/oauth2/authorize',
14
- token_url: 'https://id.twitch.tv/oauth2/token',
15
- auth_scheme: :request_body,
16
- connection_opts: {
17
- headers: {
18
- user_agent: 'icoretech-omniauth-twitchtv2 gem',
19
- accept: 'application/json',
20
- content_type: 'application/json'
21
- }
22
- }
12
+ site: "https://api.twitch.tv",
13
+ authorize_url: "https://id.twitch.tv/oauth2/authorize",
14
+ token_url: "https://id.twitch.tv/oauth2/token",
15
+ auth_scheme: :request_body,
16
+ connection_opts: {
17
+ headers: {
18
+ user_agent: "icoretech-omniauth-twitchtv2 gem",
19
+ accept: "application/json",
20
+ content_type: "application/json"
21
+ }
22
+ }
23
23
 
24
24
  option :authorize_options, %i[scope force_verify]
25
25
 
26
- uid { raw_info['id'].to_s }
26
+ uid { raw_info["id"].to_s }
27
27
 
28
28
  info do
29
29
  {
30
- name: raw_info['display_name'] || raw_info['login'],
31
- nickname: raw_info['login'],
32
- email: raw_info['email'],
33
- image: raw_info['profile_image_url'],
34
- description: blank_to_nil(raw_info['description']),
35
- urls: profile_url ? { twitchtv: profile_url } : nil
30
+ name: raw_info["display_name"] || raw_info["login"],
31
+ nickname: raw_info["login"],
32
+ email: raw_info["email"],
33
+ image: raw_info["profile_image_url"],
34
+ description: blank_to_nil(raw_info["description"]),
35
+ urls: profile_url ? {twitchtv: profile_url} : nil
36
36
  }.compact
37
37
  end
38
38
 
39
39
  credentials do
40
40
  {
41
- 'token' => access_token.token,
42
- 'refresh_token' => access_token.refresh_token,
43
- 'expires_at' => access_token.expires_at,
44
- 'expires' => access_token.expires?,
45
- 'scope' => token_scope
41
+ "token" => access_token.token,
42
+ "refresh_token" => access_token.refresh_token,
43
+ "expires_at" => access_token.expires_at,
44
+ "expires" => access_token.expires?,
45
+ "scope" => token_scope
46
46
  }.compact
47
47
  end
48
48
 
49
49
  extra do
50
50
  {
51
- 'raw_info' => raw_info
51
+ "raw_info" => raw_info
52
52
  }
53
53
  end
54
54
 
55
55
  def raw_info
56
56
  @raw_info ||= begin
57
- response = access_token.get('helix/users', headers: { 'Client-Id' => options.client_id })
58
- users = response.parsed.fetch('data', [])
57
+ response = access_token.get("helix/users", headers: {"Client-Id" => options.client_id})
58
+ users = response.parsed.fetch("data", [])
59
59
  users.first || {}
60
60
  end
61
61
  end
62
62
 
63
63
  def profile_url
64
- login = raw_info['login']
64
+ login = raw_info["login"]
65
65
  return nil if login.to_s.empty?
66
66
 
67
67
  "https://www.twitch.tv/#{login}"
@@ -74,7 +74,7 @@ module OmniAuth
74
74
 
75
75
  # Prevent authorization response params from being appended to redirect_uri.
76
76
  def query_string
77
- return '' if request.params['code']
77
+ return "" if request.params["code"]
78
78
 
79
79
  super
80
80
  end
@@ -83,7 +83,7 @@ module OmniAuth
83
83
 
84
84
  def token_scope
85
85
  token_params = access_token.respond_to?(:params) ? access_token.params : {}
86
- token_params['scope'] || (access_token['scope'] if access_token.respond_to?(:[]))
86
+ token_params["scope"] || (access_token["scope"] if access_token.respond_to?(:[]))
87
87
  end
88
88
 
89
89
  def blank_to_nil(value)
@@ -97,4 +97,4 @@ module OmniAuth
97
97
  end
98
98
  end
99
99
 
100
- OmniAuth.config.add_camelization 'twitchtv', 'Twitchtv'
100
+ OmniAuth.config.add_camelization "twitchtv", "Twitchtv"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Twitchtv2
5
- VERSION = '1.0.2'
5
+ VERSION = "1.0.4"
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/twitchtv2/version'
4
- require 'omniauth/strategies/twitchtv'
3
+ require "omniauth/twitchtv2/version"
4
+ require "omniauth/strategies/twitchtv"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth-twitchtv2/version'
3
+ require "omniauth-twitchtv2/version"
4
4
 
5
5
  module Omniauth
6
6
  module Twitchtv
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth-twitchtv2'
3
+ require "omniauth-twitchtv2"
4
4
 
5
5
  module Omniauth
6
6
  module Twitchtv
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/twitchtv2/version'
3
+ require "omniauth/twitchtv2/version"
4
4
 
5
5
  # Backward compatibility for historical constant usage.
6
6
  module Omniauth
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/twitchtv2'
3
+ require "omniauth/twitchtv2"
@@ -1,34 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'omniauth/twitchtv2/version'
5
+ require "omniauth/twitchtv2/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'omniauth-twitchtv2'
8
+ spec.name = "omniauth-twitchtv2"
9
9
  spec.version = OmniAuth::Twitchtv2::VERSION
10
- spec.authors = ['Claudio Poli']
11
- spec.email = ['masterkain@gmail.com']
10
+ spec.authors = ["Claudio Poli"]
11
+ spec.email = ["masterkain@gmail.com"]
12
12
 
13
- spec.summary = 'OmniAuth strategy for Twitch OAuth2 authentication.'
14
- spec.description = 'OAuth2 strategy for OmniAuth that authenticates users with Twitch and exposes account metadata.'
15
- spec.homepage = 'https://github.com/icoretech/omniauth-twitchtv2'
16
- spec.license = 'MIT'
17
- spec.required_ruby_version = '>= 3.2'
13
+ spec.summary = "OmniAuth strategy for Twitch OAuth2 authentication."
14
+ spec.description = "OAuth2 strategy for OmniAuth that authenticates users with Twitch and exposes account metadata."
15
+ spec.homepage = "https://github.com/icoretech/omniauth-twitchtv2"
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = ">= 3.2"
18
18
 
19
- spec.metadata['source_code_uri'] = 'https://github.com/icoretech/omniauth-twitchtv2'
20
- spec.metadata['bug_tracker_uri'] = 'https://github.com/icoretech/omniauth-twitchtv2/issues'
21
- spec.metadata['changelog_uri'] = 'https://github.com/icoretech/omniauth-twitchtv2/releases'
22
- spec.metadata['rubygems_mfa_required'] = 'true'
19
+ spec.metadata["source_code_uri"] = "https://github.com/icoretech/omniauth-twitchtv2"
20
+ spec.metadata["bug_tracker_uri"] = "https://github.com/icoretech/omniauth-twitchtv2/issues"
21
+ spec.metadata["changelog_uri"] = "https://github.com/icoretech/omniauth-twitchtv2/releases"
22
+ spec.metadata["rubygems_mfa_required"] = "true"
23
23
 
24
24
  spec.files = Dir[
25
- 'lib/**/*.rb',
26
- 'README*',
27
- 'LICENSE*',
28
- '*.gemspec'
25
+ "lib/**/*.rb",
26
+ "README*",
27
+ "LICENSE*",
28
+ "*.gemspec"
29
29
  ]
30
- spec.require_paths = ['lib']
30
+ spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency 'cgi', '>= 0.3.6'
33
- spec.add_dependency 'omniauth-oauth2', '>= 1.8', '< 1.9'
32
+ spec.add_dependency "cgi", ">= 0.3.6"
33
+ spec.add_dependency "omniauth-oauth2", ">= 1.8", "< 2.0"
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-twitchtv2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '1.8'
33
33
  - - "<"
34
34
  - !ruby/object:Gem::Version
35
- version: '1.9'
35
+ version: '2.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '1.8'
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
- version: '1.9'
45
+ version: '2.0'
46
46
  description: OAuth2 strategy for OmniAuth that authenticates users with Twitch and
47
47
  exposes account metadata.
48
48
  email: