omniauth-windowslive 0.0.9.1 → 0.0.10

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: 198b45114390a53510bbf1195ff710a4bc4820a5
4
- data.tar.gz: 6f6614fb6712f729ff04d96cee51f3feecf33064
3
+ metadata.gz: 2d330f2110b7b5fecd90e55b5021a46ecf050cac
4
+ data.tar.gz: ee1daace6a355ca1d602c32eda87b93b4de4bcd4
5
5
  SHA512:
6
- metadata.gz: 4aef90c012dd0a03e7cb914dd85d2f65d807447119dc9ab4d014f3725e6a63647e725bd05b0b58c508b4ac653d84727fcc126bed7dc8b12609f408e0c3068d21
7
- data.tar.gz: 05d53443ba12da8dc89d4ae2e4ca5703971e0b64474451150a707a43a2857aa67ed797f44ae3e6b4ac321e15033b8e70ff381561049fb69ed444f1fad128f2bd
6
+ metadata.gz: d467908cacdb035a405e69a7691b22068f68ea91f21f608597cf0e7108d53adca77d80b4cea8676c9b007c049767c3e4f3bcba53570cac65c614aaf83199a6b5
7
+ data.tar.gz: 667eb9911e64fe22fcceadcb2e004b2d4a289e05a1cfa3ff43a0dbd77689a5af1111300da4366068d72fd4dcb348cda0dcf6f665c5e565a095bcff72b78d983d
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ script: bundle exec rspec
3
+ rvm:
4
+ - 2.2.2
5
+ - ruby-head
6
+ matrix:
7
+ allow_failures:
8
+ - rvm: ruby-head
data/Gemfile CHANGED
@@ -2,3 +2,9 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in omniauth-windowslive.gemspec
4
4
  gemspec
5
+
6
+
7
+ group :test do
8
+ gem 'coveralls', require: false
9
+ gem 'pry'
10
+ end
data/README.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # OmniAuth Windows Live
2
2
 
3
+ [![Code Climate](https://codeclimate.com/github/joel/omniauth-windowslive.png)](https://codeclimate.com/github/joel/omniauth-windowslive)
4
+
5
+ [![Dependency Status](https://gemnasium.com/joel/omniauth-windowslive.svg)](https://gemnasium.com/joel/omniauth-windowslive)
6
+
7
+ [![Build Status](https://travis-ci.org/joel/omniauth-windowslive.svg?branch=master)](https://travis-ci.org/joel/omniauth-windowslive) (Travis CI)
8
+
9
+ [![Coverage Status](https://coveralls.io/repos/joel/omniauth-windowslive/badge.svg?branch=master&service=github)](https://coveralls.io/github/joel/omniauth-windowslive?branch=master)
10
+
11
+ [![Gem Version](https://badge.fury.io/rb/omniauth-windowslive.svg)](http://badge.fury.io/rb/omniauth-windowslive)
12
+
3
13
  This gem contains the unofficial WindowsLive strategy for OmniAuth.
4
14
 
5
15
  ## Basic Usage
@@ -19,4 +29,4 @@ https://manage.dev.live.com/AddApplication.aspx?tou=1
19
29
 
20
30
  Tested with the following Ruby versions:
21
31
 
22
- - RUBY 1.9.3-p0
32
+ - RUBY 2.2.2
@@ -1,3 +1,4 @@
1
+ require 'uri'
1
2
  require 'omniauth/strategies/oauth2'
2
3
 
3
4
  # http://msdn.microsoft.com/en-us/library/hh243647.aspx
@@ -10,13 +11,13 @@ module OmniAuth
10
11
  DEFAULT_SCOPE = 'wl.basic,wl.emails,wl.photos'
11
12
 
12
13
  option :client_options, {
13
- :site => 'https://login.live.com',
14
- :authorize_url => '/oauth20_authorize.srf',
15
- :token_url => '/oauth20_token.srf'
14
+ site: 'https://login.live.com',
15
+ authorize_url: '/oauth20_authorize.srf',
16
+ token_url: '/oauth20_token.srf'
16
17
  }
17
18
 
18
19
  option :authorize_params, {
19
- :response_type => 'code'
20
+ response_type: 'code'
20
21
  }
21
22
 
22
23
  option :name, 'windowslive'
@@ -26,14 +27,14 @@ module OmniAuth
26
27
  # http://msdn.microsoft.com/en-us/library/hh243648.aspx
27
28
  info do
28
29
  {
29
- 'id' => raw_info['id'],
30
- 'emails' => emails_parser,
31
- 'name' => raw_info['name'],
32
- 'first_name' => raw_info['first_name'],
33
- 'last_name' => raw_info['last_name'],
34
- 'gender' => raw_info['gender'],
35
- 'link' => raw_info['link'],
36
- 'locale' => raw_info['locale'],
30
+ 'id' => raw_info['id'],
31
+ 'emails' => emails_parser,
32
+ 'name' => raw_info['name'],
33
+ 'first_name' => raw_info['first_name'],
34
+ 'last_name' => raw_info['last_name'],
35
+ 'gender' => raw_info['gender'],
36
+ 'link' => raw_info['link'],
37
+ 'locale' => raw_info['locale'],
37
38
  'updated_time' => raw_info['updated_time']
38
39
  }
39
40
  end
@@ -51,6 +52,12 @@ module OmniAuth
51
52
  end
52
53
 
53
54
  private
55
+
56
+ def build_access_token
57
+ verifier = request.params["code"]
58
+ redirect_uri = URI.parse(callback_url).tap { |uri| uri.query = nil }.to_s
59
+ client.auth_code.get_token(verifier, {:redirect_uri => redirect_uri}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params))
60
+ end
54
61
 
55
62
  def emails_parser
56
63
  emails = raw_info['emails']
@@ -84,4 +91,4 @@ module OmniAuth
84
91
  end
85
92
  end
86
93
 
87
- OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
94
+ OmniAuth.config.add_camelization 'windowslive', 'Windowslive'
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Windowslive
3
- VERSION = "0.0.9.1"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'omniauth-Windowslive'
3
2
 
4
3
  describe OmniAuth::Strategies::Windowslive do
5
4
  subject do
data/spec/spec_helper.rb CHANGED
@@ -1,14 +1,19 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
1
+ require 'omniauth/windowslive'
2
+ require 'bundler/setup'
3
+ require 'coveralls'
4
+
5
+ begin
6
+ require 'pry'
7
+ rescue LoadError
8
+ end
3
9
 
4
- require 'rspec'
5
10
  require 'rack/test'
6
- require 'omniauth'
7
- require 'omniauth-windowslive'
11
+
12
+ Coveralls.wear!
8
13
 
9
14
  Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
10
15
 
11
16
  RSpec.configure do |config|
12
17
  config.include Rack::Test::Methods
13
- config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
14
- end
18
+ config.extend OmniAuth::Test::StrategyMacros, type: :strategy
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-windowslive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.1
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel AZEMAR
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-28 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -90,6 +90,7 @@ files:
90
90
  - ".gitignore"
91
91
  - ".ruby-gemset"
92
92
  - ".ruby-version"
93
+ - ".travis.yml"
93
94
  - Gemfile
94
95
  - LICENSE
95
96
  - README.md
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  version: '0'
122
123
  requirements: []
123
124
  rubyforge_project: omniauth-windowslive
124
- rubygems_version: 2.4.6
125
+ rubygems_version: 2.4.5
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Windows Live, Hotmail, SkyDrive, Windows Live Messenger, and other services...