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

task/WG-268: add authentification to backend #206

Merged

Conversation

nathanfranklin
Copy link
Collaborator

@nathanfranklin nathanfranklin commented Jun 25, 2024

Overview:

Add authentification to backend

Related Jira tickets:

Summary of Changes:

  • reworked env variables and there use in settings.py and in docker-compose ymls.
  • added auth flow to be used by hazmapper and eventually taggit
  • a pre-request check to refresh access token when it's expired or soon-to-be-expired

Testing Steps:

  1. To be tested with task/WG-268: add authentification to backend hazmapper#244
  2. See task/WG-268: add authentification to backend hazmapper#244 for some testing ideas

Notes:

TODO

  • save token/refresh-token in database
  • consider that users could be using token not generated with the new auth flow (like they have a JWT but got it from somewhere else)
  • handle expiring refresh token. also handle if token needs to be refreshed during task (maybe assume all tasks take 2 hours? and just refresh if going to expire in 2hours?)
  • unit tests

* Add TAPIS_CLIENT_ID and  TAPIS_CLIENT_KEY
* Make env variable usage in docker compose consistent
@nathanfranklin nathanfranklin changed the base branch from master to feature/tapisv3 June 25, 2024 20:42
@nathanfranklin nathanfranklin changed the title Task/wg 268 add authentification to backend Task/WG-268: add authentification to backend Jun 25, 2024
@nathanfranklin nathanfranklin changed the base branch from feature/tapisv3 to master July 2, 2024 03:06
@nathanfranklin nathanfranklin changed the base branch from master to feature/tapisv3 July 2, 2024 03:06
Update CI so that it works.
@nathanfranklin
Copy link
Collaborator Author

Testing showed we are missing one more fix in addition to 9a8dcdf and b50b100 which need to be cherry-picked into this branch:

    if not self.auth.refresh_token:
AttributeError: 'NoneType' object has no attribute 'refresh_token``

@nathanfranklin
Copy link
Collaborator Author

Testing showed we are missing one more fix in addition to 9a8dcdf and b50b100 which need to be cherry-picked into this branch:

    if not self.auth.refresh_token:
AttributeError: 'NoneType' object has no attribute 'refresh_token``

Done

@nathanfranklin nathanfranklin changed the title Task/WG-268: add authentification to backend task/WG-268: add authentification to backend Jul 8, 2024
@nathanfranklin nathanfranklin merged commit e91740c into feature/tapisv3 Jul 9, 2024
3 checks passed
@nathanfranklin nathanfranklin deleted the task/WG-268-add-authentification-to-backend branch July 9, 2024 14:48
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.

1 participant