-
Notifications
You must be signed in to change notification settings - Fork 4
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
New refreshusers.py helper to assure htaccess is current #181
Open
jonasbardino
wants to merge
4
commits into
edge
Choose a base branch
from
add/refresh-account-htaccess-helper
base: edge
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
external auth provider login are in fact able to open their files in the Files web page without just hitting an Apache auth error. In practice the helper script looks up user accounts and checks that the corresponding .htaccess file for each account is in sync with the user database contents for that user. In particular that the short_id field commonly doubling as Apache REMOTE_USER is in fact included as a valid 'require user XYZ' clause in the .htaccess file of the user. Matching users where that is not already the case will get all their automatic account files including .htaccess refreshed. Site operators can supply expire range and ID pattern filters like for certain other scripts to target specific users only.
jonasbardino
added
enhancement
New feature or request
follow-up pending
Pending tasks to follow-up on after close
labels
Jan 24, 2025
…taccess function for common runs. Explicitly only run unit tests for py2 when on main/edge as the embedded refresh call with create_user relies on a py2-only str.encode('string_escape') construct that will fail on py3. Can probably be enabled on next/experimental.
jonasbardino
added
unit test
and removed
follow-up pending
Pending tasks to follow-up on after close
labels
Jan 24, 2025
… will cause problems in the require user line. Fix detection of neither extoid nor extoidc auth.
albu-diku
reviewed
Jan 29, 2025
self.assertHtaccessRequireUserClause(DUMMY_HTACCESS_PATH, | ||
DUMMY_REQUIRE_USER) | ||
|
||
@unittest.skipUnless(PY2, "Python 2 only") |
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.
I don't think it's a good idea to add new tests that target Python 2 given we're trying quite hard to get rid of it - more important is that these tests work on Python 3. What is preventing them working on that or, preferably, both?
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.
New
refreshusers.py
helper to assure that one or more user accounts with external auth provider login are in fact able to open their files in the Files web page without just hitting an Apache auth error. In practice the helper script looks up user accounts and checks that the corresponding.htaccess
file for each account is in sync with the user database contents for that user. In particular that theshort_id
field commonly doubling as ApacheREMOTE_USER
is in fact included as a validrequire user "XYZ"
clause in the.htaccess
file of the user.Matching users where that is not already the case will get all their automatic account files including
.htaccess
refreshed.Site operators can supply expire range and ID pattern filters like for certain other scripts to target specific users only.
The code is fully functional and tested in practice, so it can be merged,
but it would be nice towe now include unit tests to help verify general correctness.