Fix wrong cluster label on search page when authenticated remotely.
authorTom Clegg <tclegg@veritasgenetics.com>
Wed, 17 Jan 2018 15:31:04 +0000 (10:31 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Wed, 17 Jan 2018 15:31:04 +0000 (10:31 -0500)
Add uuid prefix to discovery doc.

refs #11453

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

apps/workbench/app/assets/javascripts/models/session_db.js
services/api/app/controllers/arvados/v1/schema_controller.rb
services/api/test/functional/arvados/v1/schema_controller_test.rb

index a43cd79545b66ff47dda07f3097b3c8803a47262..d5cd98d386499adf68f049980c036fbd1c4155e7 100644 (file)
@@ -127,7 +127,7 @@ window.SessionDB = function() {
                     },
                 }).then(function(user) {
                     session.user = user
-                    db.save(user.uuid.slice(0, 5), session)
+                    db.save(user.owner_uuid.slice(0, 5), session)
                     db.trash(key)
                 })
             })
index d4be3c8093fee71692d5b1ed7b2d5fd57c96e44d..91685f59988bf1a852a7a25a2aa46f47a3f32300 100644 (file)
@@ -44,6 +44,7 @@ class Arvados::V1::SchemaController < ApplicationController
         rootUrl: root_url,
         servicePath: "arvados/v1/",
         batchPath: "batch",
+        uuidPrefix: Rails.application.config.uuid_prefix,
         defaultTrashLifetime: Rails.application.config.default_trash_lifetime,
         blobSignatureTtl: Rails.application.config.blob_signature_ttl,
         maxRequestSize: Rails.application.config.max_request_size,
index 235b78e332f337c0e618da27709517ee9c29af3f..c15060d1a9847cf33f774399b6decf7ff8f96b45 100644 (file)
@@ -33,6 +33,7 @@ class Arvados::V1::SchemaControllerTest < ActionController::TestCase
     assert_match(/^[0-9a-f]+(-modified)?$/, discovery_doc['source_version'])
     assert_equal discovery_doc['websocketUrl'], Rails.application.config.websocket_address
     assert_equal discovery_doc['workbenchUrl'], Rails.application.config.workbench_address
+    assert_equal('zzzzz', discovery_doc['uuidPrefix'])
   end
 
   test "discovery document overrides source_version with config" do