[ARVADOS] updated: ee73fe1721723da22514b60bd639b72c059fe05b
git at public.curoverse.com
git at public.curoverse.com
Tue May 20 15:45:06 EDT 2014
Summary of changes:
.../app/controllers/collections_controller.rb | 22 ++++++++++------------
.../test/fixtures/api_client_authorizations.yml | 2 +-
2 files changed, 11 insertions(+), 13 deletions(-)
via ee73fe1721723da22514b60bd639b72c059fe05b (commit)
from 9313b300d47c3e74eeafd9955b59dfc0c2067686 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ee73fe1721723da22514b60bd639b72c059fe05b
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue May 20 15:44:59 2014 -0400
2764: Fixed active_all_collections scoped token to be able to access
keep_disks. Also some minor code cleanup in FileStreamer.
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 36e76ff..501484f 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -235,20 +235,18 @@ class CollectionsController < ApplicationController
end
def each
return unless @opts[:uuid] && @opts[:file]
- env = Hash[ENV].
- merge({
- 'ARVADOS_API_HOST' =>
- arvados_api_client.arvados_v1_base.
- sub(/\/arvados\/v1/, '').
- sub(/^https?:\/\//, ''),
- 'ARVADOS_API_TOKEN' =>
- @opts[:arvados_api_token],
- 'ARVADOS_API_HOST_INSECURE' =>
- Rails.configuration.arvados_insecure_https ? 'true' : 'false'
- })
+
+ env = Hash[ENV].dup
+
+ require 'uri'
+ u = URI.parse(arvados_api_client.arvados_v1_base)
+ env['ARVADOS_API_HOST'] = "#{u.host}:#{u.port}"
+ env['ARVADOS_API_TOKEN'] = @opts[:arvados_api_token]
+ env['ARVADOS_API_HOST_INSECURE'] = "true" if Rails.configuration.arvados_insecure_https
+
IO.popen([env, 'arv-get', "#{@opts[:uuid]}/#{@opts[:file]}"],
'rb') do |io|
- while buf = io.read(2**20)
+ while buf = io.read(2**16)
yield buf
end
end
diff --git a/services/api/test/fixtures/api_client_authorizations.yml b/services/api/test/fixtures/api_client_authorizations.yml
index aca6d7a..71b6388 100644
--- a/services/api/test/fixtures/api_client_authorizations.yml
+++ b/services/api/test/fixtures/api_client_authorizations.yml
@@ -63,7 +63,7 @@ active_all_collections:
user: active
api_token: activecollectionsabcdefghijklmnopqrstuvwxyz1234567
expires_at: 2038-01-01 00:00:00
- scopes: ["GET /arvados/v1/collections/"]
+ scopes: ["GET /arvados/v1/collections/", "GET /arvados/v1/keep_disks"]
active_userlist:
api_client: untrusted
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list