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

Change auth strategy to using find_or_create_token endpoint #782

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

fwfichtner
Copy link
Contributor

@fwfichtner fwfichtner commented Aug 1, 2024

Like discussed in in #484 this simplifies authentication by using the find_or_create_token-endpoint and removing all other auth-endpoints. If all is good users should not notice this change besides when their tokens expire, then they should now just be re-created (I couldn't test that because I had no expired tokens available for testing that).

auth.refresh_token() has been deprecated.

Closes #484
Fixes #764

Pull Request (PR) draft checklist - click to expand
  • Please review our
    contributing documentation
    before getting started.
  • Ensure an issue exists representing the problem being solved in this PR.
  • Populate a descriptive title. For example, instead of "Updated README.md", use a
    title such as "Add testing details to the contributor section of the README".
  • Populate the body of the pull request with:
  • Update CHANGELOG.md with details about your change in a section titled
    ## Unreleased. If such a section does not exist, please create one. Follow
    Common Changelog for your additions.
  • Update the documentation and/or the README.md with details of changes to the
    earthaccess interface, if any. Consider new environment variables, function names,
    decorators, etc.

Click the "Ready for review" button at the bottom of the "Conversation" tab in GitHub
once these requirements are fulfilled. Don't worry if you see any test failures in
GitHub at this point!

Pull Request (PR) merge checklist - click to expand

Please do your best to complete these requirements! If you need help with any of these
requirements, you can ping the @nsidc/earthaccess-support team in a comment and we
will help you out!

  • Add unit tests for any new features.
  • Apply formatting and linting autofixes. You can add a GitHub comment in this Pull
    Request containing "pre-commit.ci autofix" to automate this.
  • Ensure all automated PR checks (seen at the bottom of the "conversation" tab) pass.
  • Get at least one approving review.

📚 Documentation preview 📚: https://earthaccess--782.org.readthedocs.build/en/782/

@fwfichtner fwfichtner marked this pull request as ready for review August 1, 2024 13:39
@fwfichtner
Copy link
Contributor Author

fwfichtner commented Aug 1, 2024

Oh, didn't have those errors locally and will check what went wrong there. Edit: I only ran the integration tests -.-

@fwfichtner fwfichtner marked this pull request as draft August 1, 2024 13:59
@fwfichtner fwfichtner force-pushed the change-auth-strategy branch from 616ea5d to 37b2370 Compare August 2, 2024 10:54
@fwfichtner fwfichtner marked this pull request as ready for review August 2, 2024 11:21
@fwfichtner
Copy link
Contributor Author

I am not sure about this and could just initialize with an empty dict to make mypy happy. The rest also failed on main for me I think.

@chuckwondo
Copy link
Collaborator

@fwfichtner, you can safely ignore the failing integration tests. They are all tests that will pass once the PR is merged. We still don't know why this is happening, but we've seen it a few recent PRs.

Regarding the failing unit tests, I'll comment in the code.

CHANGELOG.md Outdated Show resolved Hide resolved
earthaccess/auth.py Outdated Show resolved Hide resolved
earthaccess/auth.py Outdated Show resolved Hide resolved
earthaccess/auth.py Show resolved Hide resolved
earthaccess/auth.py Outdated Show resolved Hide resolved
earthaccess/auth.py Show resolved Hide resolved
@fwfichtner fwfichtner marked this pull request as draft August 2, 2024 15:49
fwfichtner and others added 2 commits August 2, 2024 17:50
@fwfichtner fwfichtner marked this pull request as ready for review August 2, 2024 15:55
earthaccess/auth.py Show resolved Hide resolved
Copy link
Collaborator

@chuckwondo chuckwondo left a comment

Choose a reason for hiding this comment

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

@fwfichtner, looks good! Thank you!

@chuckwondo
Copy link
Collaborator

@mfisher87 and/or @betolink, either of you care to take a quick look at this PR before I merge it?

@mfisher87
Copy link
Collaborator

I'm not going to be able to take a close look at this in the short term. Funding & time-management struggles 😩

@fwfichtner
Copy link
Contributor Author

Thanks for the review @chuckwondo

@chuckwondo chuckwondo merged commit be1ec48 into nsidc:main Aug 7, 2024
7 of 11 checks passed
@mfisher87
Copy link
Collaborator

@chuckwondo thanks for merging! fyi I just got my funding confirmed yesterday; it's not much, but I'm out of "am I funded for this at all?" space now :)

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.

New auth strategy: token-only EDL tokens not being revoked and regenerated as expected
3 participants