omniauth-mention 0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTIwYTg5ODNjZjYyYzIyZWU1NDM0YTk5ZTM0YWZiMGRlODVkZWIyMA==
5
+ data.tar.gz: !binary |-
6
+ YzMxNjgyOTFmNTA2NjhkMTRmZDZjMmQ1NjZiMzZlZTk2NGY2OTkxNg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MjE0YzRjZjk2N2FjNjhhY2VhZWJjNzk3ZTQ1NDc0ZjM1YzVlNzZkNmMyYjQ4
10
+ ZDhjZjc5MWI1NjVkZGNhNTViMDNkNWZjOWJhMjM1NDQ3MDVjZmRjNzdkNDc0
11
+ YTkyNGFiNDRjOGJlNDZiZDIzZjA1ZjU4OWZkMjc1MzdkNWU1NmU=
12
+ data.tar.gz: !binary |-
13
+ MjAwNDQ4NmRhMDQzNTE2MDlkYTg0NTA4ODhiZDZhODE4YmY5Mjc5OTY1NWNm
14
+ YjBhMmFlYmYzZjNhY2RmMmY1ZjQxOWMxNzk1NGI5MDdhYzUyMzU4YzRmYThm
15
+ NGUzMmFmOTJiNDFlNjJiZmIxODU4YWQ5ZjU2NGRjNDM2OTBhZTA=
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ *.gem
3
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ OmniAuth Mention
2
+ ================
3
+
4
+ This is an [OmniAuth 1.0](https://github.com/intridea/omniauth) strategy for authenticating to Mention.
5
+
6
+ Get a Mention Oauth2.0 API key at their [Developers Area](https://dev.mention.net/login)
7
+
8
+ Usage
9
+ -----
10
+
11
+ In a Rack application:
12
+
13
+ ```ruby
14
+ use OmniAuth::Builder do
15
+ provider :mention, ENV['MENTION_KEY'], ENV['MENTION_SECRET'], {:provider_ignores_state => true}
16
+ end
17
+ ```
18
+
19
+ For Rails, put this in `config/initializers/omniauth.rb`:
20
+
21
+ ```ruby
22
+ Rails.application.config.middleware.use OmniAuth::Builder do
23
+ provider :mention, ENV['MENTION_KEY'], ENV['MENTION_SECRET'], {:provider_ignores_state => true}
24
+ end
25
+ ```
26
+
27
+ Restart your server and visit */auth/mention* to try it out
28
+
29
+
30
+ Authors
31
+ -------
32
+
33
+ * [Etienne Depaulis (@EtienneDepaulis)](https://github.com/EtienneDepaulis)
34
+
35
+
36
+ License
37
+ -------
38
+
39
+ Copyright (c) 2013 Etienne Depaulis
40
+
41
+ This source code released under an MIT license.
@@ -0,0 +1,2 @@
1
+ require "omniauth-mention/version"
2
+ require 'omniauth/strategies/mention'
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Mention
3
+ VERSION = "0.1"
4
+ end
5
+ end
@@ -0,0 +1,36 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Mention < OmniAuth::Strategies::OAuth2
6
+ option :name, "mention"
7
+
8
+ option :client_options, {
9
+ :site => 'https://web.mention.net/',
10
+ :authorize_url => 'https://web.mention.net/authorize',
11
+ :token_url => 'https://web.mention.net/oauth/v2/token'
12
+ }
13
+
14
+ uid{ raw_info['account']['id'] }
15
+
16
+ info do
17
+ {
18
+ :name => raw_info['account']['name'],
19
+ :email => raw_info['account']['email']
20
+ }
21
+ end
22
+
23
+ extra do
24
+ {
25
+ 'raw_info' => raw_info
26
+ }
27
+ end
28
+
29
+ def raw_info
30
+ links = access_token.get('/api/accounts/me.json').parsed
31
+
32
+ @raw_info ||= access_token.get("#{links['_links']['me']['href']}.json").parsed
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-mention/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "omniauth-mention"
7
+ gem.version = Omniauth::Mention::VERSION
8
+ gem.authors = ["Etienne Depaulis"]
9
+ gem.email = ["etienne.depaulis@gmail.com"]
10
+ gem.homepage = "https://github.com/EtienneDepaulis/omniauth-mention"
11
+ gem.description = %q{OmniAuth strategy for Mention (OAuth 2.0)}
12
+ gem.summary = gem.description
13
+
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ gem.require_paths = ["lib"]
18
+
19
+ gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.0'
20
+
21
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
22
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-mention
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Etienne Depaulis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: OmniAuth strategy for Mention (OAuth 2.0)
28
+ email:
29
+ - etienne.depaulis@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - .gitignore
35
+ - Gemfile
36
+ - README.md
37
+ - lib/omniauth-mention.rb
38
+ - lib/omniauth-mention/version.rb
39
+ - lib/omniauth/strategies/mention.rb
40
+ - omniauth-mention.gemspec
41
+ homepage: https://github.com/EtienneDepaulis/omniauth-mention
42
+ licenses: []
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: 1.3.6
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.0.0
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: OmniAuth strategy for Mention (OAuth 2.0)
64
+ test_files: []