omniauth-beatport 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b79da3d52efd389551782856bc312bbcf4cd3662
4
+ data.tar.gz: a2e272743c3a13b4d0912760aacce37fea36d473
5
+ SHA512:
6
+ metadata.gz: 0006adf2fe9237d0137027afe0f6d750ac369f2afe79136622aacfb529f7449973d8bd45a3a6d24bd65b4befc587b78315d1ea93c9c8e626953154c65c7e7920
7
+ data.tar.gz: a8a87e3dd742cc0612dd2e34a2f205ec5597d829a9dd0882c6a174642b396ea086ac00d136776cac119e5381f39b882dd6b762f7e8c7184a408fe759a946982f
@@ -0,0 +1,7 @@
1
+ module OAuth
2
+ class RequestToken < ConsumerToken
3
+ def callback_confirmed?
4
+ params[:oauth_callback_confirmed] == "true" || params[:oauth_callback_confirmed] == "1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,45 @@
1
+ require 'omniauth-oauth'
2
+ require 'multi_json'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Beatport < OmniAuth::Strategies::OAuth
7
+
8
+ option :name, 'beatport'
9
+
10
+ option :client_options, {
11
+ :access_token_path => "/identity/1/oauth/access-token",
12
+ :authorize_path => "/identity/1/oauth/authorize",
13
+ :request_token_path => "/identity/1/oauth/request-token",
14
+ :site => "https://oauth-api.beatport.com"
15
+ }
16
+
17
+ uid {
18
+ raw_info['id']
19
+ }
20
+
21
+ info do
22
+ {
23
+ 'nickname' => raw_info['username'],
24
+ 'first_name' => raw_info['first_name'],
25
+ 'last_name' => raw_info["last_name"],
26
+ 'email_address' => raw_info['register_email_address'],
27
+ 'paypal_email_address' => raw_info['paypal_email_address'],
28
+ 'beta_features' => raw_info['betaFeatures']
29
+ }
30
+ end
31
+
32
+ extra do
33
+ {
34
+ :raw_info => raw_info
35
+ }
36
+ end
37
+
38
+ def raw_info
39
+ @raw_info ||= MultiJson.decode(access_token.get('/identity/1/person').body)
40
+ rescue ::Errno::ETIMEDOUT
41
+ raise ::Timeout::Error
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Beatport
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ require 'omniauth-beatport/version'
2
+ require 'omniauth/strategies/beatport'
3
+ require 'oauth/request_token'
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-beatport
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mateo Murphy
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-oauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '2.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack-test
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: simplecov
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: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: gem-release
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: OmniAuth strategy for Beatport
98
+ email:
99
+ - mateo.murphy@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/oauth/request_token.rb
105
+ - lib/omniauth-beatport.rb
106
+ - lib/omniauth-beatport/version.rb
107
+ - lib/omniauth/strategies/beatport.rb
108
+ homepage: https://github.com/mateomurphy/omniauth-beatport
109
+ licenses: []
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.0.0
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: OmniAuth strategy for Beatport
131
+ test_files: []