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

Feature/maappy gets username #108

Merged
merged 19 commits into from
Nov 8, 2024
Merged

Conversation

grallewellyn
Copy link
Contributor

@grallewellyn grallewellyn commented Oct 26, 2024

Github Issues: MAAP-Project/Community#1055 MAAP-Project/Community#1052

Description

maap-py no longer needs to worry about the username for listing jobs (because the API gets the user from the PGT token). Submitting jobs shouldn't accept user input for the username because they could put someone else's username. Instead, submitting a job fetches the username from the users PGT token. If they don't have a valid PGT token, the job won't submit anyway
Previously, you could submit a job under an invalid username and then the submit wouldn't show up under your account, so we want to remove this possibility

https://api.dit.maap-project.org/api/dps/job/list just needs the PGT token and not username anymore. I removed username as an argument because you should not be able to view other users' jobs (right?) and you don’t need to pass your own username to view your own jobs

Note that once these PRs are merged, this issue: MAAP-Project/Community#1132 addresses that the API should get the username and not maap-py

Overview of work done

Removed username for listing jobs and submitting jobs gets username from PGT token now

Overview of verification done

Tested:

  • Seeing/ submitting jobs via the UI and via maap.submitJob in DIT, UAT, OPS, and local development from pip installs
  • Incorrectly setting the PGT token, MAAP_API_HOST, or MAAP_ADE_HOST in the ADE and with local development
    Some expected behavior examples: If you have the DIT PGT token and MAAP_API_HOST=api.dit.maap-project.org and do a bad MAAP_ADE_HOST, you can see your DIT jobs still. If you have a DIT PGT token and MAAP_API_HOST=api.maap-project.org, you cannot see or submit your jobs. If you submit a job with PGT and MAAP_API_HOST matching environments, but you add a username field that isn’t yours, it will be overriden to submit a job with your username (soon we will edit the API so it doesn’t even require a username)

Overview of integration done

Tests listed above and can test on the ADEs with this image: 'mas.dit.maap-project.org/root/maap-workspaces/jupyterlab/python:remove-env-json'

PR checklist:

  • Linted (develop branch is 6.06/10 and mine is 6.06/10 with poetry run pylint maap)
  • Updated unit tests (test_DPS.py still needs to be written which I think should be a separate issue- not sure how to submit jobs as a test because this is a public repo and we don't want anyone's PGT token exposed to the public and now we can't submit jobs with just the anonymous username and no PGT token)
  • Updated changelog
  • Integration testing
  • Updated documentation

Draft PR to update documentation: MAAP-Project/maap-documentation#453

See Pull Request Review Checklist for pointers on reviewing this pull request

Goes with these PRs: MAAP-Project/jupyter-server-extension#14 MAAP-Project/dps-jupyter-extension#23

@grallewellyn grallewellyn merged commit f6aa987 into develop Nov 8, 2024
2 of 3 checks passed
@grallewellyn grallewellyn deleted the feature/maappy-gets-username branch November 8, 2024 18:36
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.

2 participants