omniauth-disqus 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f7df002f2e663c0e2869c25cba47449ac176ccf
4
+ data.tar.gz: c36bdf80820bca705f95b4727c4153988684853d
5
+ SHA512:
6
+ metadata.gz: 60a2f501ed6b6178769df0ec38ed94a617e86158c19a88f3542bd444ce3a847e37d659ae0e0394bfa530d2f5f05021f17cd59269653aa1940834ea6039584a33
7
+ data.tar.gz: d75e61e84a176527a8a47902fd0d0ee61c308349f397797e59141c471ad5b1c00de78fa59aadd28b43ede4f8c591492f5fdfad4e6f645499961cf9a3bd8ffb92
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-disqus.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Ivan Correces
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Omniauth::Disqus
2
+
3
+ A Disqus OAuth2 strategy for OmniAuth.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'omniauth-disqus'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install omniauth-disqus
18
+
19
+ ## Usage
20
+
21
+ Register your application with Disqus to retrieve a public key and secret key: http://disqus.com/api/applications/
22
+
23
+ This is an example that you might put into a Rails initializer at `config/initializers/omniauth.rb`:
24
+
25
+ ```ruby
26
+ Rails.application.config.middleware.use OmniAuth::Builder do
27
+ provider :disqus, ENV['DISQUS_PUBLIC_KEY'], ENV['DISQUS_SECRET_KEY']
28
+ end
29
+ ```
30
+
31
+ You can now access the OmniAuth Disqus OAuth2 URL: `/auth/disqus`.
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it
36
+ 2. Create your feature branch (`git checkout -b feature/my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
38
+ 4. Push to the branch (`git push origin feature/my-new-feature`)
39
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,47 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Disqus < OmniAuth::Strategies::OAuth2
6
+ option :name, 'disqus'
7
+ option :scope, 'read'
8
+
9
+ option :client_options, {
10
+ :site => 'https://disqus.com',
11
+ :authorize_url => '/api/oauth/2.0/authorize/',
12
+ :token_url => '/api/oauth/2.0/access_token/'
13
+ }
14
+
15
+ uid { access_token.params['user_id'] }
16
+
17
+ info do
18
+ {
19
+ :name => raw_info['name'],
20
+ :nickname => raw_info['username'],
21
+ :location => raw_info['location'],
22
+ :description => raw_info['about'],
23
+ :image => raw_info['avatar']['small']['permalink'],
24
+ :urls => {
25
+ 'profileUrl' => raw_info['profileUrl']
26
+ }
27
+ }
28
+ end
29
+
30
+ extra do
31
+ {
32
+ :raw_info => raw_info
33
+ }
34
+ end
35
+
36
+ def raw_info
37
+ url = '/api/3.0/users/details.json'
38
+ params = {
39
+ 'api_key' => access_token.client.id,
40
+ 'access_token' => access_token.token
41
+ }
42
+
43
+ @raw_info ||= access_token.get(url, :params => params).parsed['response']
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Disqus
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require "omniauth-disqus/version"
2
+ require "omniauth/strategies/disqus"
@@ -0,0 +1,18 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth-disqus/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = 'omniauth-disqus'
6
+ gem.authors = [ 'Chris Lexmond' ]
7
+ gem.email = [ 'chris@chrislexmond.com' ]
8
+ gem.description = 'A Disqus OAuth2 strategy for OmniAuth'
9
+ gem.summary = 'A Disqus OAuth2 strategy for OmniAuth'
10
+ gem.homepage = ''
11
+
12
+ gem.add_runtime_dependency 'omniauth-oauth2'
13
+
14
+ gem.files = `git ls-files`.split($\)
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.require_paths = [ 'lib' ]
17
+ gem.version = Omniauth::Disqus::VERSION
18
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-disqus
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Lexmond
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-11 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: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A Disqus OAuth2 strategy for OmniAuth
28
+ email:
29
+ - chris@chrislexmond.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - lib/omniauth-disqus.rb
40
+ - lib/omniauth-disqus/version.rb
41
+ - lib/omniauth/strategies/disqus.rb
42
+ - omniauth-disqus.gemspec
43
+ homepage: ''
44
+ licenses: []
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.2.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: A Disqus OAuth2 strategy for OmniAuth
66
+ test_files: []