omniauth-strava 0.0.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1988a58d92f5efe45f66dc57ffece9f62ae86264
4
- data.tar.gz: 62bfa347947fda67a1717525a8556bd83474beff
2
+ SHA256:
3
+ metadata.gz: 7a23d8f8da1bb5b55de32bf8442733b20adadac377297ecd9e220c9535d405d4
4
+ data.tar.gz: 975b9e24f933d118e3f1ea313de0609ca4f3f1ac6416f7d71f8a92e1f90528aa
5
5
  SHA512:
6
- metadata.gz: d1cd3aef07293bd8c660270ba7371014f8cabb005f91530424c8fe9fdd2c399173f54526862dcf2a6add21a76df84a0d39bcfe8c2039b8244823c50fe41661ab
7
- data.tar.gz: d543e003bc8edfe54a6ee523d0d6cfce2a93a750eb02abaf34aa6f34ff64e4af235bbf417990aab3a4970a720f3b66ea728f31d956b3e4db7301fd65f8c2b240
6
+ metadata.gz: e509edb8b045b00f7f388d7bfc4973f0a6837d7b18cd74a4e71ef2b440e583c4c86ce0eb0a44421ee5d6e0006fb9811cd2b128c13cba1397a75bd8ee0fd7d493
7
+ data.tar.gz: d8504260bc896be15666cbfa63d39853b6246bb14921fb47ebef263c621a2820c6654072d11c9971902f84d0648286cc12b635e5da87ac1ff215cfa70c9c679a
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Omniauth-Strava
2
+
3
+ This is a Omniauth Rubygem for authenticating users with Strava.
4
+
5
+ ## Installation
6
+
7
+ Add to your Gemfile:
8
+
9
+ ```
10
+ gem "omniauth-strava"
11
+ ```
12
+
13
+ Run bundle install afterwards.
14
+
15
+
16
+ To ``config/initializers/omniauth.rb`` add:
17
+
18
+
19
+ ```ruby
20
+ Rails.application.config.middleware.use OmniAuth::Builder do
21
+ provider :strava, Rails.application.secrets.strava_client_id, Rails.application.secrets.strava_api_key, scope: 'read'
22
+ end
23
+ ```
24
+
25
+ ``scope`` might be:
26
+
27
+ read - Allows access to public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards. This scope matches the old default scope, except it no longer includes access to activities and certain athlete endpoints mentioned below.
28
+ read_all - Allows access to view private routes, private segments, and private events. This scope matches the old view_private scope, except that it no longer includes access to private activities.
29
+ profile:read_all - NEW! Allows access to read all profile information even if the user has set their profile visibility to “Followers” or “Only You.”
30
+ profile:write - NEW! Allows access to update the user’s weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf.
31
+ activity:read - NEW! Allows access to read the user’s activity data for activities that are visible to “Everyone” and “Followers.”
32
+ activity:read_all - NEW! Allows the same access as activity:read, plus access to read the athlete’s activities that are visible to “Only You.”
33
+ activity:write - NEW! Allows access to create manual activities and uploads, and access to edit any activities that are visible to the app (based on activity read access level).
34
+
35
+ Please refer to the [Omniauth documentation](https://github.com/intridea/omniauth) on how to use Omniauth.
@@ -10,6 +10,14 @@ module OmniAuth
10
10
  :authorize_url => 'https://www.strava.com/oauth/authorize',
11
11
  :token_url => 'https://www.strava.com/oauth/token'
12
12
  }
13
+ option :scope, 'read'
14
+
15
+ def token_params
16
+ super.tap do |params|
17
+ params[:client_id] = options[:client_id]
18
+ params[:client_secret] = options[:client_secret]
19
+ end
20
+ end
13
21
 
14
22
  def authorize_params
15
23
  super.tap do |params|
@@ -24,7 +32,7 @@ module OmniAuth
24
32
  def callback_phase
25
33
  super
26
34
  end
27
-
35
+
28
36
  uid { "#{athlete['id']}" }
29
37
 
30
38
  extra do
@@ -42,7 +50,8 @@ module OmniAuth
42
50
  first_name: athlete['firstname'],
43
51
  last_name: athlete['lastname'],
44
52
  email: athlete['email'],
45
- location: "#{athlete['city']} #{athlete['state']}"
53
+ location: "#{athlete['city']} #{athlete['state']}",
54
+ image: athlete['profile']
46
55
  }
47
56
  end
48
57
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Strava
3
- VERSION = '0.0.6'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = OmniAuth::Strava::VERSION
17
17
 
18
- gem.add_dependency 'omniauth', '~> 1.0'
18
+ gem.add_dependency 'omniauth', '~> 2.0'
19
19
  gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.0'
20
20
  gem.add_development_dependency 'rspec', '~> 2.7'
21
21
  gem.add_development_dependency 'rack-test'
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-strava
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Hogg
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-13 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack-test
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: OmniAuth strategy for Strava.
@@ -101,9 +101,10 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .rspec
104
+ - ".gitignore"
105
+ - ".rspec"
106
106
  - Gemfile
107
+ - README.md
107
108
  - Rakefile
108
109
  - lib/omniauth-strava.rb
109
110
  - lib/omniauth-strava/version.rb
@@ -112,24 +113,23 @@ files:
112
113
  homepage: ''
113
114
  licenses: []
114
115
  metadata: {}
115
- post_install_message:
116
+ post_install_message:
116
117
  rdoc_options: []
117
118
  require_paths:
118
119
  - lib
119
120
  required_ruby_version: !ruby/object:Gem::Requirement
120
121
  requirements:
121
- - - '>='
122
+ - - ">="
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
- - - '>='
127
+ - - ">="
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubyforge_project:
131
- rubygems_version: 2.0.3
132
- signing_key:
131
+ rubygems_version: 3.5.6
132
+ signing_key:
133
133
  specification_version: 4
134
134
  summary: OmniAuth strategy for Strava.
135
135
  test_files: []