omniauth-lastfm 0.0.7 → 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
- SHA1:
3
- metadata.gz: b07f9ad5a90f0a7f58cd0e15d09048a6231f3328
4
- data.tar.gz: b1dd8d1d26447a9971025807c31a056d25a672c5
2
+ SHA256:
3
+ metadata.gz: 3cdb8db563f4d292809cac2b172e00397ff84f65d1949180d784419fd295a497
4
+ data.tar.gz: dc7bcb6f66cc566c4e24760531f75f979e245d986ee0b4db97196abd4f5b8e44
5
5
  SHA512:
6
- metadata.gz: 15f2b494004cbffc848151151bfff76cf272f7878991ab71dd104b9e42dbf85ce05449d17d2d666d01dc7160a25bc4b2e6f9f695af34f673a5a733f698f0a225
7
- data.tar.gz: 0d6bd0cfe25348949e2d58ddc90eb5204e81b47ecd64c8a90a3b98a6efea03183483252cdfe3928fab63ff761932c953e58922599d77dcef0c43e32de4184e53
6
+ metadata.gz: 1325f12025055577d2bbc9910d0aeb8d4bd89dcccc7a838a978bf7941f8263cc0a9b43675c508225e11b815d12abf24fedff200eafe3462eed2d2b21763178c8
7
+ data.tar.gz: 0f2b37aa0b4dcebd201ab1f8ec970f1738b81e81df3e2ed8e9a1e9d4527b7687c03507aafa31094dd3a886763c6865f4f296a53a50d0fb9ec9b34b37eb1f7751
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Claudio Poli
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,89 +1,82 @@
1
- OmniAuth Last.fm
2
- ================
3
-
4
- Last.fm strategy for OmniAuth 1.0.
5
-
6
- Installing
7
- ----------
8
- Add to your Gemfile:
9
-
10
- gem 'omniauth'
11
- gem 'omniauth-lastfm'
12
-
13
- Then `bundle install`.
14
-
15
- Usage
16
- -----
17
- You'll need an API account with Last.fm, you can get one here - http://www.last.fm/api.
18
-
19
- Usage of the gem is very similar to other OmniAuth 1.0 strategies. You'll need to add your API keys to `config/initializers/omniauth.rb`:
20
-
21
- Rails.application.config.middleware.use OmniAuth::Builder do
22
- provider :lastfm, "consumer_key", "consumer_secret"
23
- end
24
-
25
- Now simply follow the README at: https://github.com/intridea/omniauth.
26
-
27
- Auth Hash Schema
28
- ----------------
29
- Here's an example auth hash, available in `request.env['omniauth.auth']`:
30
-
31
- {
32
- "provider": "lastfm",
33
- "uid": "ripuk",
34
- "info": {
35
- "nickname": "ripuk",
36
- "name": "David Stephens",
37
- "url": "http://www.last.fm/user/ripuk",
38
- "image": "http://userserve-ak.last.fm/serve/252/46787679.jpg",
39
- "country": "UK",
40
- "age": "31",
41
- "gender": "m"
42
- },
43
- "credentials": {
44
- "token": "abcdefghijklmnop",
45
- "name": "ripuk"
46
- },
47
- "extra": {
48
- "raw_info": {
49
- "name": "ripuk",
50
- "realname": "David Stephens",
51
- "image": [
52
- {
53
- "#text": "http://userserve-ak.last.fm/serve/34/46787679.jpg",
54
- "size": "small"
55
- },
56
- {
57
- "#text": "http://userserve-ak.last.fm/serve/64/46787679.jpg",
58
- "size": "medium"
59
- },
60
- {
61
- "#text": "http://userserve-ak.last.fm/serve/126/46787679.jpg",
62
- "size": "large"
63
- },
64
- {
65
- "#text": "http://userserve-ak.last.fm/serve/252/46787679.jpg",
66
- "size": "extralarge"
67
- }
68
- ],
69
- "url": "http://www.last.fm/user/ripuk",
70
- "id": "25400308",
71
- "country": "UK",
72
- "age": "31",
73
- "gender": "m",
74
- "subscriber": "0",
75
- "playcount": "11530",
76
- "playlists": "0",
77
- "bootstrap": "0",
78
- "registered": {
79
- "#text": "2009-12-30 00:53",
80
- "unixtime": "1262134389"
81
- },
82
- "type": "user"
83
- }
84
- }
85
- }
86
-
87
- What Next?
88
- ----------
89
- The [Rockstar Gem](https://github.com/putpat/rockstar) is a great way to make use of the auth token retrieved with this gem.
1
+ # OmniAuth Last.fm
2
+
3
+ [![Test](https://github.com/icoretech/omniauth-lastfm/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/icoretech/omniauth-lastfm/actions/workflows/test.yml)
4
+ [![Gem Version](https://img.shields.io/gem/v/omniauth-lastfm.svg)](https://rubygems.org/gems/omniauth-lastfm)
5
+
6
+ `omniauth-lastfm` is an OmniAuth strategy for authenticating with Last.fm.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'omniauth-lastfm'
14
+ ```
15
+
16
+ Then run:
17
+
18
+ ```bash
19
+ bundle install
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ Configure OmniAuth in your initializer:
25
+
26
+ ```ruby
27
+ Rails.application.config.middleware.use OmniAuth::Builder do
28
+ provider :lastfm, ENV.fetch('LASTFM_API_KEY'), ENV.fetch('LASTFM_SECRET_KEY')
29
+ end
30
+ ```
31
+
32
+ Set callback URL in the Last.fm API application settings:
33
+
34
+ - `https://your-app.example.com/auth/lastfm/callback`
35
+
36
+ ## Auth Hash
37
+
38
+ Example payload available in `request.env['omniauth.auth']`:
39
+
40
+ ```json
41
+ {
42
+ "provider": "lastfm",
43
+ "uid": "ripuk",
44
+ "info": {
45
+ "nickname": "ripuk",
46
+ "name": "David Stephens",
47
+ "url": "https://www.last.fm/user/ripuk",
48
+ "image": "https://lastfm.freetls.fastly.net/i/u/300x300/abcdef.jpg",
49
+ "country": "UK",
50
+ "age": "31",
51
+ "gender": "m"
52
+ },
53
+ "credentials": {
54
+ "token": "abcdefghijklmnop",
55
+ "name": "ripuk"
56
+ },
57
+ "extra": {
58
+ "raw_info": {
59
+ "name": "ripuk"
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ## Development
66
+
67
+ Run lint and unit tests:
68
+
69
+ ```bash
70
+ bundle exec rake
71
+ ```
72
+
73
+ Run Rails integration tests explicitly:
74
+
75
+ ```bash
76
+ RAILS_VERSION='~> 7.2.0' bundle exec rake test_rails_integration
77
+ ```
78
+
79
+ ## Tested Matrix
80
+
81
+ - Ruby: 3.2, 3.3, 3.4, 4.0
82
+ - Rails integration: 7.1, 7.2, 8.0, 8.1
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniAuth
4
+ module Lastfm
5
+ VERSION = '1.0.0'
6
+ end
7
+ end
@@ -1,93 +1,167 @@
1
- require "multi_json"
2
- require "oauth"
3
- require "omniauth"
4
- require "rest-client"
1
+ # frozen_string_literal: true
2
+
3
+ require 'digest/md5'
4
+ require 'json'
5
+ require 'net/http'
6
+ require 'omniauth'
7
+ require 'uri'
5
8
 
6
9
  module OmniAuth
7
10
  module Strategies
11
+ # OmniAuth strategy for Last.fm authentication.
8
12
  class Lastfm
9
13
  include OmniAuth::Strategy
10
14
 
11
- args [:api_key, :secret_key]
15
+ args %i[api_key secret_key]
16
+
17
+ option :name, 'lastfm'
12
18
  option :api_key, nil
13
19
  option :secret_key, nil
14
- option :name, "lastfm"
15
- option :client_options, {
16
- :authorize_path => "/api/auth",
17
- :site => "http://www.last.fm",
18
- :api_url => "http://ws.audioscrobbler.com/2.0/",
19
- }
20
+ option :api_timeout, 10
21
+ option :client_options,
22
+ site: 'https://www.last.fm',
23
+ authorize_path: '/api/auth',
24
+ api_url: 'https://ws.audioscrobbler.com/2.0/',
25
+ user_agent: 'icoretech-omniauth-lastfm gem'
20
26
 
21
- attr_reader :json
27
+ uid { session_data['name'] }
22
28
 
23
- def request_phase
24
- params = {
25
- :api_key => options.api_key,
26
- :cb => options.client_options["callback"]
29
+ info do
30
+ {
31
+ nickname: user_data['name'],
32
+ name: user_data['realname'],
33
+ url: user_data['url'],
34
+ image: image_url(user_data['image']),
35
+ country: user_data['country'],
36
+ age: user_data['age'],
37
+ gender: user_data['gender']
38
+ }.compact
39
+ end
40
+
41
+ extra do
42
+ {
43
+ 'raw_info' => user_data
27
44
  }
28
- query_string = params.map{ |key,value| "#{key}=#{value}" }.join("&")
29
- redirect "#{options.client_options.site}#{options.client_options.authorize_path}/?#{query_string}"
45
+ end
46
+
47
+ credentials do
48
+ {
49
+ token: session_data['key'],
50
+ name: session_data['name']
51
+ }.compact
52
+ end
53
+
54
+ def request_phase
55
+ authorize_url = "#{options.client_options.site}#{options.client_options.authorize_path}"
56
+ query_string = URI.encode_www_form(request_phase_params)
57
+ redirect("#{authorize_url}?#{query_string}")
58
+ end
59
+
60
+ def callback_url
61
+ options[:callback_url] || super
30
62
  end
31
63
 
32
64
  def callback_phase
33
- @json = {}
34
- token = request.params["token"]
35
- begin
36
- params = { :api_key => options.api_key,
37
- :token => token,
38
- :api_sig => signature(token),
39
- :method => "auth.getSession",
40
- :format => 'json'}
41
- response = RestClient.get(options.client_options.api_url, { :params => params })
42
- session = MultiJson.decode(response.to_s)
43
- @json.merge!(session)
44
-
45
- params = {:api_key => options.api_key,
46
- :user => @json['session']['name'],
47
- :method => 'user.getInfo',
48
- :format => 'json'}
49
- response = RestClient.get(options.client_options.api_url, { :params => params })
50
- user = MultiJson.decode(response.to_s)
51
- @json.merge!(user)
52
- rescue ::RestClient::Exception
53
- raise ::Timeout::Error
54
- end
65
+ load_profile!
55
66
  super
67
+ rescue StandardError => e
68
+ fail!(:invalid_credentials, e)
56
69
  end
57
70
 
58
- uid do
59
- @json['session']['name']
71
+ protected
72
+
73
+ def load_profile!
74
+ token = request.params['token'].to_s
75
+ raise ArgumentError, 'Missing token parameter in callback request' if token.empty?
76
+
77
+ session_payload = fetch_json(session_params(token))
78
+ user_name = session_payload.dig('session', 'name').to_s
79
+ raise ArgumentError, 'Missing session name in Last.fm session response' if user_name.empty?
80
+
81
+ @json = session_payload
82
+ @json.merge!(fetch_json(user_info_params(user_name)))
60
83
  end
61
84
 
62
- info do
85
+ def fetch_json(params)
86
+ uri = URI(options.client_options.api_url)
87
+ uri.query = URI.encode_www_form(params)
88
+
89
+ http = Net::HTTP.new(uri.host, uri.port)
90
+ http.use_ssl = uri.scheme == 'https'
91
+ http.open_timeout = options.api_timeout
92
+ http.read_timeout = options.api_timeout
93
+
94
+ request = Net::HTTP::Get.new(uri.request_uri)
95
+ request['Accept'] = 'application/json'
96
+ request['User-Agent'] = options.client_options.user_agent
97
+
98
+ response = http.request(request)
99
+ unless response.is_a?(Net::HTTPSuccess)
100
+ raise LastfmApiError, "Last.fm API request failed (status #{response.code})"
101
+ end
102
+
103
+ JSON.parse(response.body)
104
+ rescue JSON::ParserError => e
105
+ raise LastfmApiError, "Last.fm API returned invalid JSON: #{e.message}"
106
+ end
107
+
108
+ def session_data
109
+ @json&.fetch('session', {}) || {}
110
+ end
111
+
112
+ def user_data
113
+ @json&.fetch('user', {}) || {}
114
+ end
115
+
116
+ def image_url(value)
117
+ case value
118
+ when Array
119
+ value.reverse_each do |entry|
120
+ image = entry.fetch('#text', '').to_s
121
+ return image unless image.empty?
122
+ end
123
+ nil
124
+ when Hash
125
+ image = value.fetch('#text', '').to_s
126
+ image.empty? ? nil : image
127
+ else
128
+ image = value.to_s
129
+ image.empty? ? nil : image
130
+ end
131
+ end
132
+
133
+ def request_phase_params
63
134
  {
64
- :nickname => @json['user']['name'],
65
- :name => @json['user']['realname'],
66
- :url => @json['user']['url'],
67
- :image => @json['user']['image'].instance_of?(Array) ? @json['user']['image'].last['#text'] : @json['user']['image'],
68
- :country => @json['user']['country'],
69
- :age => @json['user']['age'],
70
- :gender => @json['user']['gender'],
135
+ api_key: options.api_key,
136
+ cb: callback_url
71
137
  }
72
138
  end
73
139
 
74
- extra do
75
- { :raw_info => @json['user'] }
140
+ def session_params(token)
141
+ {
142
+ api_key: options.api_key,
143
+ token: token,
144
+ api_sig: signature(token),
145
+ method: 'auth.getSession',
146
+ format: 'json'
147
+ }
76
148
  end
77
149
 
78
- credentials do
150
+ def user_info_params(user_name)
79
151
  {
80
- :token => @json['session']['key'],
81
- :name => @json['session']['name'],
152
+ api_key: options.api_key,
153
+ user: user_name,
154
+ method: 'user.getInfo',
155
+ format: 'json'
82
156
  }
83
157
  end
84
158
 
85
- protected
86
-
87
159
  def signature(token)
88
- sign = "api_key#{options.api_key}methodauth.getSessiontoken#{token}#{options.secret_key}"
89
- Digest::MD5.hexdigest(sign)
160
+ base = "api_key#{options.api_key}methodauth.getSessiontoken#{token}#{options.secret_key}"
161
+ Digest::MD5.hexdigest(base)
90
162
  end
163
+
164
+ class LastfmApiError < StandardError; end
91
165
  end
92
166
  end
93
167
  end
@@ -1,5 +1,3 @@
1
- module OmniAuth
2
- module Lastfm
3
- VERSION = "0.0.7"
4
- end
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/lastfm/version'
@@ -1,2 +1,4 @@
1
- require "omniauth-lastfm/version"
2
- require "omniauth/strategies/lastfm"
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth-lastfm/version'
4
+ require 'omniauth/strategies/lastfm'
@@ -1,27 +1,33 @@
1
- # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
- require 'omniauth-lastfm/version'
1
+ # frozen_string_literal: true
4
2
 
5
- Gem::Specification.new do |s|
6
- s.name = 'omniauth-lastfm'
7
- s.version = OmniAuth::Lastfm::VERSION
8
- s.authors = ['Claudio Poli']
9
- s.email = ['claudio@audiobox.fm']
10
- s.homepage = 'http://github.com/masterkain/omniauth-lastfm'
11
- s.summary = 'OmniAuth strategy for Last.fm'
12
- s.description = 'OmniAuth strategy for Last.fm'
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'omniauth/lastfm/version'
13
6
 
14
- s.rubyforge_project = 'omniauth-lastfm'
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'omniauth-lastfm'
9
+ spec.version = OmniAuth::Lastfm::VERSION
10
+ spec.authors = ['Claudio Poli']
11
+ spec.email = ['masterkain@gmail.com']
15
12
 
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
19
- s.require_paths = ['lib']
13
+ spec.summary = 'OmniAuth strategy for Last.fm authentication.'
14
+ spec.description = 'OAuth strategy for OmniAuth that authenticates users with Last.fm and exposes profile metadata.'
15
+ spec.homepage = 'https://github.com/icoretech/omniauth-lastfm'
16
+ spec.license = 'MIT'
17
+ spec.required_ruby_version = '>= 3.2'
20
18
 
21
- s.add_development_dependency 'rspec', '~> 2.10'
22
- s.add_development_dependency 'rack-test'
23
- s.add_development_dependency 'simplecov'
24
- s.add_development_dependency 'webmock'
25
- s.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
26
- s.add_runtime_dependency 'rest-client', '>= 1.6.6', '<= 2.0'
19
+ spec.metadata['source_code_uri'] = 'https://github.com/icoretech/omniauth-lastfm'
20
+ spec.metadata['bug_tracker_uri'] = 'https://github.com/icoretech/omniauth-lastfm/issues'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/icoretech/omniauth-lastfm/releases'
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
23
+
24
+ spec.files = Dir[
25
+ 'lib/**/*.rb',
26
+ 'README*',
27
+ 'LICENSE*',
28
+ '*.gemspec'
29
+ ]
30
+ spec.require_paths = ['lib']
31
+
32
+ spec.add_dependency 'omniauth', '>= 2.1', '< 3.0'
27
33
  end
metadata CHANGED
@@ -1,127 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-lastfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rspec
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.10'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.10'
27
- - !ruby/object:Gem::Dependency
28
- name: rack-test
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: simplecov
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: webmock
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: omniauth-oauth
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.0'
83
- - !ruby/object:Gem::Dependency
84
- name: rest-client
13
+ name: omniauth
85
14
  requirement: !ruby/object:Gem::Requirement
86
15
  requirements:
87
16
  - - ">="
88
17
  - !ruby/object:Gem::Version
89
- version: 1.6.6
90
- - - "<="
18
+ version: '2.1'
19
+ - - "<"
91
20
  - !ruby/object:Gem::Version
92
- version: '2.0'
21
+ version: '3.0'
93
22
  type: :runtime
94
23
  prerelease: false
95
24
  version_requirements: !ruby/object:Gem::Requirement
96
25
  requirements:
97
26
  - - ">="
98
27
  - !ruby/object:Gem::Version
99
- version: 1.6.6
100
- - - "<="
28
+ version: '2.1'
29
+ - - "<"
101
30
  - !ruby/object:Gem::Version
102
- version: '2.0'
103
- description: OmniAuth strategy for Last.fm
31
+ version: '3.0'
32
+ description: OAuth strategy for OmniAuth that authenticates users with Last.fm and
33
+ exposes profile metadata.
104
34
  email:
105
- - claudio@audiobox.fm
35
+ - masterkain@gmail.com
106
36
  executables: []
107
37
  extensions: []
108
38
  extra_rdoc_files: []
109
39
  files:
110
- - ".gitignore"
111
- - ".rspec"
112
- - Gemfile
40
+ - LICENSE.txt
113
41
  - README.md
114
- - Rakefile
115
42
  - lib/omniauth-lastfm.rb
116
43
  - lib/omniauth-lastfm/version.rb
44
+ - lib/omniauth/lastfm/version.rb
117
45
  - lib/omniauth/strategies/lastfm.rb
118
46
  - omniauth-lastfm.gemspec
119
- - spec/omniauth/strategies/lastfm_spec.rb
120
- - spec/spec_helper.rb
121
- homepage: http://github.com/masterkain/omniauth-lastfm
122
- licenses: []
123
- metadata: {}
124
- post_install_message:
47
+ homepage: https://github.com/icoretech/omniauth-lastfm
48
+ licenses:
49
+ - MIT
50
+ metadata:
51
+ source_code_uri: https://github.com/icoretech/omniauth-lastfm
52
+ bug_tracker_uri: https://github.com/icoretech/omniauth-lastfm/issues
53
+ changelog_uri: https://github.com/icoretech/omniauth-lastfm/releases
54
+ rubygems_mfa_required: 'true'
125
55
  rdoc_options: []
126
56
  require_paths:
127
57
  - lib
@@ -129,18 +59,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
59
  requirements:
130
60
  - - ">="
131
61
  - !ruby/object:Gem::Version
132
- version: '0'
62
+ version: '3.2'
133
63
  required_rubygems_version: !ruby/object:Gem::Requirement
134
64
  requirements:
135
65
  - - ">="
136
66
  - !ruby/object:Gem::Version
137
67
  version: '0'
138
68
  requirements: []
139
- rubyforge_project: omniauth-lastfm
140
- rubygems_version: 2.5.1
141
- signing_key:
69
+ rubygems_version: 3.6.9
142
70
  specification_version: 4
143
- summary: OmniAuth strategy for Last.fm
144
- test_files:
145
- - spec/omniauth/strategies/lastfm_spec.rb
146
- - spec/spec_helper.rb
71
+ summary: OmniAuth strategy for Last.fm authentication.
72
+ test_files: []
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- .rvmrc
6
- .ruby-version
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "rake"
4
-
5
- # Specify your gem's dependencies in omniauth-lastfm.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,26 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe OmniAuth::Strategies::Lastfm do
4
- subject do
5
- OmniAuth::Strategies::Lastfm.new({})
6
- end
7
-
8
- context 'client options' do
9
- it 'should have the correct name' do
10
- subject.options.name.should eq('lastfm')
11
- end
12
-
13
- it 'should have correct site' do
14
- subject.options.client_options.site.should eq('http://www.last.fm')
15
- end
16
-
17
- it 'should have correct api url' do
18
- subject.options.client_options.api_url.should eq('http://ws.audioscrobbler.com/2.0/')
19
- end
20
-
21
- it 'should have correct authorize path' do
22
- subject.options.client_options.authorize_path.should eq('/api/auth')
23
- end
24
- end
25
-
26
- end
data/spec/spec_helper.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'bundler/setup'
2
- require 'rspec'
3
- require 'omniauth'
4
- require 'omniauth-lastfm'
5
-
6
- RSpec.configure do |config|
7
- end