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 +5 -5
- data/LICENSE.txt +22 -0
- data/README.md +82 -89
- data/lib/omniauth/lastfm/version.rb +7 -0
- data/lib/omniauth/strategies/lastfm.rb +133 -59
- data/lib/omniauth-lastfm/version.rb +3 -5
- data/lib/omniauth-lastfm.rb +4 -2
- data/omniauth-lastfm.gemspec +28 -22
- metadata +26 -100
- data/.gitignore +0 -6
- data/.rspec +0 -2
- data/Gemfile +0 -6
- data/Rakefile +0 -6
- data/spec/omniauth/strategies/lastfm_spec.rb +0 -26
- data/spec/spec_helper.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3cdb8db563f4d292809cac2b172e00397ff84f65d1949180d784419fd295a497
|
|
4
|
+
data.tar.gz: dc7bcb6f66cc566c4e24760531f75f979e245d986ee0b4db97196abd4f5b8e44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
[](https://github.com/icoretech/omniauth-lastfm/actions/workflows/test.yml)
|
|
4
|
+
[](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
|
|
@@ -1,93 +1,167 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require
|
|
4
|
-
require
|
|
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 [
|
|
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 :
|
|
15
|
-
option :client_options,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
27
|
+
uid { session_data['name'] }
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
:
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
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
|
-
:
|
|
65
|
-
:
|
|
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
|
-
|
|
75
|
-
{
|
|
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
|
-
|
|
150
|
+
def user_info_params(user_name)
|
|
79
151
|
{
|
|
80
|
-
:
|
|
81
|
-
:
|
|
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
|
-
|
|
89
|
-
Digest::MD5.hexdigest(
|
|
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
|
data/lib/omniauth-lastfm.rb
CHANGED
data/omniauth-lastfm.gemspec
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
#
|
|
2
|
-
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
|
3
|
-
require 'omniauth-lastfm/version'
|
|
1
|
+
# frozen_string_literal: true
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
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:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
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
|
|
90
|
-
- - "
|
|
18
|
+
version: '2.1'
|
|
19
|
+
- - "<"
|
|
91
20
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: '
|
|
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
|
|
100
|
-
- - "
|
|
28
|
+
version: '2.1'
|
|
29
|
+
- - "<"
|
|
101
30
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
103
|
-
description:
|
|
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
|
-
-
|
|
35
|
+
- masterkain@gmail.com
|
|
106
36
|
executables: []
|
|
107
37
|
extensions: []
|
|
108
38
|
extra_rdoc_files: []
|
|
109
39
|
files:
|
|
110
|
-
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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: '
|
|
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
|
-
|
|
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
data/.rspec
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -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
|