roqua-core-api 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 776f395e58e35a163a8cf359bf7ed7a9adb92640
4
- data.tar.gz: 6f67e6d17775b95634091464d00fd2cd51a5f6c8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTQ0MmE2MjcyZmVmYWYyNWNmOTk5MmQ1NzY2YWY0MGMyMzYyYzk2Nw==
5
+ data.tar.gz: !binary |-
6
+ OTE1MTMzMWRjY2UyOTYxMThlMTgyMzRjNDhkYmM0MDI3ZTA3OGRlZA==
5
7
  SHA512:
6
- metadata.gz: 7d809b97af2274782685951e8b56aab182a3971853f9f0b216cbfea27354b379aca75da8f83d1b60d2fd4a0798c38a846a177e669732f773581899759fa15668
7
- data.tar.gz: a5c119317306ee2b85ea073d557a2250dbc08bb2b24379fef8e7f5b62ce7d9e3dd051fe57d17ecbabe5db8b4b432087d55bc73dab2cc7fd0489cea9da25fb36e
8
+ metadata.gz: !binary |-
9
+ NTQ4MGRlZWJhNDIyYzY1NGI5MjVkNjZjM2U3ZDA2NTc3OGNlNzMzNzkyYzJk
10
+ YzFlZTBlYzIzMWM5Y2Y3OGM0ZTVhMTBlYzU5NjE5NzE1OGQ3NDYwYzA1NTE0
11
+ MDg1OGQ1Y2RlMTMzNDE0ZDUzMWEzNGE0NDQzMGFjYjI3ZjgxODM=
12
+ data.tar.gz: !binary |-
13
+ NTMzOGZjMjI4MjA0OTI3OTgyNDljMjI5ZWZjMzFkYjQ0N2RkMTdiZTQ5ODE5
14
+ MzliZDM0ZWYyZTdhZTg3NjMyMDA3OWE2ZDU5OGZmNzI2MTViZjc0NDc1YTMy
15
+ YjY5Njg3MDE5MTk4YTIzOTc4MDU0MjA4MzQwMzI3YTA5NTdiYjk=
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.0.9 / 2014-02-27
2
+
3
+ * Add core-api omniauth rails config
4
+
1
5
  ### 0.0.7 / 2014-02-27
2
6
 
3
7
  * Added logout_url method
@@ -9,6 +9,11 @@ module Roqua
9
9
  super(dossier_group_id, organization_id, server_url)
10
10
  end
11
11
 
12
+ def send_invite_email
13
+ response = post '/send_invite_email'
14
+ fail response.inspect unless response.code == 201
15
+ end
16
+
12
17
  private
13
18
 
14
19
  def base_url
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module CoreApi
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -0,0 +1,19 @@
1
+ require 'omniauth-oauth2'
2
+ require 'roqua/omniauth/strategies/doorkeeper'
3
+
4
+ OmniAuth.config.logger = Rails.logger
5
+
6
+ Rails.application.config.middleware.use OmniAuth::Builder do
7
+ case Rails.env
8
+ when 'development', 'test'
9
+ provider :doorkeeper,
10
+ 'b30f46f3e991d87f52f54365dda6b147d74039fd9c0336490ab41a7254702651',
11
+ '49b42787e6fcf9d42878c62c77817a92251abf48923d8c269c9c088e66066fd2',
12
+ client_options: {site: 'http://core.dev'}
13
+ else
14
+ provider :doorkeeper,
15
+ ENV['CORE_OAUTH_CLIENT_ID'],
16
+ ENV['CORE_OAUTH_CLIENT_SECRET'],
17
+ client_options: {site: ENV['CORE_OAUTH_URL']}
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ module OmniAuth
2
+ module Strategies
3
+ class Doorkeeper < OmniAuth::Strategies::OAuth2
4
+ option :name, :doorkeeper
5
+ option :client_options, site: 'http://core.dev',
6
+ authorize_path: '/oauth/authorize'
7
+
8
+ uid do
9
+ raw_info["id"]
10
+ end
11
+
12
+ info do
13
+ {dossier_id: raw_info['dossier_id'],
14
+ dossier_group_id: raw_info['dossier_group_id'],
15
+ organization_id: raw_info['organization_id'],
16
+ username: raw_info['username'],
17
+ email: raw_info['email']}
18
+ end
19
+
20
+ def raw_info
21
+ @raw_info ||= access_token.get('/api/v1/me.json').parsed
22
+ end
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-core-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
@@ -14,112 +14,112 @@ dependencies:
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.12.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.12.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.8'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.8'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 3.0.0.beta1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0.beta1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: vcr
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 2.8.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 2.8.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.17.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.17.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: fabrication
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 2.9.6
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: 2.9.6
125
125
  description: Provides authenticated access to Core
@@ -128,10 +128,10 @@ executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
- - ".document"
132
- - ".gitignore"
133
- - ".rspec"
134
- - ".yardopts"
131
+ - .document
132
+ - .gitignore
133
+ - .rspec
134
+ - .yardopts
135
135
  - ChangeLog.md
136
136
  - Gemfile
137
137
  - Guardfile
@@ -151,6 +151,8 @@ files:
151
151
  - lib/roqua/core_api/sessions/oauth_session.rb
152
152
  - lib/roqua/core_api/sessions/organization_session.rb
153
153
  - lib/roqua/core_api/version.rb
154
+ - lib/roqua/omniauth/rails_initializer.rb
155
+ - lib/roqua/omniauth/strategies/doorkeeper.rb
154
156
  - spec/core_api_spec.rb
155
157
  - spec/fabricators/dossier_fabricator.rb
156
158
  - spec/fabricators/dossier_group_fabricator.rb
@@ -169,17 +171,17 @@ require_paths:
169
171
  - lib
170
172
  required_ruby_version: !ruby/object:Gem::Requirement
171
173
  requirements:
172
- - - ">="
174
+ - - ! '>='
173
175
  - !ruby/object:Gem::Version
174
176
  version: '0'
175
177
  required_rubygems_version: !ruby/object:Gem::Requirement
176
178
  requirements:
177
- - - ">="
179
+ - - ! '>='
178
180
  - !ruby/object:Gem::Version
179
181
  version: '0'
180
182
  requirements: []
181
183
  rubyforge_project:
182
- rubygems_version: 2.2.0
184
+ rubygems_version: 2.2.1
183
185
  signing_key:
184
186
  specification_version: 4
185
187
  summary: API wrapper gem around Core's API
@@ -192,3 +194,4 @@ test_files:
192
194
  - spec/lib/roqua/core_api/sessions/dossier_group_session_spec.rb
193
195
  - spec/lib/roqua/core_api/sessions/organization_session_spec.rb
194
196
  - spec/spec_helper.rb
197
+ has_rdoc: