omniauth-bike-index 0.1.0 → 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
2
  SHA1:
3
- metadata.gz: df30b257d96047b03e1d60869233c69ee293bbb0
4
- data.tar.gz: ff7734850c1f426614774c7d798a7e54dde7d1c3
3
+ metadata.gz: f1c9a5e41e30b52036f65770a0890439ad29b4fe
4
+ data.tar.gz: 0e557a7f410e21be8f3cabea92ac204acfa3737b
5
5
  SHA512:
6
- metadata.gz: 747feadbb1ed8d937b44f583119d338186e66f4182d319b32691ecc28d67ca8eb3b9e8c0d14d93dc9a5a71ee8a279f4202ecf0c903c1c84c460d11069108d6cd
7
- data.tar.gz: 7693d9b2c71430dee0dde1c7ea011c1d21f7751be888acaf62052ba7439f79416307f629e619b7245f4cad1133d70839b69deccb120b74d7851d4780c02ea365
6
+ metadata.gz: e83173b9ff0486ff302aef7069ef7314658e1dd94b2c7ca24954eb25ad5ca01d84d84813abc0c9f042bca123fccc80266b81b8c537a477ed1f53b68dea13400d
7
+ data.tar.gz: 0fa877dfc49dee02e22b4fa77b4d55c1c9b6c70d3c7d71125628d6fc8cc97118f5ce6b76e5aeaa5f1f00fad96f4e6aa0522b78ae058789214f5b77f558af4964
@@ -2,16 +2,13 @@ bundler_args: --without development
2
2
  gemfile:
3
3
  - Gemfile
4
4
  language: ruby
5
+ before_install:
6
+ - gem install bundler
7
+ - gem update bundler
5
8
  rvm:
6
- - 1.9.2
7
- - 1.9.3
8
- - 2.0.0
9
- - 2.1.0
10
- - rbx-2
11
- - ruby-head
12
- - jruby-19mode
9
+ - 2.2.4
10
+ - 2.3.0
13
11
  - jruby-head
14
12
  matrix:
15
13
  allow_failures:
16
14
  - rvm: jruby-head
17
- - rvm: ruby-head
data/Gemfile CHANGED
@@ -3,10 +3,7 @@ source 'https://rubygems.org'
3
3
  gem 'rake'
4
4
 
5
5
  group :test do
6
- gem 'rspec', '~> 2.7'
7
- gem 'guard'
8
- gem 'guard-rspec', '4.2.8'
9
- gem 'guard-livereload'
6
+ gem 'rspec'
10
7
  end
11
8
 
12
9
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- OmniAuth::BikeIndex
1
+ # OmniAuth::BikeIndex [![Build Status](https://travis-ci.org/bikeindex/omniauth-bike-index.svg?branch=master)](https://travis-ci.org/bikeindex/omniauth-bike-index)
2
2
  ==============
3
3
 
4
4
  Bike Index OAuth2 Strategy for OmniAuth 1.0.
@@ -15,7 +15,7 @@ Once you've added your application and your routes, you'll be able to see your A
15
15
  **Note**: Callback url has to be an exact match - if your url is `http://localhost:3001/users/auth/bike_index/callback` you _must_ enter that exactly - `http://localhost:3001/users/auth/` will not work.
16
16
 
17
17
 
18
- Check out **[API V2 Documentation](https://bikeindex.org/documentation/api_v2)** to see what can be done with authenticated users.
18
+ Check out the **[Bike Index API Documentation](https://bikeindex.org/documentation)** to see what can be done with authenticated users.
19
19
 
20
20
  ## Usage
21
21
 
@@ -36,17 +36,16 @@ Your `BIKEINDEX_APP_ID` and your `BIKEINDEX_APP_SECRET` are both application spe
36
36
 
37
37
  Edit your routes.rb file to have:
38
38
 
39
- `devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }`
39
+ `devise_for :users, controllers: { omniauth_callbacks: 'omniauth_callbacks' }`
40
40
 
41
41
  And create a file called `omniauth_callbacks_controller.rb` which should have this inside:
42
42
 
43
43
  ```ruby
44
44
  class OmniauthCallbacksController < Devise::OmniauthCallbacksController
45
-
46
45
  def bike_index
47
46
  # Delete the code inside of this method and write your own.
48
47
  # The code below is to show you where to access the data.
49
- raise request.env["omniauth.auth"].to_json
48
+ raise request.env['omniauth.auth'].to_json
50
49
  end
51
50
  end
52
51
  ```
@@ -70,7 +69,7 @@ If you don't include a scope, the response will include a `uid` from Bike Index
70
69
 
71
70
  If you include the `read_bikes` scope, the response will include an array of the ids the user has registered on the Index `bike_ids: [3414, 29367]`
72
71
 
73
- You can use these IDs to access information about the bikes - e.g. [BikeIndex.org/api/v1/bikes/3414](https://bikeindex.org/api/v1/bikes/3414) & [/api/v1/bikes/29367](https://bikeindex.org/api/v1/bikes/29367)
72
+ You can use these IDs to access information about the bikes - e.g. [api/v3/bikes/3414](https://bikeindex.org/api/v3/bikes/3414) & [api/v3/bikes/29367](https://bikeindex.org/api/v3/bikes/29367)
74
73
 
75
74
  If you include the `read_user` scope, the response will include the user's nickname, email and name. You will also see their twitter handle and avatar if they have added them. The keys for these items -
76
75
  `nickname`, `email`, `name`, `twitter` & `image` - all accessible in the `request.env['omniauth.auth']`, e.g. `request.env['omniauth.auth'].info.email`
@@ -78,5 +77,5 @@ If you include the `read_user` scope, the response will include the user's nickn
78
77
 
79
78
  ## Auth Hash
80
79
 
81
- You can also see the authetication hash (in JSON format) by going to the authentication url on the Bike Index with the user's access token - `https://bikeindex.org/api/v2/users/current?access_token=<OAUTH_ACCESS_TOKEN>`
80
+ You can also see the authetication hash (in JSON format) by going to the authentication url on the Bike Index with the user's access token - `https://bikeindex.org/api/v3/me?access_token=<OAUTH_ACCESS_TOKEN>`
82
81
 
data/Rakefile CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
- RSpec::Core::RakeTask.new(:spec)
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task test: :spec
7
+ task default: :spec
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module BikeIndex
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -5,8 +5,7 @@ module OmniAuth
5
5
  class BikeIndex < OmniAuth::Strategies::OAuth2
6
6
  option :name, :bike_index
7
7
  DEFAULT_SCOPE = 'public'
8
- option :client_options, :site => 'https://bikeindex.org',
9
- :authorize_url => '/oauth/authorize'
8
+ option :client_options, site: 'https://bikeindex.org', authorize_url: '/oauth/authorize'
10
9
 
11
10
  uid { raw_info['id'] }
12
11
 
@@ -28,14 +27,11 @@ module OmniAuth
28
27
  end
29
28
 
30
29
  def raw_info
31
- @raw_info ||= access_token.get('/api/v2/me').parsed || {}
30
+ @raw_info ||= access_token.get('/api/v3/me').parsed || {}
32
31
  end
33
32
 
34
33
  def request_phase
35
- options[:authorize_params] = {
36
- :scope => (options['scope'] || DEFAULT_SCOPE)
37
- }
38
-
34
+ options[:authorize_params] = { scope: (options['scope'] || DEFAULT_SCOPE) }
39
35
  super
40
36
  end
41
37
 
@@ -20,7 +20,7 @@ end
20
20
 
21
21
  get '/' do
22
22
  <<-HTML
23
- <a href='/auth/venmo'>Sign in with Bike Index</a>
23
+ <a href='/auth/bikeindex'>Sign in with Bike Index</a>
24
24
  HTML
25
25
  end
26
26
 
@@ -30,5 +30,4 @@ describe OmniAuth::Strategies::BikeIndex do
30
30
  OmniAuth::Strategies::Developer.new(app, :uid_field => :name).options.uid_field # => :name
31
31
  end
32
32
  end
33
-
34
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bike-index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Herr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-25 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -76,7 +76,6 @@ files:
76
76
  - ".gitignore"
77
77
  - ".travis.yml"
78
78
  - Gemfile
79
- - Guardfile
80
79
  - README.md
81
80
  - Rakefile
82
81
  - lib/omniauth-bike-index.rb
@@ -106,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
105
  version: '0'
107
106
  requirements: []
108
107
  rubyforge_project:
109
- rubygems_version: 2.4.6
108
+ rubygems_version: 2.4.8
110
109
  signing_key:
111
110
  specification_version: 4
112
111
  summary: Bike Index strategy for OmniAuth
data/Guardfile DELETED
@@ -1,8 +0,0 @@
1
- rspec_opts = {
2
- failed_mode: :focus
3
- }
4
-
5
- guard :rspec, cmd: "bundle exec rspec" do
6
- watch(%r{^spec/.+_spec\.rb$})
7
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
8
- end