rack-oauth2-server 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -0
- data/Gemfile +3 -0
- data/README.rdoc +26 -7
- data/Rakefile +1 -1
- data/VERSION +1 -0
- data/lib/rack/oauth2/admin/css/screen.css +233 -0
- data/lib/rack/oauth2/admin/images/loading.gif +0 -0
- data/lib/rack/oauth2/admin/js/application.js +154 -0
- data/lib/rack/oauth2/admin/js/jquery.js +166 -0
- data/lib/rack/oauth2/admin/js/jquery.tmpl.js +414 -0
- data/lib/rack/oauth2/admin/js/sammy.js +5 -0
- data/lib/rack/oauth2/admin/js/sammy.json.js +5 -0
- data/lib/rack/oauth2/admin/js/sammy.storage.js +5 -0
- data/lib/rack/oauth2/admin/js/sammy.title.js +5 -0
- data/lib/rack/oauth2/admin/js/sammy.tmpl.js +5 -0
- data/lib/rack/oauth2/admin/js/underscore.js +722 -0
- data/lib/rack/oauth2/admin/views/client.tmpl +48 -0
- data/lib/rack/oauth2/admin/views/clients.tmpl +36 -0
- data/lib/rack/oauth2/admin/views/edit.tmpl +57 -0
- data/lib/rack/oauth2/admin/views/index.html +26 -0
- data/lib/rack/oauth2/models/access_grant.rb +6 -4
- data/lib/rack/oauth2/models/access_token.rb +36 -4
- data/lib/rack/oauth2/models/auth_request.rb +4 -3
- data/lib/rack/oauth2/models/client.rb +15 -2
- data/lib/rack/oauth2/server.rb +71 -58
- data/lib/rack/oauth2/server/admin.rb +216 -0
- data/lib/rack/oauth2/server/helper.rb +4 -4
- data/lib/rack/oauth2/sinatra.rb +2 -2
- data/rack-oauth2-server.gemspec +2 -3
- data/test/admin/api_test.rb +196 -0
- data/test/admin_test_.rb +49 -0
- data/test/{access_grant_test.rb → oauth/access_grant_test.rb} +1 -1
- data/test/{access_token_test.rb → oauth/access_token_test.rb} +83 -12
- data/test/{authorization_test.rb → oauth/authorization_test.rb} +1 -1
- data/test/rails/config/environment.rb +2 -0
- data/test/rails/log/test.log +72938 -0
- data/test/setup.rb +17 -1
- data/test/sinatra/my_app.rb +1 -1
- metadata +27 -9
- data/lib/rack/oauth2/server/version.rb +0 -9
data/test/setup.rb
CHANGED
@@ -3,10 +3,12 @@ Bundler.setup
|
|
3
3
|
require "test/unit"
|
4
4
|
require "rack/test"
|
5
5
|
require "shoulda"
|
6
|
+
require "timecop"
|
6
7
|
require "ap"
|
7
8
|
require "json"
|
8
9
|
$: << File.dirname(__FILE__) + "/../lib"
|
9
10
|
require "rack/oauth2/server"
|
11
|
+
require "rack/oauth2/server/admin"
|
10
12
|
|
11
13
|
|
12
14
|
ENV["RACK_ENV"] = "test"
|
@@ -23,7 +25,14 @@ when "sinatra", nil
|
|
23
25
|
|
24
26
|
class Test::Unit::TestCase
|
25
27
|
def app
|
26
|
-
|
28
|
+
Rack::Builder.new do
|
29
|
+
map("/oauth/admin") { run Rack::OAuth2::Server::Admin }
|
30
|
+
map("/") { run MyApp }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def config
|
35
|
+
MyApp.oauth
|
27
36
|
end
|
28
37
|
end
|
29
38
|
|
@@ -46,6 +55,13 @@ when "rails2"
|
|
46
55
|
def app
|
47
56
|
ActionController::Dispatcher.new
|
48
57
|
end
|
58
|
+
|
59
|
+
def admin!
|
60
|
+
end
|
61
|
+
|
62
|
+
def config
|
63
|
+
Rails.configuration.oauth
|
64
|
+
end
|
49
65
|
end
|
50
66
|
|
51
67
|
else
|
data/test/sinatra/my_app.rb
CHANGED
@@ -9,6 +9,7 @@ class MyApp < Sinatra::Base
|
|
9
9
|
oauth.authenticator = lambda do |username, password|
|
10
10
|
"Superman" if username == "cowbell" && password == "more"
|
11
11
|
end
|
12
|
+
oauth.host = "example.org"
|
12
13
|
oauth.database = DATABASE
|
13
14
|
|
14
15
|
|
@@ -64,4 +65,3 @@ class MyApp < Sinatra::Base
|
|
64
65
|
end
|
65
66
|
|
66
67
|
end
|
67
|
-
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Assaf Arkin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-08 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -70,23 +70,40 @@ extra_rdoc_files:
|
|
70
70
|
- README.rdoc
|
71
71
|
- CHANGELOG
|
72
72
|
files:
|
73
|
+
- lib/rack/oauth2/admin/css/screen.css
|
74
|
+
- lib/rack/oauth2/admin/images/loading.gif
|
75
|
+
- lib/rack/oauth2/admin/js/application.js
|
76
|
+
- lib/rack/oauth2/admin/js/jquery.js
|
77
|
+
- lib/rack/oauth2/admin/js/jquery.tmpl.js
|
78
|
+
- lib/rack/oauth2/admin/js/sammy.js
|
79
|
+
- lib/rack/oauth2/admin/js/sammy.json.js
|
80
|
+
- lib/rack/oauth2/admin/js/sammy.storage.js
|
81
|
+
- lib/rack/oauth2/admin/js/sammy.title.js
|
82
|
+
- lib/rack/oauth2/admin/js/sammy.tmpl.js
|
83
|
+
- lib/rack/oauth2/admin/js/underscore.js
|
84
|
+
- lib/rack/oauth2/admin/views/client.tmpl
|
85
|
+
- lib/rack/oauth2/admin/views/clients.tmpl
|
86
|
+
- lib/rack/oauth2/admin/views/edit.tmpl
|
87
|
+
- lib/rack/oauth2/admin/views/index.html
|
73
88
|
- lib/rack/oauth2/models/access_grant.rb
|
74
89
|
- lib/rack/oauth2/models/access_token.rb
|
75
90
|
- lib/rack/oauth2/models/auth_request.rb
|
76
91
|
- lib/rack/oauth2/models/client.rb
|
77
92
|
- lib/rack/oauth2/models.rb
|
78
93
|
- lib/rack/oauth2/rails.rb
|
94
|
+
- lib/rack/oauth2/server/admin.rb
|
79
95
|
- lib/rack/oauth2/server/errors.rb
|
80
96
|
- lib/rack/oauth2/server/helper.rb
|
81
97
|
- lib/rack/oauth2/server/utils.rb
|
82
|
-
- lib/rack/oauth2/server/version.rb
|
83
98
|
- lib/rack/oauth2/server.rb
|
84
99
|
- lib/rack/oauth2/sinatra.rb
|
85
100
|
- lib/rack-oauth2-server.rb
|
86
101
|
- rails/init.rb
|
87
|
-
- test/
|
88
|
-
- test/
|
89
|
-
- test/
|
102
|
+
- test/admin/api_test.rb
|
103
|
+
- test/admin_test_.rb
|
104
|
+
- test/oauth/access_grant_test.rb
|
105
|
+
- test/oauth/access_token_test.rb
|
106
|
+
- test/oauth/authorization_test.rb
|
90
107
|
- test/rails/app/controllers/api_controller.rb
|
91
108
|
- test/rails/app/controllers/application_controller.rb
|
92
109
|
- test/rails/app/controllers/oauth_controller.rb
|
@@ -97,6 +114,7 @@ files:
|
|
97
114
|
- test/setup.rb
|
98
115
|
- test/sinatra/my_app.rb
|
99
116
|
- CHANGELOG
|
117
|
+
- VERSION
|
100
118
|
- MIT-LICENSE
|
101
119
|
- README.rdoc
|
102
120
|
- Rakefile
|
@@ -109,7 +127,7 @@ licenses: []
|
|
109
127
|
post_install_message: ""
|
110
128
|
rdoc_options:
|
111
129
|
- --title
|
112
|
-
- rack-oauth2-server 1.
|
130
|
+
- rack-oauth2-server 1.3.0
|
113
131
|
- --main
|
114
132
|
- README.rdoc
|
115
133
|
- --webcvs
|