opro 0.2.0 → 0.2.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/app/models/opro/oauth/auth_grant.rb +2 -9
- data/app/models/opro/oauth/client_app.rb +1 -0
- data/opro.gemspec +3 -3
- data/test/dummy/config/application.rb +2 -0
- data/test/dummy/db/schema.rb +23 -1
- metadata +32 -32
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1.pre
|
@@ -14,19 +14,12 @@ class Opro::Oauth::AuthGrant < ActiveRecord::Base
|
|
14
14
|
|
15
15
|
serialize :permissions, Hash
|
16
16
|
|
17
|
+
attr_accessible :code, :access_token, :refresh_token, :access_token_expires_at, :permissions, :user_id, :user, :application_id, :application
|
18
|
+
|
17
19
|
def can?(value)
|
18
20
|
permissions[value.to_s]
|
19
21
|
end
|
20
22
|
|
21
|
-
def self.prune!
|
22
|
-
return false unless ::Opro.require_refresh_within.present?
|
23
|
-
|
24
|
-
time_to_expire = ::Opro.require_refresh_within.ago.in_time_zone
|
25
|
-
find_each(:conditions => ["created_at < ?", time_to_expire]) do |grant|
|
26
|
-
# grant.
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
23
|
def expired?
|
31
24
|
return false unless ::Opro.require_refresh_within.present?
|
32
25
|
return expires_in < 0
|
data/opro.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "opro"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["schneems"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-29"
|
13
13
|
s.description = " Enable OAuth clients (iphone, android, web sites, etc.) to access and use your Rails application, what you do with it is up to you"
|
14
14
|
s.email = "richard.schneeman@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20120618085752) do
|
15
15
|
|
16
16
|
create_table "opro_access_grants", :force => true do |t|
|
17
17
|
t.string "code"
|
@@ -25,6 +25,18 @@ ActiveRecord::Schema.define(:version => 20120514060323) do
|
|
25
25
|
t.datetime "updated_at", :null => false
|
26
26
|
end
|
27
27
|
|
28
|
+
create_table "opro_auth_grants", :force => true do |t|
|
29
|
+
t.string "code"
|
30
|
+
t.string "access_token"
|
31
|
+
t.string "refresh_token"
|
32
|
+
t.text "permissions"
|
33
|
+
t.datetime "access_token_expires_at"
|
34
|
+
t.integer "user_id"
|
35
|
+
t.integer "application_id"
|
36
|
+
t.datetime "created_at", :null => false
|
37
|
+
t.datetime "updated_at", :null => false
|
38
|
+
end
|
39
|
+
|
28
40
|
create_table "opro_client_applications", :force => true do |t|
|
29
41
|
t.string "name"
|
30
42
|
t.string "app_id"
|
@@ -35,6 +47,16 @@ ActiveRecord::Schema.define(:version => 20120514060323) do
|
|
35
47
|
t.datetime "updated_at", :null => false
|
36
48
|
end
|
37
49
|
|
50
|
+
create_table "opro_client_apps", :force => true do |t|
|
51
|
+
t.string "name"
|
52
|
+
t.string "app_id"
|
53
|
+
t.string "app_secret"
|
54
|
+
t.text "permissions"
|
55
|
+
t.integer "user_id"
|
56
|
+
t.datetime "created_at", :null => false
|
57
|
+
t.datetime "updated_at", :null => false
|
58
|
+
end
|
59
|
+
|
38
60
|
create_table "users", :force => true do |t|
|
39
61
|
t.string "email", :default => "", :null => false
|
40
62
|
t.string "encrypted_password", :default => "", :null => false
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1.pre
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- schneems
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70215497549500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70215497549500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70215497548240 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.1.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70215497548240
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bluecloth
|
38
|
-
requirement: &
|
38
|
+
requirement: &70215497547600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70215497547600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mocha
|
49
|
-
requirement: &
|
49
|
+
requirement: &70215497547000 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70215497547000
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: timecop
|
60
|
-
requirement: &
|
60
|
+
requirement: &70215497546400 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70215497546400
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &70215497539640 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.6.4
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70215497539640
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: bundler
|
82
|
-
requirement: &
|
82
|
+
requirement: &70215497539100 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.1.3
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70215497539100
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: capybara
|
93
|
-
requirement: &
|
93
|
+
requirement: &70215497538580 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.4.0
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70215497538580
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: sqlite3
|
104
|
-
requirement: &
|
104
|
+
requirement: &70215497537940 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70215497537940
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: launchy
|
115
|
-
requirement: &
|
115
|
+
requirement: &70215497537200 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70215497537200
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: devise
|
126
|
-
requirement: &
|
126
|
+
requirement: &70215497536340 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70215497536340
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: rcov
|
137
|
-
requirement: &
|
137
|
+
requirement: &70215497535020 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70215497535020
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: simplecov
|
148
|
-
requirement: &
|
148
|
+
requirement: &70215497534320 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *70215497534320
|
157
157
|
description: ! ' Enable OAuth clients (iphone, android, web sites, etc.) to access
|
158
158
|
and use your Rails application, what you do with it is up to you'
|
159
159
|
email: richard.schneeman@gmail.com
|
@@ -275,13 +275,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
275
|
version: '0'
|
276
276
|
segments:
|
277
277
|
- 0
|
278
|
-
hash:
|
278
|
+
hash: 920875782846310180
|
279
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
280
|
none: false
|
281
281
|
requirements:
|
282
|
-
- - ! '
|
282
|
+
- - ! '>'
|
283
283
|
- !ruby/object:Gem::Version
|
284
|
-
version:
|
284
|
+
version: 1.3.1
|
285
285
|
requirements: []
|
286
286
|
rubyforge_project:
|
287
287
|
rubygems_version: 1.8.10
|