summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2013-07-26 15:20:20 +0200
committerrautenberg <rautenberg@in-silico.ch>2013-07-26 15:20:20 +0200
commite82e7a33763357ba71c2b964f32afc8fd3afb755 (patch)
tree71a69ba03da6d20f1e8a94933a29c1e9c0355adc
parentee6f20df383639029df001bb10312cd6b58c977a (diff)
remove some more subjectids
-rw-r--r--lib/authorization.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/authorization.rb b/lib/authorization.rb
index 6c3d42b..b819dde 100644
--- a/lib/authorization.rb
+++ b/lib/authorization.rb
@@ -98,9 +98,9 @@ module OpenTox
# @param [String] action request method
# @param [String] subjectid
# @return [Boolean, nil] returns true, false or nil (if authorization-request fails).
- def self.authorize(uri, action)
+ def self.authorize(uri, action, subjectid=RestClientWrapper.subjectid)
return true if !AA
- return true if RestClientWrapper.post("#{AA}/auth/authorize",{:uri => uri, :action => action})== "boolean=true\n"
+ return true if RestClientWrapper.post("#{AA}/auth/authorize",{:subjectid => subjectid, :uri => uri, :action => action})== "boolean=true\n"
return false
end
@@ -253,11 +253,11 @@ module OpenTox
end
#Returns the owner (user id) of a token
- # @param [String]subjectid
+ # @param [String]subjectid optional (normally only used for testing)
# @return [String]user
- def self.get_user
+ def self.get_user subjectid=RestClientWrapper.subjectid
begin
- out = RestClientWrapper.post("#{AA}/opensso/identity/attributes", {:attributes_names => "uid"})
+ out = RestClientWrapper.post("#{AA}/opensso/identity/attributes", {:subjectid => subjectid, :attributes_names => "uid"})
user = ""; check = false
out.split("\n").each do |line|
if check