diff options
author | mr <mr@mrautenberg.de> | 2010-01-25 09:29:21 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2010-01-25 09:29:21 +0100 |
commit | a165822a7bd663916cff9484a76e6bb6bcf9a353 (patch) | |
tree | 4f33445db772b87ccead41b75e686be144ad3bb1 /lib/model.rb | |
parent | 4c2ac1a90b686b0e4bc361403770e0756bbfbdf9 (diff) |
internal authorization with first user of users.yaml
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/model.rb b/lib/model.rb index b86b3fc..6bdbfd2 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -34,7 +34,8 @@ module OpenTox # Predict a compound def predict(compound) - RestClient::Resource.new(@uri, :user => request.username, :password => request.password).post(:compound_uri => compound.uri) + resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + resource.post(:compound_uri => compound.uri) end def self.base_uri @@ -42,7 +43,8 @@ module OpenTox end def self.create(data) - RestClient::Resource.new(@@config[:services]["opentox-model"], :user => request.username, :password => request.password).post(data, :content_type => "application/x-yaml").to_s + resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) + resource.post(data, :content_type => "application/x-yaml").to_s end def endpoint |