-
Notifications
You must be signed in to change notification settings - Fork 49
Fix/update deny #1299
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
Fix/update deny #1299
Conversation
Pull Request Test Coverage Report for Build 18658110816Details
💛 - Coveralls |
Please find the detailed integration test report here |
Please find the detailed integration test report here |
fence/auth.py
Outdated
""" | ||
username_deny_regex = username_deny_regex or config["GLOBAL_USERNAME_DENY_REGEX"] | ||
if username_deny_regex: | ||
if re.match(pattern=username_deny_regex, string=username): |
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.
perhaps we'd like to use re.search? https://stackoverflow.com/questions/180986/what-is-the-difference-between-re-search-and-re-match
tests/login/test_login_user.py
Outdated
db_session.add(test_user) | ||
db_session.commit() | ||
|
||
with pytest.raises(Exception): |
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.
Consider changing Exception to Unauthorized, test may pass even if an unrelated exception is raised
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.
Nice! Good catch! PR has been updated.
assert flask.session["provider"] == provider | ||
assert flask.session["user_id"] == user_id | ||
assert flask.g.user == test_user | ||
|
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.
Consider adding a positive test to check the regex is allowing valid cases
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.
Good idea. Additional test has been added.
Please find the detailed integration test report here Please find the Github Action logs here |
pyproject.toml
Outdated
@@ -1,3 +1,3 @@ | |||
[tool.poetry] | |||
name = "fence" | |||
version = "11.3.2" |
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.
one last thing, version bump :)
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.
Nice, thank you! Version updated.
Please find the detailed integration test report here Please find the Github Action logs here |
Updates PR-1239 by merging master and moving deny-logic to renamed method.
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes