add authorized_keys
authorTom Clegg <tom@clinicalfuture.com>
Thu, 6 Jun 2013 19:37:15 +0000 (15:37 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Thu, 6 Jun 2013 19:37:15 +0000 (15:37 -0400)
13 files changed:
apps/workbench/app/assets/javascripts/authorized_keys.js.coffee [new file with mode: 0644]
apps/workbench/app/assets/stylesheets/authorized_keys.css.scss [new file with mode: 0644]
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/controllers/authorized_keys_controller.rb [new file with mode: 0644]
apps/workbench/app/helpers/authorized_keys_helper.rb [new file with mode: 0644]
apps/workbench/app/models/authorized_key.rb [new file with mode: 0644]
apps/workbench/app/views/authorized_keys/index.html.erb [new file with mode: 0644]
apps/workbench/app/views/layouts/application.html.erb
apps/workbench/config/routes.rb
apps/workbench/test/fixtures/authorized_keys.yml [new file with mode: 0644]
apps/workbench/test/functional/authorized_keys_controller_test.rb [new file with mode: 0644]
apps/workbench/test/unit/authorized_key_test.rb [new file with mode: 0644]
apps/workbench/test/unit/helpers/authorized_keys_helper_test.rb [new file with mode: 0644]

diff --git a/apps/workbench/app/assets/javascripts/authorized_keys.js.coffee b/apps/workbench/app/assets/javascripts/authorized_keys.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/apps/workbench/app/assets/stylesheets/authorized_keys.css.scss b/apps/workbench/app/assets/stylesheets/authorized_keys.css.scss
new file mode 100644 (file)
index 0000000..7298460
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the AuthorizedKeys controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
index 07b7a2a1df90cb8e550ce125c4cbd567d6c0848e..619c4b52a754b53d1b26578050ff81caeff37454 100644 (file)
@@ -51,6 +51,7 @@ class ApplicationController < ActionController::Base
     @objects ||= model_class.all
     respond_to do |f|
       f.json { render json: @objects }
+      f.html { render }
     end
   end
 
diff --git a/apps/workbench/app/controllers/authorized_keys_controller.rb b/apps/workbench/app/controllers/authorized_keys_controller.rb
new file mode 100644 (file)
index 0000000..ec8d241
--- /dev/null
@@ -0,0 +1,2 @@
+class AuthorizedKeysController < ApplicationController
+end
diff --git a/apps/workbench/app/helpers/authorized_keys_helper.rb b/apps/workbench/app/helpers/authorized_keys_helper.rb
new file mode 100644 (file)
index 0000000..9a486f2
--- /dev/null
@@ -0,0 +1,2 @@
+module AuthorizedKeysHelper
+end
diff --git a/apps/workbench/app/models/authorized_key.rb b/apps/workbench/app/models/authorized_key.rb
new file mode 100644 (file)
index 0000000..a560216
--- /dev/null
@@ -0,0 +1,2 @@
+class AuthorizedKey < ArvadosBase
+end
diff --git a/apps/workbench/app/views/authorized_keys/index.html.erb b/apps/workbench/app/views/authorized_keys/index.html.erb
new file mode 100644 (file)
index 0000000..a02ebc3
--- /dev/null
@@ -0,0 +1,49 @@
+<table class="table table-hover">
+  <thead>
+    <tr class="contain-align-left">
+      <th>
+       id
+      </th><th>
+       owner
+      </th><th>
+       name
+      </th><th>
+       key_type
+      </th><th>
+       public_key
+      </th><th>
+       expires_at
+      </th>
+    </tr>
+  </thead>
+  <tbody>
+
+    <% @objects.sort_by { |ak| ak[:created_at] }.reverse.each do |g| %>
+
+    <tr>
+      <td>
+        <%= link_to_if_arvados_object ak %>
+      </td><td>
+        <%= ak.owner %>
+      </td><td>
+        <%= ak.name %>
+      </td><td>
+        <%= ak.key_type %>
+      </td><td>
+        <%= ak.public_key %>
+      </td><td>
+        <%= ak.expires_at %>
+      </td>
+    </tr>
+
+    <% end %>
+    <% if @objects.count == 0 %>
+    <tr>
+      <td colspan="6">
+        (no authorized keys)
+      </td>
+    </tr>
+    <% end %>
+
+  </tbody>
+</table>
index c11013f4184ccf76876e2d1ccae7c4a1a8b1e5cf..57c4ace6711e461d807f26cc8adbba167d21c3bf 100644 (file)
@@ -33,6 +33,7 @@
         <div class="nav-collapse collapse">
           <ul class="nav">
            <% [
+              [true, 'Keys', authorized_keys_path],
               [true, 'Data', collections_path],
               [true, 'Groups', groups_path],
               [true, 'Pipeline Templates', pipeline_templates_path],
index dec161d6c58e9810f4b2be87f7115b1ccead2138..57e4897d7eee6cc22821735a0d974e52416ff543 100644 (file)
@@ -1,4 +1,7 @@
 ArvadosWorkbench::Application.routes.draw do
+  resources :authorized_keys
+
+
   resources :job_tasks
 
 
diff --git a/apps/workbench/test/fixtures/authorized_keys.yml b/apps/workbench/test/fixtures/authorized_keys.yml
new file mode 100644 (file)
index 0000000..c63aac0
--- /dev/null
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined.  If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+#  column: value
diff --git a/apps/workbench/test/functional/authorized_keys_controller_test.rb b/apps/workbench/test/functional/authorized_keys_controller_test.rb
new file mode 100644 (file)
index 0000000..a48e303
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class AuthorizedKeysControllerTest < ActionController::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/apps/workbench/test/unit/authorized_key_test.rb b/apps/workbench/test/unit/authorized_key_test.rb
new file mode 100644 (file)
index 0000000..b8d9b67
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class AuthorizedKeyTest < ActiveSupport::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/apps/workbench/test/unit/helpers/authorized_keys_helper_test.rb b/apps/workbench/test/unit/helpers/authorized_keys_helper_test.rb
new file mode 100644 (file)
index 0000000..ced3b29
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class AuthorizedKeysHelperTest < ActionView::TestCase
+end