Remove Data Analytics Framework token authentication via GET/POST params.#2028
Merged
aaronweeden merged 15 commits intoubccr:xdmod11.0from May 2, 2025
Merged
Remove Data Analytics Framework token authentication via GET/POST params.#2028aaronweeden merged 15 commits intoubccr:xdmod11.0from
aaronweeden merged 15 commits intoubccr:xdmod11.0from
Conversation
611dd3f to
6f032db
Compare
Member
|
Is this going to cause breakage / incompatibility between newer XDMoD and older python code? |
Contributor
Author
No, every release of |
jpwhite4
previously approved these changes
Apr 28, 2025
aaronweeden
added a commit
to aaronweeden/xdmod
that referenced
this pull request
May 2, 2025
3 tasks
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 removes the ability to authenticate to the Data Analytics Framework REST API via API token in GET or POST parameters and makes it so the token must be provided via
Authorizationheader. The GET/POST param functionality was in place for CentOS 7 to work around theAuthorizationheader being eaten by Apache, and it is no longer needed.These changes mean the current method of counting Data Analytics Framework requests for our reporting KPIs will no longer work (they involved reading the logs with
ident = 'rest.logger.db' or ident = 'controller.log'and searching for theBearerparameter). To correct this, this PR adds logging with a newident = 'daf'.This PR also updates the error messages and documentation to use consistent lowercasing of "token" and to move the duplicate error message strings into variables.
This PR also refactors some duplicated code into functions.
There is also a PR for https://github.com/ubccr/xdmod-xsede/pull/570.
Motivation and Context
Code cleanup and better practice not to have the API token in the request parameters.
Tests performed
This PR updates the token auth integration tests.
In a Docker container with the changes from this PR, I also made requests via the version of
xdmod-datafrom ubccr/xdmod-data#68 and confirmed the logs appeared as expected, e.g.,:Checklist: