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

Update NmdcPortalApiClient with new authentication scheme #572

Merged
merged 7 commits into from
Jun 24, 2024

Conversation

pkalita-lbl
Copy link
Collaborator

Description

The Portal API has replaced session cookie-based authentication with Bearer token authentication. These changes update NmdcPortalApiClient to reflect that.

In testing I also found that the SubmissionPortalTranslator has drifted away from the Portal a bit. In particular, samp_name is now the unique key slot on Biosample instances instead of source_mat_id. These changes also correct that.

Fixes #571

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit test suite
    • These changes update tests/test_ops/test_data_api_ops.py to reflect the new behavior of NmdcPortalApiClient.
    • These changes fix the test configuration of tests/test_graphs/test_submission_portal_graphs.py and remove the xfail mark.
  • Manually ran the translate_metadata_submission_to_nmdc_schema_database job in the Dagit interface

Configuration Details: none

Checklist:

  • My code follows the style guidelines of this project (have you run black nmdc_runtime/?)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (in docs/ and in https://github.com/microbiomedata/NMDC_documentation/?)
  • I have added tests that prove my fix is effective or that my feature works, incl. considering downstream usage (e.g. https://github.com/microbiomedata/notebook_hackathons) if applicable.
  • New and existing unit and functional tests pass locally with my changes (make up-test && make test-run)

@pkalita-lbl pkalita-lbl marked this pull request as draft June 24, 2024 20:09
eecavanna
eecavanna previously approved these changes Jun 24, 2024
nmdc_runtime/site/resources.py Show resolved Hide resolved
@pkalita-lbl pkalita-lbl marked this pull request as ready for review June 24, 2024 22:46
@pkalita-lbl pkalita-lbl requested a review from eecavanna June 24, 2024 22:46
Copy link
Collaborator

@eecavanna eecavanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@pkalita-lbl pkalita-lbl merged commit 636b968 into main Jun 24, 2024
2 checks passed
@pkalita-lbl pkalita-lbl deleted the issue-571-portal-api-client-auth branch June 24, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update NmdcPortalApiClient to use new Bearer token authentication
2 participants