6fee91c9d0a6a9a3d9e3588e44ae92596a9aa9fb hiram Mon May 13 14:37:27 2019 -0700 recognizing the trackDb setting tableBrowser to avoid revealing protected data refs #18869 diff --git src/hg/hubApi/list.c src/hg/hubApi/list.c index d97eb84..292d80e 100644 --- src/hg/hubApi/list.c +++ src/hg/hubApi/list.c @@ -343,38 +343,45 @@ /* do *NOT* print containers when 'trackLeavesOnly' requested */ if (! (trackLeavesOnly && isContainer) ) { jsonWriteObjectStart(jw, tdb->track); if (tdbIsComposite(tdb)) jsonWriteString(jw, "compositeContainer", "TRUE"); if (tdbIsCompositeView(tdb)) jsonWriteString(jw, "compositeViewContainer", "TRUE"); jsonWriteString(jw, "shortLabel", tdb->shortLabel); jsonWriteString(jw, "type", tdb->type); jsonWriteString(jw, "longLabel", tdb->longLabel); if (tdb->parent) jsonWriteString(jw, "parent", tdb->parent->track); if (tdb->settingsHash) { + boolean protectedData = FALSE; + if (trackDbSetting(tdb, "tableBrowser")) + protectedData = TRUE; struct hashEl *hel; struct hashCookie hc = hashFirst(tdb->settingsHash); while ((hel = hashNext(&hc)) != NULL) { if (sameWord("track", hel->name)) continue; // already output in header - if (isEmpty((char *)hel->val)) + if (sameWord("tableBrowser", hel->name)) + jsonWriteBoolean(jw, "protectedData", TRUE); + else if (isEmpty((char *)hel->val)) jsonWriteString(jw, hel->name, "empty"); + else if (protectedData && sameWord(hel->name, "bigDataUrl")) + jsonWriteString(jw, hel->name, "protectedData"); else jsonWriteString(jw, hel->name, (char *)hel->val); } } if (tdb->subtracks) { struct trackDb *el = NULL; for (el = tdb->subtracks; el != NULL; el = el->next ) recursiveTrackList(jw, el); } jsonWriteObjectEnd(jw); } else if (tdb->subtracks)