-
Notifications
You must be signed in to change notification settings - Fork 3
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
Accomodate pubMLST authentication change #186
Comments
Technical refinement:
|
To clarify the issue: New Workflow:
python microSALT/utils/bigsdb_downloader.py \
--key_name testApp \
--token_dir ./tokens \
--url https://rest.pubmlst.org/db/pubmlst_neisseria_seqdef/schemes/1/profiles \
--method GET \
--output_file output.json \
--site PubMLST
Please enter your API key: [User inputs API key]
Please enter your API secret: [User inputs API secret] Which we get from the account:
Please log in using your user account at:
https://pubmlst.org/bigsdb?db=pubmlst_neisseria_seqdef&page=authorizeClient&oauth_token=SomeToken
using a web browser to obtain a verification code.
Please enter verification code:
Please enter verification code: [User inputs verification code]
Access Token: [Access Token]
Access Token Secret: [Access Token Secret]
Then download the Database: |
Oh ! I forgot to add that pagination should also be considered when handling the response. |
Transition from unauthenticated API to the authenticated APIURLsNon-authenticated use the Listing databasesThe responses seemed to be identical if the http/https URLs are handled. Fetch SchemesSimilar to databases if the URLs are handled. Fetch Locus MetadataThe unauthenticated API responded with detailed data, while the authenticated API responded with some metadata links ( Download LocusThe unauthenticated API returned allele sequences in FASTA format, while the authenticated API was trying to return raw bytes. I will investigate that as well. |
Authentication utilsThe suggested solution is to have utilities handle the authentication and interactions with the PubMLST API. Here is a summary of the functionalities: 1.
|
Status updateTested the current PR as follow:
Then executed the following command (as advised by KN earlier):
It seemed to be working:
Remaining tasks
|
Description
According to this information the pubMLST database will require users to authenticate themselves to perform any type of requests (even GETs).
In
microSALT/utils/referencer.py
microSALT fetches stuff from there. This is performed on the first micro-analysis run every day.Not authenticating will result in not being able to fetch recent data
API docs: https://bigsdb.readthedocs.io/en/latest/rest.html#api-oauth
The text was updated successfully, but these errors were encountered: