-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for sudo and mu auth scope #30
base: master
Are you sure you want to change the base?
Add support for sudo and mu auth scope #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Riadabd 🙏
I think it's best to keep it as close to the behaviour of the mu-javascript-template as possible.
if Mu::truthy? ENV['ALLOW_MU_AUTH_SUDO'] | ||
options[:headers] = { 'mu-auth-sudo': 'true' } | ||
else | ||
log.error "Error, sudo request but service lacks ALLOW_MU_AUTH_SUDO header" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also raise an error here instead of only logging one? Query will now still be executed with a non-sudo SPARQL client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I go with raise
?
raise "Error, sudo request but service lacks ALLOW_MU_AUTH_SUDO header"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems more in line with the JS template to me 👍
Description
This PR contains similar changes to mu-semtech/mu-javascript-template@56e185e .
It extends the
query
andupdate
functions and provides a transition path to using scopes instead of sudo where possible (once the scopes feature lands).