oa2c 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ notifications:
5
+ email:
6
+ - antondie@gmail.com
data/README.md CHANGED
@@ -54,6 +54,8 @@ Oa2c.setup do |config|
54
54
  user = Oa2c.user_model.constantize.where(email: username).first
55
55
  user if user.valid_password? password
56
56
  }
57
+ config.auto_approve = false # if true, don't show 'approve' / 'deny' buttons to user
58
+ config.layout = false # flase or symbol, just like in controllers
57
59
  end
58
60
  ```
59
61
 
@@ -1,6 +1,7 @@
1
1
  module Oa2c
2
2
  class AuthorizationsController < ApplicationController
3
3
  before_filter Oa2c.authentication_method, except: :token
4
+ layout Oa2c.layout
4
5
 
5
6
  rescue_from Rack::OAuth2::Server::Authorize::BadRequest do |e|
6
7
  @error = e
@@ -36,8 +37,8 @@ module Oa2c
36
37
  Rack::OAuth2::Server::Authorize.new do |req, res|
37
38
  @client = Client.where(identifier: req.client_id).first || req.bad_request!
38
39
  res.redirect_uri = @redirect_uri = req.verify_redirect_uri!(@client.redirect_uri)
39
- if allow_approval
40
- if params[:approve]
40
+ if allow_approval or Oa2c.auto_approve
41
+ if params[:approve] or Oa2c.auto_approve
41
42
  case req.response_type
42
43
  when :code
43
44
  authorization_code = send(Oa2c.current_user_method).authorization_codes.create(client_id: @client.id, redirect_uri: res.redirect_uri)
data/lib/oa2c.rb CHANGED
@@ -24,6 +24,12 @@ module Oa2c
24
24
  user if user.valid_password? password
25
25
  }
26
26
 
27
+ mattr_accessor :auto_approve
28
+ @@auto_approve = false
29
+
30
+ mattr_accessor :layout
31
+ @@layout = false
32
+
27
33
  def self.setup
28
34
  yield self
29
35
  end
data/lib/oa2c/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oa2c
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oa2c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -198,7 +198,6 @@ files:
198
198
  - .rspec
199
199
  - .travis.yml
200
200
  - Gemfile
201
- - Gemfile.lock
202
201
  - MIT-LICENSE
203
202
  - README.md
204
203
  - Rakefile
@@ -286,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
285
  version: '0'
287
286
  segments:
288
287
  - 0
289
- hash: 622341743
288
+ hash: -535493679
290
289
  required_rubygems_version: !ruby/object:Gem::Requirement
291
290
  none: false
292
291
  requirements:
@@ -295,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
294
  version: '0'
296
295
  segments:
297
296
  - 0
298
- hash: 622341743
297
+ hash: -535493679
299
298
  requirements: []
300
299
  rubyforge_project:
301
300
  rubygems_version: 1.8.24
data/Gemfile.lock DELETED
@@ -1,183 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- oa2c (0.1.0)
5
- mongoid (~> 3.0)
6
- rack-oauth2 (~> 0.14.9)
7
- rails (~> 3.2.0)
8
-
9
- GEM
10
- remote: http://rubygems.org/
11
- specs:
12
- actionmailer (3.2.8)
13
- actionpack (= 3.2.8)
14
- mail (~> 2.4.4)
15
- actionpack (3.2.8)
16
- activemodel (= 3.2.8)
17
- activesupport (= 3.2.8)
18
- builder (~> 3.0.0)
19
- erubis (~> 2.7.0)
20
- journey (~> 1.0.4)
21
- rack (~> 1.4.0)
22
- rack-cache (~> 1.2)
23
- rack-test (~> 0.6.1)
24
- sprockets (~> 2.1.3)
25
- activemodel (3.2.8)
26
- activesupport (= 3.2.8)
27
- builder (~> 3.0.0)
28
- activerecord (3.2.8)
29
- activemodel (= 3.2.8)
30
- activesupport (= 3.2.8)
31
- arel (~> 3.0.2)
32
- tzinfo (~> 0.3.29)
33
- activeresource (3.2.8)
34
- activemodel (= 3.2.8)
35
- activesupport (= 3.2.8)
36
- activesupport (3.2.8)
37
- i18n (~> 0.6)
38
- multi_json (~> 1.0)
39
- addressable (2.3.2)
40
- arel (3.0.2)
41
- attr_required (0.0.5)
42
- bcrypt-ruby (3.0.1)
43
- builder (3.0.2)
44
- capybara (1.1.2)
45
- mime-types (>= 1.16)
46
- nokogiri (>= 1.3.3)
47
- rack (>= 1.0.0)
48
- rack-test (>= 0.5.4)
49
- selenium-webdriver (~> 2.0)
50
- xpath (~> 0.1.4)
51
- childprocess (0.3.5)
52
- ffi (~> 1.0, >= 1.0.6)
53
- coderay (1.0.7)
54
- database_cleaner (0.8.0)
55
- devise (2.1.2)
56
- bcrypt-ruby (~> 3.0)
57
- orm_adapter (~> 0.1)
58
- railties (~> 3.1)
59
- warden (~> 1.2.1)
60
- diff-lcs (1.1.3)
61
- erubis (2.7.0)
62
- factory_girl (4.0.0)
63
- activesupport (>= 3.0.0)
64
- factory_girl_rails (4.0.0)
65
- factory_girl (~> 4.0.0)
66
- railties (>= 3.0.0)
67
- ffi (1.1.5)
68
- hike (1.2.1)
69
- httpclient (2.2.7)
70
- i18n (0.6.1)
71
- journey (1.0.4)
72
- jquery-rails (2.1.2)
73
- railties (>= 3.1.0, < 5.0)
74
- thor (~> 0.14)
75
- json (1.7.5)
76
- libwebsocket (0.1.5)
77
- addressable
78
- mail (2.4.4)
79
- i18n (>= 0.4.0)
80
- mime-types (~> 1.16)
81
- treetop (~> 1.4.8)
82
- method_source (0.8)
83
- mime-types (1.19)
84
- mongoid (3.0.5)
85
- activemodel (~> 3.1)
86
- moped (~> 1.1)
87
- origin (~> 1.0)
88
- tzinfo (~> 0.3.22)
89
- moped (1.2.1)
90
- multi_json (1.3.6)
91
- nokogiri (1.5.5)
92
- origin (1.0.8)
93
- orm_adapter (0.4.0)
94
- polyglot (0.3.3)
95
- pry (0.9.10)
96
- coderay (~> 1.0.5)
97
- method_source (~> 0.8)
98
- slop (~> 3.3.1)
99
- pry-rails (0.2.1)
100
- pry (>= 0.9.10)
101
- rack (1.4.1)
102
- rack-cache (1.2)
103
- rack (>= 0.4)
104
- rack-oauth2 (0.14.9)
105
- activesupport (>= 2.3)
106
- attr_required (>= 0.0.5)
107
- httpclient (>= 2.2.0.2)
108
- i18n
109
- multi_json (>= 1.3.6)
110
- rack (>= 1.1)
111
- rack-ssl (1.3.2)
112
- rack
113
- rack-test (0.6.1)
114
- rack (>= 1.0)
115
- rails (3.2.8)
116
- actionmailer (= 3.2.8)
117
- actionpack (= 3.2.8)
118
- activerecord (= 3.2.8)
119
- activeresource (= 3.2.8)
120
- activesupport (= 3.2.8)
121
- bundler (~> 1.0)
122
- railties (= 3.2.8)
123
- railties (3.2.8)
124
- actionpack (= 3.2.8)
125
- activesupport (= 3.2.8)
126
- rack-ssl (~> 1.3.2)
127
- rake (>= 0.8.7)
128
- rdoc (~> 3.4)
129
- thor (>= 0.14.6, < 2.0)
130
- rake (0.9.2.2)
131
- rdoc (3.12)
132
- json (~> 1.4)
133
- rspec (2.11.0)
134
- rspec-core (~> 2.11.0)
135
- rspec-expectations (~> 2.11.0)
136
- rspec-mocks (~> 2.11.0)
137
- rspec-core (2.11.1)
138
- rspec-expectations (2.11.3)
139
- diff-lcs (~> 1.1.3)
140
- rspec-mocks (2.11.2)
141
- rspec-rails (2.11.0)
142
- actionpack (>= 3.0)
143
- activesupport (>= 3.0)
144
- railties (>= 3.0)
145
- rspec (~> 2.11.0)
146
- rubyzip (0.9.9)
147
- selenium-webdriver (2.25.0)
148
- childprocess (>= 0.2.5)
149
- libwebsocket (~> 0.1.3)
150
- multi_json (~> 1.0)
151
- rubyzip
152
- slop (3.3.3)
153
- sprockets (2.1.3)
154
- hike (~> 1.2)
155
- rack (~> 1.0)
156
- tilt (~> 1.1, != 1.3.0)
157
- sqlite3 (1.3.6)
158
- thor (0.16.0)
159
- tilt (1.3.3)
160
- timecop (0.4.6)
161
- treetop (1.4.10)
162
- polyglot
163
- polyglot (>= 0.3.1)
164
- tzinfo (0.3.33)
165
- warden (1.2.1)
166
- rack (>= 1.0)
167
- xpath (0.1.4)
168
- nokogiri (~> 1.3)
169
-
170
- PLATFORMS
171
- ruby
172
-
173
- DEPENDENCIES
174
- capybara
175
- database_cleaner
176
- devise
177
- factory_girl_rails
178
- jquery-rails
179
- oa2c!
180
- pry-rails
181
- rspec-rails
182
- sqlite3
183
- timecop