omniauth-linuxfr 1.0.0 → 2.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 52621702d79b0ba3060bb15034a1c69fc5e58200
4
+ data.tar.gz: 8ed69e20bb8708bd3467c69a0a3ccbec37566042
5
+ SHA512:
6
+ metadata.gz: 4cfa1a739f7547b0c330851c52e9dc70f4a0cb014275e8d296b121b179fbf8f32399635f5729b0551c94281bd09ed830f21b19ab5e528c2c86ac6e9623bbb6e0
7
+ data.tar.gz: 6399ae77e43ed73781914b8580a8ecd7d39e7939bf30a59b8ec223d45941c17779fc53606d6dc8c339fbf50c5d3a9eeb3f6c5bf625daf0928ccaefd232129325
data/README.md CHANGED
@@ -3,15 +3,54 @@ OmniAuth LinuxFr.org
3
3
 
4
4
  This is the official OmniAuth strategy for authenticating to LinuxFr.org.
5
5
  To use it, you'll need to sign up for an OAuth2 Application ID and Secret
6
- on the [LinuxFr.org Applications Page](https://linuxfr.org/account/applications).
6
+ on the [LinuxFr.org Applications Page](https://linuxfr.org/api/applications).
7
7
 
8
8
 
9
9
  Basic Usage
10
10
  -----------
11
11
 
12
- use OmniAuth::Builder do
13
- provider :linuxfr, ENV['LINUXFR_KEY'], ENV['LINUXFR_SECRET']
14
- end
12
+ ```ruby
13
+ #!/usr/bin/env ruby
14
+ # encoding: utf-8
15
+
16
+ require 'sinatra'
17
+ require 'omniauth'
18
+ require 'omniauth-linuxfr'
19
+
20
+
21
+ use Rack::Session::Cookie
22
+ use OmniAuth::Builder do
23
+ provider :linuxfr,
24
+ ENV['LINUXFR_KEY'], # The app identifier
25
+ ENV['LINUXFR_SECRET'] # The app secret
26
+ end
27
+
28
+
29
+ get '/' do
30
+ <<-HTML
31
+ <a href="/auth/linuxfr">Se connecter avec LinuxFr.org</a>
32
+ HTML
33
+ end
34
+
35
+ get '/auth/failure' do
36
+ <<-HTML
37
+ <h2>Erreur</h2>
38
+ <pre>#{params['message']}</pre>
39
+ HTML
40
+ end
41
+
42
+ get '/auth/linuxfr/callback' do
43
+ auth = request.env['omniauth.auth']
44
+
45
+ <<-HTML
46
+ <ul>
47
+ <li>login: #{auth.info.login}</li>
48
+ <li>email: #{auth.info.email}</li>
49
+ <li>date: #{auth.info.created_at}</li>
50
+ </ul>
51
+ HTML
52
+ end
53
+ ```
15
54
 
16
55
 
17
56
  Copyright
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module LinuxFr
3
- VERSION = "1.0.0"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -5,23 +5,20 @@ module OmniAuth
5
5
  class LinuxFr < OmniAuth::Strategies::OAuth2
6
6
  BASE_URL = "https://linuxfr.org"
7
7
 
8
+ option :name, :linuxfr
9
+
8
10
  option :client_options, {
9
- :site => BASE_URL,
10
- :authorize_url => "#{BASE_URL}/auth/oauth/authorize",
11
- :token_url => "#{BASE_URL}/auth/oauth/access_token"
11
+ :site => "https://linuxfr.org",
12
+ :authorize_url => "/api/oauth/authorize",
13
+ :token_url => "/api/oauth/token"
12
14
  }
13
15
 
14
- def request_phase
15
- super
16
- end
17
-
18
16
  uid { raw_info["login"] }
19
17
 
20
18
  info { raw_info }
21
19
 
22
20
  def raw_info
23
- access_token.options[:mode] = :query
24
- @raw_info ||= access_token.get("/auth/oauth/user").parsed
21
+ @raw_info ||= access_token.get("/api/v1/me").parsed
25
22
  end
26
23
  end
27
24
  end
@@ -5,10 +5,9 @@ Gem::Specification.new do |gem|
5
5
  gem.email = "nono@linuxfr.org"
6
6
  gem.description = %q{Official OmniAuth strategy for LinuxFr.org.}
7
7
  gem.summary = %q{Official OmniAuth strategy for LinuxFr.org.}
8
- gem.homepage = "https://github.com/nono/omniauth-linuxfr.org"
8
+ gem.homepage = "https://github.com/linuxfrorg/omniauth-linuxfr.org"
9
9
 
10
10
  gem.files = `git ls-files`.split("\n")
11
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
12
11
  gem.name = "omniauth-linuxfr"
13
12
  gem.require_paths = ["lib"]
14
13
  gem.version = OmniAuth::LinuxFr::VERSION
metadata CHANGED
@@ -1,46 +1,51 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-linuxfr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bruno Michel
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-12-09 00:00:00.000000000 Z
11
+ date: 2014-09-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth
16
- requirement: &75528010 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *75528010
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: omniauth-oauth2
27
- requirement: &75527520 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
33
  version: '1.0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *75527520
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
36
41
  description: Official OmniAuth strategy for LinuxFr.org.
37
42
  email: nono@linuxfr.org
38
43
  executables: []
39
44
  extensions: []
40
45
  extra_rdoc_files: []
41
46
  files:
42
- - .gitignore
43
- - .rspec
47
+ - ".gitignore"
48
+ - ".rspec"
44
49
  - Gemfile
45
50
  - MIT-LICENSE
46
51
  - README.md
@@ -48,29 +53,28 @@ files:
48
53
  - lib/omniauth-linuxfr/version.rb
49
54
  - lib/omniauth/strategies/linuxfr.rb
50
55
  - omniauth-linuxfr.gemspec
51
- homepage: https://github.com/nono/omniauth-linuxfr.org
56
+ homepage: https://github.com/linuxfrorg/omniauth-linuxfr.org
52
57
  licenses: []
58
+ metadata: {}
53
59
  post_install_message:
54
60
  rdoc_options: []
55
61
  require_paths:
56
62
  - lib
57
63
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
64
  requirements:
60
- - - ! '>='
65
+ - - ">="
61
66
  - !ruby/object:Gem::Version
62
67
  version: '0'
63
68
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
69
  requirements:
66
- - - ! '>='
70
+ - - ">="
67
71
  - !ruby/object:Gem::Version
68
72
  version: '0'
69
73
  requirements: []
70
74
  rubyforge_project:
71
- rubygems_version: 1.8.12
75
+ rubygems_version: 2.2.2
72
76
  signing_key:
73
- specification_version: 3
77
+ specification_version: 4
74
78
  summary: Official OmniAuth strategy for LinuxFr.org.
75
79
  test_files: []
76
80
  has_rdoc: