Diff
Modified: trunk/Gemfile (3426 => 3427)
--- trunk/Gemfile 2013-02-15 15:40:12 UTC (rev 3426)
+++ trunk/Gemfile 2013-02-15 16:54:18 UTC (rev 3427)
@@ -21,4 +21,6 @@
gem "rdf-raptor", "~> 0.4.1"
gem "rdf-n3"
gem "recaptcha", "~> 0.3.4"
+gem "encrypted_strings", "~> 0.3.3"
+gem "encrypted_attributes", "~> 0.4.1"
Modified: trunk/app/models/taverna_enactor.rb (3426 => 3427)
--- trunk/app/models/taverna_enactor.rb 2013-02-15 15:40:12 UTC (rev 3426)
+++ trunk/app/models/taverna_enactor.rb 2013-02-15 16:54:18 UTC (rev 3427)
@@ -7,6 +7,7 @@
require 'enactor/client'
require 'document/data'
require 'document/report'
+require 'encrypted_attributes'
class TavernaEnactor < ActiveRecord::Base
@@ -16,11 +17,11 @@
validates_presence_of :contributor
validates_presence_of :username
- validates_presence_of :crypted_password
+ validates_presence_of :password
validates_presence_of :url
validates_presence_of :title
- encrypts :password, :mode => :symmetric, :key => Conf.sym_encryption_key
+ encrypts :password, :mode => :symmetric, :password => Conf.sym_encryption_key
def label
title
@@ -172,6 +173,6 @@
# Lazy loading of enactor service client.
def service_client
- @client ||= Enactor::Client.new(self.url, self.username, self.crypted_password.decrypt)
+ @client ||= Enactor::Client.new(self.url, self.username, self.password.decrypt)
end
end
Modified: trunk/app/views/runners/edit.rhtml (3426 => 3427)
--- trunk/app/views/runners/edit.rhtml 2013-02-15 15:40:12 UTC (rev 3426)
+++ trunk/app/views/runners/edit.rhtml 2013-02-15 16:54:18 UTC (rev 3427)
@@ -25,7 +25,7 @@
<%= text_field_tag "runner[username]", @runner.username, :size => 30 %>
<p><b>Password</b> (will be encrypted)</p>
- <%= text_field_tag "runner[password]", @runner.crypted_password.decrypt, :size => 30 %>
+ <%= text_field_tag "runner[password]", @runner.password.decrypt, :size => 30 %>
</fieldset>
<br/>
@@ -55,4 +55,4 @@
<center><%= submit_tag "Update", :disable_with => "Updating..." %></center>
<% end -%>
</div>
-</center>
\ No newline at end of file
+</center>
Modified: trunk/config/environment.rb (3426 => 3427)
--- trunk/config/environment.rb 2013-02-15 15:40:12 UTC (rev 3426)
+++ trunk/config/environment.rb 2013-02-15 16:54:18 UTC (rev 3427)
@@ -26,7 +26,6 @@
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
config.plugins = [
- :encrypted_strings,
:widgets,
:country_select,
:white_list,
@@ -37,7 +36,6 @@
:acts_as_solr,
:acts_as_taggable_redux,
:auto_complete,
- :encrypted_attributes,
:headliner,
:oauth,
:oauth_plugin,
Added: trunk/db/migrate/20130215162325_change_runner_passwords.rb (0 => 3427)
--- trunk/db/migrate/20130215162325_change_runner_passwords.rb (rev 0)
+++ trunk/db/migrate/20130215162325_change_runner_passwords.rb 2013-02-15 16:54:18 UTC (rev 3427)
@@ -0,0 +1,16 @@
+# myExperiment: db/migrate/20130215162325_change_runner_passwords.rb
+#
+# Copyright (c) 2013 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class ChangeRunnerPasswords < ActiveRecord::Migration
+ def self.up
+ remove_column :taverna_enactors, :crypted_password
+ add_column :taverna_enactors, :password, :string
+ end
+
+ def self.down
+ add_column :taverna_enactors, :crypted_password, :string
+ remove_column :taverna_enactors, :password
+ end
+end
Modified: trunk/test/fixtures/taverna_enactors.yml (3426 => 3427)
--- trunk/test/fixtures/taverna_enactors.yml 2013-02-15 15:40:12 UTC (rev 3426)
+++ trunk/test/fixtures/taverna_enactors.yml 2013-02-15 16:54:18 UTC (rev 3427)
@@ -7,7 +7,7 @@
contributor_type: User
url: http://rpc269.cs.man.ac.uk:8180/remotetaverna/v1/
username: user
- crypted_password: password # password should be put through an encrypt function before being stored in the DB
+ password: password # password should be put through an encrypt function before being stored in the DB
created_at: 2008-01-06 17:52:45
updated_at: 2008-01-06 17:52:45
@@ -19,6 +19,6 @@
contributor_type: User
url: http://rpc269.cs.man.ac.uk:8180/remotetaverna/v1/
username: user
- crypted_password: password # password should be put through an encrypt function before being stored in the DB
+ password: password # password should be put through an encrypt function before being stored in the DB
created_at: 2008-04-28 23:19:35
updated_at: 2008-04-28 23:19:35