omniauth-linuxfr 1.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.
- data/.gitignore +3 -0
- data/.rspec +1 -0
- data/Gemfile +2 -0
- data/MIT-LICENSE +20 -0
- data/README.md +22 -0
- data/lib/omniauth/strategies/linuxfr.rb +30 -0
- data/lib/omniauth-linuxfr/version.rb +5 -0
- data/lib/omniauth-linuxfr.rb +2 -0
- data/omniauth-linuxfr.gemspec +18 -0
- metadata +76 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Bruno Michel <bruno.michel@af83.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
OmniAuth LinuxFr.org
|
2
|
+
====================
|
3
|
+
|
4
|
+
This is the official OmniAuth strategy for authenticating to LinuxFr.org.
|
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).
|
7
|
+
|
8
|
+
|
9
|
+
Basic Usage
|
10
|
+
-----------
|
11
|
+
|
12
|
+
use OmniAuth::Builder do
|
13
|
+
provider :linuxfr, ENV['LINUXFR_KEY'], ENV['LINUXFR_SECRET']
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
Copyright
|
18
|
+
---------
|
19
|
+
|
20
|
+
The code is licensed as MIT. See the MIT-LICENSE file for the full license.
|
21
|
+
|
22
|
+
♡2011 by Bruno Michel. Copying is an act of love. Please copy and share.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "omniauth-oauth2"
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class LinuxFr < OmniAuth::Strategies::OAuth2
|
6
|
+
BASE_URL = "https://linuxfr.org"
|
7
|
+
|
8
|
+
option :client_options, {
|
9
|
+
:site => BASE_URL,
|
10
|
+
:authorize_url => "#{BASE_URL}/auth/oauth/authorize",
|
11
|
+
:token_url => "#{BASE_URL}/auth/oauth/access_token"
|
12
|
+
}
|
13
|
+
|
14
|
+
def request_phase
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
uid { raw_info["login"] }
|
19
|
+
|
20
|
+
info { raw_info }
|
21
|
+
|
22
|
+
def raw_info
|
23
|
+
access_token.options[:mode] = :query
|
24
|
+
@raw_info ||= access_token.get("/auth/oauth/user").parsed
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
OmniAuth.config.add_camelization "linuxfr", "LinuxFr"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path('../lib/omniauth-linuxfr/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.authors = "Bruno Michel"
|
5
|
+
gem.email = "nono@linuxfr.org"
|
6
|
+
gem.description = %q{Official OmniAuth strategy for LinuxFr.org.}
|
7
|
+
gem.summary = %q{Official OmniAuth strategy for LinuxFr.org.}
|
8
|
+
gem.homepage = "https://github.com/nono/omniauth-linuxfr.org"
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split("\n")
|
11
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
|
+
gem.name = "omniauth-linuxfr"
|
13
|
+
gem.require_paths = ["lib"]
|
14
|
+
gem.version = OmniAuth::LinuxFr::VERSION
|
15
|
+
|
16
|
+
gem.add_dependency 'omniauth', '~> 1.0'
|
17
|
+
gem.add_dependency 'omniauth-oauth2', '~> 1.0'
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-linuxfr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Bruno Michel
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: omniauth
|
16
|
+
requirement: &75528010 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *75528010
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: omniauth-oauth2
|
27
|
+
requirement: &75527520 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *75527520
|
36
|
+
description: Official OmniAuth strategy for LinuxFr.org.
|
37
|
+
email: nono@linuxfr.org
|
38
|
+
executables: []
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- .gitignore
|
43
|
+
- .rspec
|
44
|
+
- Gemfile
|
45
|
+
- MIT-LICENSE
|
46
|
+
- README.md
|
47
|
+
- lib/omniauth-linuxfr.rb
|
48
|
+
- lib/omniauth-linuxfr/version.rb
|
49
|
+
- lib/omniauth/strategies/linuxfr.rb
|
50
|
+
- omniauth-linuxfr.gemspec
|
51
|
+
homepage: https://github.com/nono/omniauth-linuxfr.org
|
52
|
+
licenses: []
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 1.8.12
|
72
|
+
signing_key:
|
73
|
+
specification_version: 3
|
74
|
+
summary: Official OmniAuth strategy for LinuxFr.org.
|
75
|
+
test_files: []
|
76
|
+
has_rdoc:
|