[26.0] Fix oauth2 template validation#22253
[26.0] Fix oauth2 template validation#22253dannon merged 3 commits intogalaxyproject:release_26.0from
Conversation
Fails fast when required secrets or environment variables are missing and no default is provided, instead of letting empty values reach OAuth setup. Surfaces a clear configuration problem for administrators and a safe user-facing error, preventing downstream OAuth client pair validation failures.
Improves coverage around misconfigured file source templates and OAuth setup. Ensures missing environment values and secrets fail with clear configuration errors, and missing OAuth credentials surface an actionable user-facing message for administrator follow-up.
|
@mvdbeek is this more in line with what you expect? |
|
Sorry, I saw |
|
IOW this is a misleading message. I'm fine to call it wontfix, but we shouldn't say it's not in the environment variables when in fact it is. |
Updates missing vault secrets and environment variables to surface as internal server errors instead of configuration errors.
| oauth2_scope = None | ||
| if oauth2_configuration is not None: | ||
| environment = prepare_environment_from_root(template.environment, self._app_vault, self._app_config) | ||
| try: |
There was a problem hiding this comment.
You could just let the exception bubble out, InternalServerError is a MessageException subclass, IIRC it's also logged
mvdbeek
left a comment
There was a problem hiding this comment.
Awesome, thank you so much, I think that results in clear error messages!
dannon
left a comment
There was a problem hiding this comment.
@davelopez Thank you for taking a look at this, looks great to me!

Alternative to #22151 discussed in #22246 (comment)
Fixes #22041
The users now see:
And the logged error is:
and for secrets, a similar exception:
How to test the changes?
License