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

Don't know how to / Can't assign UID when uploading #13

Closed
mccalluc opened this issue Feb 14, 2017 · 4 comments
Closed

Don't know how to / Can't assign UID when uploading #13

mccalluc opened this issue Feb 14, 2017 · 4 comments
Assignees

Comments

@mccalluc
Copy link
Collaborator

Sorry if this something simple I'm missing:

set -x
set -v

VIEWCONF='{}'
VIEWCONF_UID=empty-view
VIEWCONFS_URL=http://localhost:8888/api/v1/viewconfs/

# This doesn't work: Trying to curl in two different incompatible ways.
curl --globoff -H "Content-Type: application/json" -X POST -d "$VIEWCONF" $VIEWCONFS_URL -F "uid=$VIEWCONF_UID"

# Not recognized as a parameter in the url: random UID still generated. (GET will work.)
curl --globoff -H "Content-Type: application/json" -X POST -d "$VIEWCONF" $VIEWCONFS_URL'?uid='$VIEWCONF_UID

# UID is not recognized, and the data stored in the database has HTTP cruft. (GET fails because JSON can't be parsed.)
curl --globoff -F "fileupload=$VIEWCONF" -F "uid=$VIEWCONF_UID" $VIEWCONFS_URL

echo
@mccalluc
Copy link
Collaborator Author

curl -u `cat ~/.higlass-server-login` \
     -F 'datafile=@/data/downloads/gene-annotations-hg19.db' \
     -F 'filetype=beddb' \
     -F 'datatype=gene-annotation' \
     -F 'uid=OHJakQICQD6gTD7skx4EWA' \
     -F 'name=Gene Annotations' \
     -F 'coordSystem=hg19' \
     localhost:80/api/v1/tilesets/

For comparison, here's tilesets from the google doc. Notice that the examples above are missing credentials, and have a different field for the file. Where does this come from? Are they actually being handled differently?

@pkerpedjiev
Copy link
Member

Viewconfs don't require credentials and can't be assigned a uuid (at the moment).

Preventing unauthorized file uploads is more important because those are user-visible (e.g. one can click 'add track' and see the list of tracks that are present). Viewconfs are largely invisible. Unless you know the UUID of a particular viewconf, you won't be aware of its existence.

We can make the viewconfs method accept uids. The function viewconfs in tilesets/views.py is responsible for storing saved viewconfs.

To see an example of where we store 'uids', take a look at perform_create in tilesets/views.py.

@mccalluc
Copy link
Collaborator Author

I'll take a swing at this. Being able to give the ID when creating a viewconfig would make it a lot easier to describe reproducers.

@mccalluc
Copy link
Collaborator Author

mccalluc commented Mar 3, 2017

@mccalluc mccalluc closed this as completed Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants