omniauth-feedly 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bb5cd4dcb145d73ca291bc730c8b47565c98e796
4
+ data.tar.gz: 4d7e204943a0b9846d7e0f534da30e20d75cce39
5
+ SHA512:
6
+ metadata.gz: f897fde71afc77e9bba219f7bd3f2e47efcc4cd315a54f96fc3351daceb229d313480b8c190a5120669a86907049b423bcb496dfdc4d54e51ec6f4edebb581e8
7
+ data.tar.gz: f4e465e5991fb94456e0095182f7d988168369eae6ecd1e4d0c3862cd271567fc6a19bc5b1d7b57c5969110c2f82a8f8f7c02b6772a2c6acba3d8f3227232ceb
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-feedly.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 John Potter
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,89 @@
1
+ # OmniAuth for Feedly
2
+
3
+ Unofficial OmniAuth strategy for Feedly OAuth 2.
4
+
5
+ For more on the Feedly API, go to [developer.feedly.com](https://developer.feedly.com/).
6
+
7
+ You can also check out the developer forum at https://groups.google.com/forum/#!forum/feedly-cloud.
8
+
9
+ Once you authorize your user, you can make calls to the Feedly API using the gem (Feedlr)[https://github.com/khelll/feedlr]
10
+
11
+ ## Getting Started
12
+
13
+ ###For Development
14
+
15
+ Feedly development is done on sandbox.feedly.com.
16
+
17
+ You will need to use the sandbox id and secret. You can find that info here: [forum post](https://groups.google.com/forum/#!topic/feedly-cloud/ZNn0UUOyCZw)
18
+
19
+ The callback url used needs to be one that Feedly has in their system. The callback this gem uses is: http://localhost:3000/auth/feedly/callback. That means that you must make calls from 'http://localhost:3000'.
20
+
21
+ You are welcome to set your own callback url, but you will have to have Feedly add it on their end as well.
22
+
23
+ More info about the sandbox: [docs](https://developer.feedly.com/v3/sandbox/).
24
+
25
+ ###For Production
26
+
27
+ Straight from Feedly's mouth ([forum post](https://groups.google.com/forum/#!topic/feedly-cloud/ZNn0UUOyCZw)):
28
+
29
+ >When your app is ready to go live, please fill this form:
30
+
31
+ >http://goo.gl/forms/bHt5g5mD4q
32
+
33
+ >We will send you back a permanent production key and list you in the http://www.feedly.com/apps.html so that feedly users can discover your apps.
34
+ >We look forward to see your creativity at work!
35
+
36
+ ## Installation
37
+
38
+ Add this line to your application's Gemfile:
39
+
40
+ ```ruby
41
+ gem 'omniauth-feedly'
42
+ ```
43
+
44
+ And then execute:
45
+
46
+ $ bundle
47
+
48
+ Or install it yourself as:
49
+
50
+ $ gem install omniauth-feedly
51
+
52
+ ## Usage
53
+
54
+ ### For Development (sandbox.feedly.com)
55
+ Remember: Calls must be made from http://localhost:3000 (see Getting Started for more info)
56
+ ```ruby
57
+ Rails.application.config.middleware.use OmniAuth::Builder do
58
+ provider :feedly, ENV['FEEDLY_SANDBOX_KEY'], ENV['FEEDLY_SANDBOX_SECRET'],
59
+ :client_options => {
60
+ :site => 'https://sandbox.feedly.com'
61
+ }
62
+ end
63
+ ```
64
+
65
+ ### For Production (cloud.feedly.com)
66
+ ```ruby
67
+ Rails.application.config.middleware.use OmniAuth::Builder do
68
+ provider :feedly, ENV['FEEDLY_KEY'], ENV['FEEDLY_SECRET']
69
+ end
70
+ ```
71
+
72
+ ### Routing the callback
73
+ Simply add to your routes.rb file:
74
+ ```ruby
75
+ get '/auth/feedly/callback', to: 'your_controller#your_action'
76
+ ```
77
+
78
+ For more on integrating OmniAuth into your app: [OmniAuth Gem](https://github.com/intridea/omniauth#integrating-omniauth-into-your-application)
79
+
80
+
81
+ ## Contributing
82
+
83
+ If anything changes with how feedly handles developer registration or the api, please let me know so I can update the README and/or code.
84
+
85
+ 1. Fork it ( https://github.com/johnmpotter/omniauth-feedly/fork )
86
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
87
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
88
+ 4. Push to the branch (`git push origin my-new-feature`)
89
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/lib/.DS_Store ADDED
Binary file
@@ -0,0 +1,2 @@
1
+ require 'omniauth-feedly/version'
2
+ require 'omniauth/strategies/feedly'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Feedly
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
Binary file
@@ -0,0 +1,53 @@
1
+ require "omniauth-oauth2"
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Feedly < OmniAuth::Strategies::OAuth2
6
+
7
+ DEFAULT_SCOPE = 'https://cloud.feedly.com/subscriptions'
8
+
9
+ option :name => 'feedly'
10
+
11
+ option :client_options, {
12
+ :site => 'https://cloud.feedly.com',
13
+ :authorize_url => '/v3/auth/auth',
14
+ :token_url => '/v3/auth/token',
15
+ :scope => 'https://cloud.feedly.com/subscriptions',
16
+ :response_type => 'code'
17
+ }
18
+
19
+ option :access_token_options, {
20
+ :header_format => 'OAuth %s',
21
+ :param_name => 'access_token'
22
+ }
23
+
24
+ uid{ raw_info['id'] }
25
+
26
+ info do
27
+ {
28
+ :email => raw_info['email']
29
+ }
30
+ end
31
+
32
+ extra do
33
+ {
34
+ 'raw_info' => raw_info
35
+ }
36
+ end
37
+
38
+ def raw_info
39
+ @raw_info ||= access_token.get('/v3/profile').parsed
40
+ end
41
+
42
+
43
+ def authorize_params
44
+ # Borrowed from omniauth-orchid who borrowed from omniauth-facebook
45
+ super.tap do |params|
46
+ %w[scope].each { |v| params[v.to_sym] = request.params[v] if request.params[v] }
47
+ params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope
48
+ end
49
+ end
50
+
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth-feedly/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "omniauth-feedly"
8
+ spec.version = OmniAuth::Feedly::VERSION
9
+ spec.authors = ["John Potter"]
10
+ spec.email = ["johnpotter1440@gmail.com"]
11
+ spec.summary = %q{Unofficial OmniAuth strategy for Feedly}
12
+ spec.homepage = "https://github.com/johnmpotter/omniauth-feedly"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency 'omniauth', '~> 1.0'
21
+ spec.add_dependency 'omniauth-oauth2', '~> 1.0'
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-feedly
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - John Potter
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
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
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description:
70
+ email:
71
+ - johnpotter1440@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".DS_Store"
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - lib/.DS_Store
83
+ - lib/omniauth-feedly.rb
84
+ - lib/omniauth-feedly/version.rb
85
+ - lib/omniauth/.DS_Store
86
+ - lib/omniauth/strategies/feedly.rb
87
+ - omniauth-feedly.gemspec
88
+ homepage: https://github.com/johnmpotter/omniauth-feedly
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.4.5
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Unofficial OmniAuth strategy for Feedly
112
+ test_files: []