omniauth-aqua 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +5 -0
- data/README.md +3 -0
- data/Rakefile +8 -0
- data/lib/omniauth-aqua.rb +2 -0
- data/lib/omniauth-aqua/version.rb +5 -0
- data/lib/omniauth/strategies/aqua.rb +55 -0
- data/omniauth-aqua.gemspec +28 -0
- data/spec/omniauth/strategies/aqua_spec.rb +25 -0
- data/spec/spec_helper.rb +18 -0
- metadata +142 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8c2b7242692d2de41ae4e6e895d11cb9fb7ad412
|
4
|
+
data.tar.gz: 6d260d937a2041784ece64e9736b78de28ae3563
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5a947207bc4dd503fb86115cda2eeecd5fdb78da5e4fb4df4b62886738b264d24dce21b30723e5a72198ff0733f4cf52b6e09a2030838d55e586bf4e4f59e1f7
|
7
|
+
data.tar.gz: 745327178b17fcb0652193af90b6a501e0b7c6df7792ff527eeb4e64deb4c42c373d4c757dfa67da65d16fa6f5283e7b0300376406cbc5b545a16d29b9a2035f
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
require 'multi_json'
|
3
|
+
|
4
|
+
module OmniAuth
|
5
|
+
module Strategies
|
6
|
+
|
7
|
+
class AquaProvider < OmniAuth::Strategies::OAuth2
|
8
|
+
option :name, 'aqua_provider'
|
9
|
+
|
10
|
+
option :client_options, {
|
11
|
+
:site => 'http://api.aqua.io',
|
12
|
+
:authorize_path => 'providers/oauth/authenticate',
|
13
|
+
:request_token_path => 'providers/oauth/token'
|
14
|
+
}
|
15
|
+
|
16
|
+
uid { raw_info['provider_uid'] }
|
17
|
+
|
18
|
+
info do
|
19
|
+
{
|
20
|
+
:provider_uid => raw_info['provider_uid'],
|
21
|
+
:first_name => raw_info['first_name'],
|
22
|
+
:middle_name => raw_info['middle_name'],
|
23
|
+
:last_name => raw_info['last_name'],
|
24
|
+
:user_type => raw_info['user_type'],
|
25
|
+
:specialty => raw_info['specialty'],
|
26
|
+
:organization => raw_info['organization'],
|
27
|
+
:email => raw_info['email']
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
extra do
|
32
|
+
{ :raw_info => raw_info }
|
33
|
+
end
|
34
|
+
|
35
|
+
def raw_info
|
36
|
+
@raw_info ||= MultiJson.decode(access_token.get('beta/providers/me.json').body)
|
37
|
+
rescue ::Errno::ETIMEDOUT
|
38
|
+
raise ::Timeout::Error
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
class AquaProviderSandbox < AquaProvider
|
44
|
+
option :name, 'aqua_provider_sandbox'
|
45
|
+
|
46
|
+
option :client_options, {
|
47
|
+
:site => 'http://sandbox.aqua.io',
|
48
|
+
:authorize_path => 'providers/oauth/authenticate',
|
49
|
+
:request_token_path => 'providers/oauth/token'
|
50
|
+
}
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "omniauth-aqua/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "omniauth-aqua"
|
7
|
+
s.version = OmniAuth::Aqua::VERSION
|
8
|
+
s.authors = ["Michael Carroll"]
|
9
|
+
s.email = ["michael@aqua.io"]
|
10
|
+
s.homepage = "https://github.com/aquaio/omniauth-aqua"
|
11
|
+
s.summary = %q{OmniAuth strategy for Aqua.io}
|
12
|
+
s.description = %q{OmniAuth strategy for Aqua.io}
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.rubyforge_project = "omniauth-aqua"
|
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_dependency 'multi_json', '~> 1.3'
|
23
|
+
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.1'
|
24
|
+
s.add_development_dependency 'rspec', '~> 2.7'
|
25
|
+
s.add_development_dependency 'rack-test'
|
26
|
+
s.add_development_dependency 'simplecov'
|
27
|
+
s.add_development_dependency 'webmock'
|
28
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OmniAuth::Strategies::Aqua do
|
4
|
+
let(:request) { double('Request', :params => {}, :cookies => {}, :env => {}) }
|
5
|
+
|
6
|
+
subject do
|
7
|
+
args = ['appid', 'secret', @options || {}].compact
|
8
|
+
OmniAuth::Strategies::Aqua.new(*args).tap do |strategy|
|
9
|
+
strategy.stub(:request) {
|
10
|
+
request
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'client options' do
|
16
|
+
it 'should have correct name' do
|
17
|
+
expect(subject.options.name).to eq('aqua')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should have correct site' do
|
21
|
+
expect(subject.options.client_options.site).to eq('http://api.aqua.io')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start
|
5
|
+
require 'rspec'
|
6
|
+
require 'rack/test'
|
7
|
+
require 'webmock/rspec'
|
8
|
+
require 'omniauth'
|
9
|
+
require 'omniauth-aqua'
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
config.include WebMock::API
|
13
|
+
config.include Rack::Test::Methods
|
14
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
15
|
+
config.expect_with :rspec do |c|
|
16
|
+
c.syntax = :expect
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-aqua
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Carroll
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: multi_json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
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.1.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rack-test
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webmock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: OmniAuth strategy for Aqua.io
|
98
|
+
email:
|
99
|
+
- michael@aqua.io
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- .gitignore
|
105
|
+
- .rspec
|
106
|
+
- .travis.yml
|
107
|
+
- Gemfile
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- lib/omniauth-aqua.rb
|
111
|
+
- lib/omniauth-aqua/version.rb
|
112
|
+
- lib/omniauth/strategies/aqua.rb
|
113
|
+
- omniauth-aqua.gemspec
|
114
|
+
- spec/omniauth/strategies/aqua_spec.rb
|
115
|
+
- spec/spec_helper.rb
|
116
|
+
homepage: https://github.com/aquaio/omniauth-aqua
|
117
|
+
licenses:
|
118
|
+
- MIT
|
119
|
+
metadata: {}
|
120
|
+
post_install_message:
|
121
|
+
rdoc_options: []
|
122
|
+
require_paths:
|
123
|
+
- lib
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
requirements: []
|
135
|
+
rubyforge_project: omniauth-aqua
|
136
|
+
rubygems_version: 2.1.11
|
137
|
+
signing_key:
|
138
|
+
specification_version: 4
|
139
|
+
summary: OmniAuth strategy for Aqua.io
|
140
|
+
test_files:
|
141
|
+
- spec/omniauth/strategies/aqua_spec.rb
|
142
|
+
- spec/spec_helper.rb
|