Add access modality header + tests#24
Open
JCRPaquin wants to merge 3 commits into
Open
Conversation
Coverage Report for CI Build 29117823642Coverage increased (+0.4%) to 65.285%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
tjacovich
reviewed
Jul 10, 2026
tjacovich
left a comment
Contributor
There was a problem hiding this comment.
I think the core layout is there, just a little more tweaking of the business logic and we should be good to go.
| if current_user.is_authenticated: | ||
| headers.add_header("X-api-uid", current_user.id) | ||
|
|
||
| if not current_user.is_anonymous_bootstrap_user: |
Contributor
There was a problem hiding this comment.
We will have to modify this slightly because almost all API traffic is authenticated and UI users anonymous so this would actually flag most UI traffic as API and vice versa. I think we can piggyback off the load client method to get the client name that should help us separate authenticated API from authenticated UI.
tjacovich
approved these changes
Jul 10, 2026
tjacovich
left a comment
Contributor
There was a problem hiding this comment.
Should be good to test
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.
What?
Adds a header,
X-Access-Modality, that is forwarded to downstream services.Why?
Due to changes in publisher agreements, UI & API users can each see different content. This change enables downstream services to adapt their behavior according to the user's modality.