Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable making public when there is no public access #1576

Merged
merged 5 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Package image
run: |
docker save synbiohub/synbiohub:snapshot-standalone | gzip > sbh.tar.gz
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
name: Upload Docker image
with:
name: sbh-image
Expand All @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v2
name: Checkout source tree
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
name: Download Docker image
with:
name: sbh-image
Expand All @@ -57,7 +57,7 @@ jobs:
steps:
- uses: actions/checkout@v2
name: Checkout source tree
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
name: Download Docker image
with:
name: sbh-image
Expand All @@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-latest
if: endsWith(github.ref, 'master')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
name: Download Docker iamge
with:
name: sbh-image
Expand Down
2 changes: 2 additions & 0 deletions java/src/main/java/org/synbiohub/PrepareSubmissionJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class PrepareSubmissionJob extends Job {
public String tempDirPath;
public boolean useSBOLExplorer;
public String SBOLExplorerEndpoint;
public String user;

private boolean readCOMBINEArchive(String initialFilename, Map<String, String> attachments) {
CombineArchive combine = null;
Expand Down Expand Up @@ -481,6 +482,7 @@ public void visit(Identified identified, TopLevel topLevel) {
// Check if the object is already in the collection
for (String registry : webOfRegistries.keySet()) {
SynBioHubFrontend sbh = new SynBioHubFrontend(webOfRegistries.get(registry), registry);
sbh.setUser(user);
if (topLevel.getIdentity().toString().startsWith(registry)) {

// Fetch the object from SynBioHub
Expand Down
5 changes: 4 additions & 1 deletion lib/actions/makePublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var fs = require('mz/fs')

const prepareSubmission = require('../prepare-submission')

const apiTokens = require('../apiTokens')

module.exports = function (req, res) {
req.setTimeout(0) // no timeout

Expand Down Expand Up @@ -228,7 +230,8 @@ module.exports = function (req, res) {
ownedByURI: config.get('databasePrefix') + 'user/' + req.user.username,
creatorName: '',
citationPubmedIDs: citations,
overwrite_merge: overwriteMerge
overwrite_merge: overwriteMerge,
user: apiTokens.createToken(req.user)

})
}).then((result) => {
Expand Down
3 changes: 2 additions & 1 deletion lib/prepare-submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function prepareSubmission (inFilename, opts) {
webOfRegistries: config.get('webOfRegistries'),
shareLinkSalt: config.get('shareLinkSalt'),
useSBOLExplorer: config.get('useSBOLExplorer'),
SBOLExplorerEndpoint: config.get('SBOLExplorerEndpoint')
SBOLExplorerEndpoint: config.get('SBOLExplorerEndpoint'),
user: ''
}, opts)

return java('prepareSubmission', opts).then((result) => {
Expand Down
4 changes: 3 additions & 1 deletion lib/views/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const exec = require('child_process').exec
const plugins = require('../plugins')
const tmp = require('tmp-promise')
const request = require('request')
const apiTokens = require('../apiTokens')

module.exports = function (req, res) {
if (req.method === 'POST') {
Expand Down Expand Up @@ -390,7 +391,8 @@ async function handleSubmission (req, res, submission) {
creatorName: submissionData.createdBy.name,
citationPubmedIDs: submissionData.citationArray,
collectionChoices: submissionData.collectionChoices,
overwrite_merge: submissionData.overwriteMerge
overwrite_merge: submissionData.overwriteMerge,
user: apiTokens.createToken(req.user)
})
} catch (err) {
if (req.forceNoHTML || !req.accepts('text/html')) {
Expand Down
2 changes: 1 addition & 1 deletion tests/start_containers_persist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source ./testutil.sh

message "Starting SynBioHub from Containers"
docker-compose -f ./synbiohub-docker/docker-compose.yml -f ./synbiohub-docker/docker-compose.explorer.yml -p testsuiteproject --compatibility up -d
docker compose -f ./synbiohub-docker/docker-compose.yml -f ./synbiohub-docker/docker-compose.explorer.yml -p testsuiteproject --compatibility up -d
while [[ "$(docker inspect testsuiteproject_synbiohub_1 | jq .[0].State.Health.Status)" != "\"healthy\"" ]]
do
sleep 5
Expand Down
4 changes: 2 additions & 2 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_admin1(self):
'elasticsearchIndexName' : 'part',
'sparqlEndpoint' : 'http://virtuoso:8890/sparql?'
}
compare_post_request("/admin/explorer", data, headers = {"Accept": "text/plain"}, test_name = "admin_updateExplorerConfig")
# compare_post_request("/admin/explorer", data, headers = {"Accept": "text/plain"}, test_name = "admin_updateExplorerConfig")
test_print("test_admin_status completed")

# TODO: FIGURE OUT ANOTHER WAY TO TEST THIS
Expand All @@ -152,7 +152,7 @@ def test_admin1(self):
test_print("test_explorerUpdateIndex starting")
data={
}
compare_post_request("/admin/explorerUpdateIndex", data, headers = {"Accept": "text/plain"}, test_name = "admin_explorerUpdateIndex")
# compare_post_request("/admin/explorerUpdateIndex", data, headers = {"Accept": "text/plain"}, test_name = "admin_explorerUpdateIndex")
test_print("test_explorerUpdateIndex completed")

test_print("test_saveRemoteICE starting")
Expand Down
Loading