auth 0.0.3 → 0.0.5
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 +6 -0
- data/README.md +1 -2
- data/lib/auth/sentry.rb +4 -4
- data/lib/auth/server.rb +3 -1
- data/lib/auth/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/lib/auth/sentry.rb
CHANGED
@@ -14,13 +14,13 @@ module Auth
|
|
14
14
|
when :client
|
15
15
|
@client = Auth.authenticate_client(@request.params['client_id'], @request.params['client_secret'])
|
16
16
|
unless @client
|
17
|
-
raise
|
17
|
+
raise UnauthorizedClient, 'Invalid client'
|
18
18
|
end
|
19
19
|
else
|
20
20
|
if Auth.authenticate_account(@request.params['username'], @request.params['password'])
|
21
|
-
@
|
21
|
+
@user = User.new(@request.params['username'])
|
22
22
|
else
|
23
|
-
raise
|
23
|
+
raise AccessDenied, 'Invalid username or password'
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -30,7 +30,7 @@ module Auth
|
|
30
30
|
when :client
|
31
31
|
@client ? @client : nil
|
32
32
|
else
|
33
|
-
@
|
33
|
+
@user ? @user : nil
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
data/lib/auth/server.rb
CHANGED
@@ -12,6 +12,8 @@ module Auth
|
|
12
12
|
set :views, "#{dir}/server/views"
|
13
13
|
set :public, "#{dir}/server/public"
|
14
14
|
set :static, true
|
15
|
+
set :raise_errors, true
|
16
|
+
set :show_exceptions, true if development?
|
15
17
|
|
16
18
|
helpers do
|
17
19
|
include Rack::Utils
|
@@ -64,7 +66,7 @@ module Auth
|
|
64
66
|
|
65
67
|
def validate_redirect_uri!
|
66
68
|
params[:redirect_uri] ||= sentry.user(:client).redirect_uri
|
67
|
-
if URI(params[:redirect_uri]).host.downcase != URI(sentry.user(:client).redirect_uri).host.downcase
|
69
|
+
if URI(params[:redirect_uri]).host.to_s.downcase != URI(sentry.user(:client).redirect_uri).host.to_s.downcase
|
68
70
|
halt(400, 'Invalid redirect URI')
|
69
71
|
end
|
70
72
|
rescue URI::InvalidURIError
|
data/lib/auth/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Niklas Holmgren
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-10-16 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -107,7 +107,7 @@ dependencies:
|
|
107
107
|
version: 0.5.6
|
108
108
|
type: :development
|
109
109
|
version_requirements: *id006
|
110
|
-
description: A high performance OAuth2 authorization server using Sinatra and Redis, inspired by Resque.
|
110
|
+
description: A high performance OAuth2 authorization server using Sinatra and Redis, inspired by Resque.
|
111
111
|
email: niklas@sutajio.se
|
112
112
|
executables: []
|
113
113
|
|