summaryrefslogtreecommitdiff
path: root/lib/authorization.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-09-02 13:09:19 +0200
committerChristoph Helma <helma@in-silico.ch>2010-09-02 13:09:19 +0200
commit6a560290805ff49d7d43842dd8119a2e2bb06b4a (patch)
tree5de68ff472cfd61f8e13271ba8f41fd171e4a07e /lib/authorization.rb
parent48d044219674a96ba0d387311612c9fb95949e05 (diff)
old user authentification removed
Diffstat (limited to 'lib/authorization.rb')
-rw-r--r--lib/authorization.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/authorization.rb b/lib/authorization.rb
deleted file mode 100644
index 9a1760a..0000000
--- a/lib/authorization.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-helpers do
-
- def protected!
- response['WWW-Authenticate'] = %(Basic realm="Opentox Webservice Authentication") and \
- throw(:halt, [401, "Not authorized\n"]) and \
- return unless authorized?
- end
-
- def authorized?
- @auth ||= Rack::Auth::Basic::Request.new(request.env)
- @auth.provided? && @auth.basic? && @auth.credentials && valid_user?
- end
-
- def valid_user?
- users = @@users[:users]
- return @auth.credentials == [@auth.username, users.fetch(@auth.username)] if users.has_key?(@auth.username)
- return false
- end
-
-end
-
-before do
- #protected! unless env['REQUEST_METHOD'] == "GET"
-end