omniauth-bitreserve 0.0.1.pre.alpha

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: 00cb57c03671f5faedc11023814a6c365bd32562
4
+ data.tar.gz: 72a319370061da170ad663c9ee13a88a426391ca
5
+ SHA512:
6
+ metadata.gz: 68d67f38b79597c781ae8eafb7978557053b9c7ae914baa1572eaef43d49001c8c5cc7c1c3d21926dba0e57021d5074d90c70ab82ef604f3aaec4ed2e65ac38c
7
+ data.tar.gz: 69049fa7d71af02a0e37fd2054e0dfa7737808019113bc460c393fc3b665b9b7da19b01cf4757a08bb6a6ed06ad81f5afc13b69a69065419e1571e5c3a8742b0
data/.gitignore ADDED
@@ -0,0 +1,15 @@
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
15
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,34 @@
1
+ AllCops:
2
+ Include:
3
+ - '**/Rakefile'
4
+ - '**/config.ru'
5
+ Exclude:
6
+ - 'db/**/*'
7
+ - 'config/**/*'
8
+ - 'script/**/*'
9
+ - 'bin/**/*'
10
+ - 'vendor/**/*'
11
+
12
+ Metrics/LineLength:
13
+ Enabled: false
14
+
15
+ Style/AlignParameters:
16
+ EnforcedStyle: with_fixed_indentation
17
+
18
+ Style/ClassAndModuleChildren:
19
+ Enabled: false
20
+
21
+ Style/Documentation:
22
+ Enabled: false
23
+
24
+ Style/DotPosition:
25
+ EnforcedStyle: trailing
26
+
27
+ Style/IfUnlessModifier:
28
+ Enabled: false
29
+
30
+ Style/RegexpLiteral:
31
+ MaxSlashes: 0
32
+
33
+ Style/FileName:
34
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Group Buddies
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,35 @@
1
+ # Omniauth Bitreserve
2
+
3
+ This gem contains the [Bitreserve](https://bitreserve.org/) strategy for OmniAuth
4
+
5
+ ## Using this strategy
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'omniauth-bitreserve'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install omniauth-bitreserve
20
+
21
+ Now you must tell OmniAuth about this provider, For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
22
+
23
+ ```ruby
24
+ Rails.application.config.middleware.use OmniAuth::Builder do
25
+ provider :bitreserve, 'API_KEY', 'API_SECRET'
26
+ end
27
+ ```
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it ( https://github.com/[my-github-username]/omniauth-Bitreserve/fork )
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rubocop/rake_task'
3
+ require 'rspec/core/rake_task'
4
+ RuboCop::RakeTask.new
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task default: [:rubocop, :spec]
@@ -0,0 +1,29 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Bitreserve < ::OmniAuth::Strategies::OAuth2
6
+ include ::OmniAuth::Strategy
7
+
8
+ URL = ENV['BITRESERVE_API_URL'] || 'https://api.bitreserve.org'
9
+ PATH = '/oauth/authorize'
10
+
11
+ option :name, :bitreserve
12
+ option :client_options, site: URL, authorize_url: PATH
13
+
14
+ uid do
15
+ raw_info['id']
16
+ end
17
+
18
+ info do
19
+ {
20
+ email: raw_info['email']
21
+ }
22
+ end
23
+
24
+ def raw_info
25
+ @raw_info ||= access_token.get('/me').parsed
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Bitreserve
3
+ VERSION = '0.0.1-alpha'
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth-bitreserve/version'
2
+ require 'omniauth/strategies/bitreserve'
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth-bitreserve/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'omniauth-bitreserve'
8
+ spec.version = Omniauth::Bitreserve::VERSION
9
+ spec.authors = ['Miguel Palhas']
10
+ spec.email = ['mpalhas@groupbuddies.com']
11
+ spec.summary = 'OAuth2 strategy for the Bitreserve API, by Group Buddies'
12
+ spec.description = 'OAuth2 strategy for the Bitreserve API, by Group Buddies'
13
+ spec.homepage = 'https://github.com/groupbuddies/omniauth-Bitreserve'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'omniauth', '~> 1.2', '>= 1.2.2'
22
+ spec.add_dependency 'omniauth-oauth2', '~> 1.2', '>= 1.2.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.7'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rubocop', '~> 0.27.1'
27
+ spec.add_development_dependency 'rspec', '~> 3.1', '~> 3.1.0'
28
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+ require 'omniauth/strategies/bitreserve'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ describe Bitreserve do
7
+ let(:request) { double('Request', params: {}, cookies: {}, env: {}) }
8
+
9
+ subject do
10
+ args = ['appid', 'secret', @options || {}].compact
11
+ OmniAuth::Strategies::Bitreserve.new(*args).tap do |strategy|
12
+ allow(strategy).to receive(:request) {
13
+ request
14
+ }
15
+ end
16
+ end
17
+
18
+ describe 'client options' do
19
+ it 'should have correct name' do
20
+ expect(subject.options.name).to eq(:bitreserve)
21
+ end
22
+
23
+ it 'should have correct site' do
24
+ expect(subject.options.client_options.site).to eq('https://api.bitreserve.org')
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth-bitreserve'
2
+ require 'rspec'
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-bitreserve
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre.alpha
5
+ platform: ruby
6
+ authors:
7
+ - Miguel Palhas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-11 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.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.2.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: omniauth-oauth2
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.2'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.2.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.2'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.2.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: bundler
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.7'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1.7'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rake
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '10.0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '10.0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rubocop
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: 0.27.1
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: 0.27.1
95
+ - !ruby/object:Gem::Dependency
96
+ name: rspec
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '3.1'
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 3.1.0
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '3.1'
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: 3.1.0
115
+ description: OAuth2 strategy for the Bitreserve API, by Group Buddies
116
+ email:
117
+ - mpalhas@groupbuddies.com
118
+ executables: []
119
+ extensions: []
120
+ extra_rdoc_files: []
121
+ files:
122
+ - ".gitignore"
123
+ - ".rubocop.yml"
124
+ - Gemfile
125
+ - LICENSE.txt
126
+ - README.md
127
+ - Rakefile
128
+ - lib/omniauth-bitreserve.rb
129
+ - lib/omniauth-bitreserve/version.rb
130
+ - lib/omniauth/strategies/bitreserve.rb
131
+ - omniauth-bitreserve.gemspec
132
+ - spec/omniauth/strategies/bitreserve_spec.rb
133
+ - spec/spec_helper.rb
134
+ homepage: https://github.com/groupbuddies/omniauth-Bitreserve
135
+ licenses:
136
+ - MIT
137
+ metadata: {}
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">"
150
+ - !ruby/object:Gem::Version
151
+ version: 1.3.1
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.4.6
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: OAuth2 strategy for the Bitreserve API, by Group Buddies
158
+ test_files:
159
+ - spec/omniauth/strategies/bitreserve_spec.rb
160
+ - spec/spec_helper.rb
161
+ has_rdoc: