Restore Data Analytics Framework token authentication via GET/POST params.#2054
Merged
aaronweeden merged 5 commits intoubccr:xdmod11.0from Jun 26, 2025
Merged
Restore Data Analytics Framework token authentication via GET/POST params.#2054aaronweeden merged 5 commits intoubccr:xdmod11.0from
aaronweeden merged 5 commits intoubccr:xdmod11.0from
Conversation
connersaeli
reviewed
Jun 25, 2025
connersaeli
approved these changes
Jun 25, 2025
aaronweeden
added a commit
to aaronweeden/xdmod
that referenced
this pull request
Jun 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR restores the ability to authenticate to the Data Analytics Framework REST API via API token in a
Bearerparameter of GET or POST requests instead of anAuthorizationheader. This functionality had been removed in #2028, but after that PR was merged, it was discovered that the eating of theAuthorizationheader described in that PR also happens in Rocky 8, and a proper fix requires an update to the Apache configuration. Because updating the Apache configuration requires the admin to make manual changes, this is deemed a substantial enough change to warrant deferring it to a major release. So, for now, we are rolling back to allowing theBearerparameter to be used when making GET/POST requests.This PR also refactors the code a bit to make it easier to read and maintain. Specifically:
HEADER_KEYbecause the string'Bearer'is unlikely to change, and it is more readable not to have to look up the value of the constant.authenticateTokenmethod fromBaseControllerProviderinto theTokensclass, renamed asauthenticate— this relegates all the handling of the token authentication to theTokensservice to encapsulate it all in one place.authenticateTokenmethod in theTokensclass toauthenticateControllersince it is meant to be a temporary function until the controller endpoints are refactored into the new REST stack in a future version of XDMoD.authenticatemethod in theTokensclass toauthenticateTokenand make it private since now there are no external classes that need to use it.Tokensclass into a function to simplify the repeated code.Tests performed
In addition to making sure the CI tests passed, I also ran various tests on my port on
xdmod-devwith the changes from this PR, runningcurlwith and without a token in aBearerparameter for the various endpoints that use token authentication.This PR changes the integration test for the API tokens to put the token in the query parameters instead of the header. A future PR that fixes the Apache configuration should also update this to test both the case where the token is in the header and the case where the token is instead in the query parameters.
Checklist: