omniauth-indieauth 0.1.0 → 0.1.3
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 +1 -0
- data/LICENSE +20 -0
- data/README.md +91 -0
- data/examples/Gemfile +7 -0
- data/examples/Gemfile.lock +37 -0
- data/examples/app.rb +24 -0
- data/examples/config.ru +5 -0
- data/lib/omniauth-indieauth/version.rb +1 -1
- data/lib/omniauth-indieauth.rb +2 -2
- data/omniauth-indieauth.gemspec +25 -0
- metadata +46 -6
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Aaron Parecki
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
OmniAuth IndieAuth
|
2
|
+
==================
|
3
|
+
|
4
|
+
This is an OmniAuth strategy for using IndieAuth.com as an authentication server.
|
5
|
+
|
6
|
+
Basic Usage
|
7
|
+
-----------
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
use OmniAuth::Builder do
|
11
|
+
provider :indieauth, :client_id => 'http://example.com'
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
15
|
+
Using a Custom Auth Server
|
16
|
+
--------------------------
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
use OmniAuth::Builder do
|
20
|
+
provider :indieauth, :client_id => 'http://example.com', :server => 'https://indieauth.com'
|
21
|
+
end
|
22
|
+
```
|
23
|
+
|
24
|
+
Profile Info
|
25
|
+
------------
|
26
|
+
|
27
|
+
After the user signs in, the `uid` reported by OmniAuth will be their URL they entered. The gem will also attempt to parse their URL for an h-card, and return their real name and profile image if available.
|
28
|
+
|
29
|
+
```
|
30
|
+
{
|
31
|
+
"url": "http://aaronparecki.com/",
|
32
|
+
"name": "Aaron Parecki",
|
33
|
+
"image": "https://aaronparecki.com/images/aaronpk.png"
|
34
|
+
}
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
Basic Sinatra Example
|
39
|
+
---------------------
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'bundler/setup'
|
43
|
+
require 'sinatra/base'
|
44
|
+
require 'omniauth-indieauth'
|
45
|
+
|
46
|
+
use Rack::Session::Cookie, :secret => "change_me"
|
47
|
+
|
48
|
+
use OmniAuth::Builder do
|
49
|
+
provider :indieauth, :client_id => 'http://example.com'
|
50
|
+
end
|
51
|
+
|
52
|
+
class App < Sinatra::Base
|
53
|
+
get '/' do
|
54
|
+
<<-HTML
|
55
|
+
<ul>
|
56
|
+
<li><a href='/auth/indieauth'>Sign in with IndieAuth</a></li>
|
57
|
+
</ul>
|
58
|
+
HTML
|
59
|
+
end
|
60
|
+
|
61
|
+
get '/auth/:provider/callback' do
|
62
|
+
request.env['omniauth.auth'].info.to_hash.inspect
|
63
|
+
"<h1>Signed in!</h1>
|
64
|
+
<pre>#{request.env['omniauth.auth'].uid}</pre>
|
65
|
+
<pre>#{request.env['omniauth.auth'].info.to_hash.inspect}</pre>
|
66
|
+
"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
run App.new
|
71
|
+
```
|
72
|
+
|
73
|
+
|
74
|
+
License
|
75
|
+
-------
|
76
|
+
|
77
|
+
```
|
78
|
+
Copyright 2014 by Aaron Parecki
|
79
|
+
|
80
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
81
|
+
you may not use this file except in compliance with the License.
|
82
|
+
You may obtain a copy of the License at
|
83
|
+
|
84
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
85
|
+
|
86
|
+
Unless required by applicable law or agreed to in writing, software
|
87
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
88
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
89
|
+
See the License for the specific language governing permissions and
|
90
|
+
limitations under the License.
|
91
|
+
```
|
data/examples/Gemfile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/aaronpk/Code/omniauth-indieauth
|
3
|
+
specs:
|
4
|
+
omniauth-indieauth (0.1.0)
|
5
|
+
faraday (~> 0.9.0)
|
6
|
+
omniauth (~> 1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
faraday (0.9.0)
|
12
|
+
multipart-post (>= 1.2, < 3)
|
13
|
+
hashie (2.1.1)
|
14
|
+
multipart-post (2.0.0)
|
15
|
+
omniauth (1.2.1)
|
16
|
+
hashie (>= 1.2, < 3)
|
17
|
+
rack (~> 1.0)
|
18
|
+
rack (1.5.2)
|
19
|
+
rack-protection (1.5.3)
|
20
|
+
rack
|
21
|
+
shotgun (0.9)
|
22
|
+
rack (>= 1.0)
|
23
|
+
sinatra (1.4.5)
|
24
|
+
rack (~> 1.4)
|
25
|
+
rack-protection (~> 1.4)
|
26
|
+
tilt (~> 1.3, >= 1.3.4)
|
27
|
+
tilt (1.4.1)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
faraday
|
34
|
+
omniauth
|
35
|
+
omniauth-indieauth!
|
36
|
+
shotgun
|
37
|
+
sinatra
|
data/examples/app.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
class App < Sinatra::Base
|
3
|
+
use Rack::Session::Cookie, :secret => "change_me"
|
4
|
+
|
5
|
+
use OmniAuth::Builder do
|
6
|
+
provider :indieauth, :server => 'https://indieauth.com', :client_id => 'http://example.com'
|
7
|
+
end
|
8
|
+
|
9
|
+
get '/' do
|
10
|
+
<<-HTML
|
11
|
+
<ul>
|
12
|
+
<li><a href='/auth/indieauth'>Sign in with IndieAuth</a></li>
|
13
|
+
</ul>
|
14
|
+
HTML
|
15
|
+
end
|
16
|
+
|
17
|
+
get '/auth/:provider/callback' do
|
18
|
+
request.env['omniauth.auth'].info.to_hash.inspect
|
19
|
+
"<h1>Signed in!</h1>
|
20
|
+
<pre>#{request.env['omniauth.auth'].uid}</pre>
|
21
|
+
<pre>#{request.env['omniauth.auth'].info.to_hash.inspect}</pre>
|
22
|
+
"
|
23
|
+
end
|
24
|
+
end
|
data/examples/config.ru
ADDED
data/lib/omniauth-indieauth.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'omniauth-indieauth/version'
|
2
|
+
require 'omniauth/strategies/indieauth'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require File.expand_path('../lib/omniauth-indieauth/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'omniauth-indieauth'
|
6
|
+
s.version = OmniAuth::IndieAuth::VERSION
|
7
|
+
s.authors = ['Aaron Parecki']
|
8
|
+
s.email = ['aaron@parecki.com']
|
9
|
+
s.homepage = 'https://github.com/aaronpk/omniauth-indieauth'
|
10
|
+
s.license = 'Apache 2.0'
|
11
|
+
s.summary = 'IndieAuth adapter for OmniAuth.'
|
12
|
+
s.description = 'An OmniAuth strategy to allow you to authenticate '\
|
13
|
+
'using IndieAuth.com.'
|
14
|
+
|
15
|
+
s.rubyforge_project = 'omniauth-indieauth'
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
20
|
+
s.require_paths = ['lib']
|
21
|
+
|
22
|
+
s.add_runtime_dependency 'omniauth', '~> 1.0'
|
23
|
+
s.add_runtime_dependency 'faraday', '~> 0.9.0'
|
24
|
+
s.add_dependency 'microformats2', '>= 2.0.1'
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-indieauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: omniauth
|
16
|
+
requirement: !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: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: faraday
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.9.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.0
|
14
46
|
- !ruby/object:Gem::Dependency
|
15
47
|
name: microformats2
|
16
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -27,16 +59,24 @@ dependencies:
|
|
27
59
|
- - ! '>='
|
28
60
|
- !ruby/object:Gem::Version
|
29
61
|
version: 2.0.1
|
30
|
-
description:
|
62
|
+
description: An OmniAuth strategy to allow you to authenticate using IndieAuth.com.
|
31
63
|
email:
|
32
64
|
- aaron@parecki.com
|
33
65
|
executables: []
|
34
66
|
extensions: []
|
35
67
|
extra_rdoc_files: []
|
36
68
|
files:
|
69
|
+
- .gitignore
|
70
|
+
- LICENSE
|
71
|
+
- README.md
|
72
|
+
- examples/Gemfile
|
73
|
+
- examples/Gemfile.lock
|
74
|
+
- examples/app.rb
|
75
|
+
- examples/config.ru
|
37
76
|
- lib/omniauth-indieauth.rb
|
38
|
-
- lib/omniauth/strategies/indieauth.rb
|
39
77
|
- lib/omniauth-indieauth/version.rb
|
78
|
+
- lib/omniauth/strategies/indieauth.rb
|
79
|
+
- omniauth-indieauth.gemspec
|
40
80
|
homepage: https://github.com/aaronpk/omniauth-indieauth
|
41
81
|
licenses:
|
42
82
|
- Apache 2.0
|
@@ -57,9 +97,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
97
|
- !ruby/object:Gem::Version
|
58
98
|
version: '0'
|
59
99
|
requirements: []
|
60
|
-
rubyforge_project:
|
100
|
+
rubyforge_project: omniauth-indieauth
|
61
101
|
rubygems_version: 1.8.23
|
62
102
|
signing_key:
|
63
103
|
specification_version: 3
|
64
|
-
summary: IndieAuth adapter for OmniAuth
|
104
|
+
summary: IndieAuth adapter for OmniAuth.
|
65
105
|
test_files: []
|