rack-oauth2-server 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ 2010-11-09 version 1.4.2
2
+
3
+ Fix to commend line tool to properly do authentication.
4
+
5
+ Added Sinatra as dependency.
6
+
7
+
1
8
  2010-11-09 version 1.4.1
2
9
 
3
10
  Fix to command line tool when accessing MongoDB with username/password.
data/Gemfile CHANGED
@@ -2,7 +2,6 @@ source :rubygems
2
2
  gemspec
3
3
 
4
4
  group :development do
5
- gem "sinatra"
6
5
  gem "thin"
7
6
  gem "yard"
8
7
  end
@@ -14,6 +13,5 @@ group :test do
14
13
  gem "rack-test"
15
14
  gem "rails", "~>2.3"
16
15
  gem "shoulda"
17
- gem "sinatra"
18
16
  gem "timecop"
19
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.4.2
data/bin/oauth2-server CHANGED
@@ -9,10 +9,9 @@ if (i = ARGV.index("--db")) && ARGV[i+1]
9
9
  url = ARGV[i + 1]
10
10
  uri = URI.parse(url)
11
11
  uri = URI.parse("mongo://#{url}") if uri.opaque
12
- db = uri.path.sub(/^\//, "")
13
- conn = Mongo::Connection.new(uri.host, uri.port)
14
- conn.add_auth db, uri.user, uri.password if uri.user
15
- Server.database = conn[db]
12
+ db = Mongo::Connection.new(uri.host, uri.port)[uri.path.sub(/^\//, "")]
13
+ db.authenticate uri.user, uri.password if uri.user
14
+ Server.database = db
16
15
  ARGV[i,2] = []
17
16
  end
18
17
 
@@ -37,7 +36,7 @@ when "register"
37
36
  redirect_uri = $stdin.gets
38
37
  client = Server::Client.create(:display_name=>display_name, :link=>link, :redirect_uri=>redirect_uri)
39
38
  rescue
40
- puts "\nFailed to register client: #{$1}"
39
+ puts "\nFailed to register client: #{$!}"
41
40
  exit -1
42
41
  end
43
42
  puts "Registered #{client.display_name}"
@@ -59,6 +58,10 @@ when "setup"
59
58
  exit -1
60
59
  end
61
60
  print <<-TEXT
61
+
62
+ Next Steps
63
+ ==========
64
+
62
65
  Make sure you ONLY authorize administrators to use the oauth-admin scope.
63
66
  For example:
64
67
 
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "rack", "~>1"
23
23
  spec.add_dependency "mongo", "~>1"
24
24
  spec.add_dependency "bson_ext"
25
+ spec.add_dependency "sinatra", "~>1"
25
26
  end