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

feat: Support sending OAuth token to codejail service #34023

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timmc-edx
Copy link
Contributor

This supports having an authenticated codejail service in general, but in particular is to support the temporary use of the LMS as a codejail service for the CMS: #33538

The new settings are all optional, and if not provided, the current behavior does not change.

@timmc-edx timmc-edx force-pushed the timmc/codejail-service-auth branch from 343bc99 to 65ff48c Compare January 9, 2024 16:50
This supports having an authenticated codejail service in general, but in
particular is to support the temporary use of the LMS as a codejail
service for the CMS: #33538

The new settings are all optional, and if not provided, the current
behavior does not change.
@timmc-edx timmc-edx force-pushed the timmc/codejail-service-auth branch from 65ff48c to 73e7ca8 Compare January 9, 2024 17:55
@timmc-edx timmc-edx marked this pull request as ready for review January 9, 2024 21:48
Copy link
Contributor

@rgraber rgraber left a comment

Choose a reason for hiding this comment

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

I think this is worth a simple unit test

@timmc-edx
Copy link
Contributor Author

Yep, still working on that.

@timmc-edx
Copy link
Contributor Author

Oh, I thought this was a different PR. What sort of test are you thinking of -- checking the output of _get_codejail_client for different combinations of settings?

@rgraber
Copy link
Contributor

rgraber commented Jan 11, 2024

Oh, I thought this was a different PR. What sort of test are you thinking of -- checking the output of _get_codejail_client for different combinations of settings?

Yes

@timmc-edx
Copy link
Contributor Author

Ready for re-review.

Although, here's a thought -- do we want a waffle flag for rollout? Right now there's a Django setting, but a flag would allow us to do a percentage rollout. (Having both would look weird, of course.)

@rgraber
Copy link
Contributor

rgraber commented Jan 16, 2024

Ready for re-review.

Although, here's a thought -- do we want a waffle flag for rollout? Right now there's a Django setting, but a flag would allow us to do a percentage rollout. (Having both would look weird, of course.)

Wouldn't it cause problems to have this as a Waffle flag while the remote codejail service is a SettingsToggle? Wouldn't that mean that anything without the waffle flag enabled would just throw errors?

@timmc-edx
Copy link
Contributor Author

I was thinking of adding a waffle flag in is_codejail_rest_service_enabled, same place the existing toggle is checked. Unless both come back True, we wouldn't attempt a remote call at all.

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