Skip to content

feat: Make password hashing parameters configurable#2332

Merged
dpgaspar merged 3 commits intodpgaspar:masterfrom
denis-ismailaj:configurable-pass-hashing
Apr 17, 2025
Merged

feat: Make password hashing parameters configurable#2332
dpgaspar merged 3 commits intodpgaspar:masterfrom
denis-ismailaj:configurable-pass-hashing

Conversation

@denis-ismailaj
Copy link
Copy Markdown
Contributor

Description

This is a continuation of PR #2234.

It should be noted that apart from the compliance reasons mentioned in the original PR, this change
is also necessary for compatibility with Python <=3.9 on macOS where hashlib.scrypt is not available.

Two configuration options have been added: FAB_PASSWORD_HASH_METHOD and FAB_PASSWORD_HASH_SALT_LENGTH.

While FAB_PASSWORD_HASH_SALT_LENGTH is not strictly required for the reasons mentioned above,
I included it as there may be use cases where configuring both is needed.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

@denis-ismailaj denis-ismailaj force-pushed the configurable-pass-hashing branch from beab5b5 to 78161de Compare April 9, 2025 09:34
Copy link
Copy Markdown
Owner

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! thank you

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.81%. Comparing base (c65e067) to head (ddbd54f).
Report is 34 commits behind head on master.

Files with missing lines Patch % Lines
flask_appbuilder/security/mongoengine/manager.py 0.00% 2 Missing ⚠️
flask_appbuilder/security/sqla/manager.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2332      +/-   ##
==========================================
+ Coverage   73.81%   74.81%   +0.99%     
==========================================
  Files          72       72              
  Lines        8754     9160     +406     
==========================================
+ Hits         6462     6853     +391     
- Misses       2292     2307      +15     
Flag Coverage Δ
python 74.81% <62.50%> (+0.99%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpgaspar dpgaspar merged commit 93c8e4d into dpgaspar:master Apr 17, 2025
13 of 14 checks passed
potiuk added a commit to potiuk/airflow that referenced this pull request Jun 17, 2025
The dpgaspar/Flask-AppBuilder#2332 introduced
new configuration parameter, where it defaulted hash algorithm for
passwords to "scrypt". However with our (old) version of Werkzeug,
scrypt is not supported and default should be set to "pbkdf2:sha256"

Fixes: 51854
potiuk added a commit to apache/airflow that referenced this pull request Jun 17, 2025
The dpgaspar/Flask-AppBuilder#2332 introduced
new configuration parameter, where it defaulted hash algorithm for
passwords to "scrypt". However with our (old) version of Werkzeug,
scrypt is not supported and default should be set to "pbkdf2:sha256"

Fixes: 51854
potiuk added a commit to potiuk/Flask-AppBuilder that referenced this pull request Jun 17, 2025
Follow up after dpgaspar#2306. Later configuration was added in dpgaspar#2332 that
added default configuration for hash method and also there
scrypt was set as default, however Werkzeug < 3.0.0 does not
support it.

This PR retrieves the default method properly, depending on
installed Werkzeug version.
potiuk added a commit to potiuk/Flask-AppBuilder that referenced this pull request Jun 17, 2025
Follow up after dpgaspar#2306. Later configuration was added in dpgaspar#2332 that
added default configuration for hash method and also there
scrypt was set as default, however Werkzeug < 3.0.0 does not
support it.

This PR retrieves the default method properly, depending on
installed Werkzeug version.
potiuk added a commit to potiuk/Flask-AppBuilder that referenced this pull request Jun 17, 2025
Follow up after dpgaspar#2306. Later configuration was added in dpgaspar#2332 that
added default configuration for hash method and also there
scrypt was set as default, however Werkzeug < 3.0.0 does not
support it.

This PR retrieves the default method properly, depending on
installed Werkzeug version.
potiuk added a commit to potiuk/Flask-AppBuilder that referenced this pull request Jun 17, 2025
Follow up after dpgaspar#2306. Later configuration was added in dpgaspar#2332 that
added default configuration for hash method and also there
scrypt was set as default, however Werkzeug < 3.0.0 does not
support it.

This PR retrieves the default method properly, depending on
installed Werkzeug version.
potiuk added a commit to potiuk/Flask-AppBuilder that referenced this pull request Jun 17, 2025
Follow up after dpgaspar#2306. Later configuration was added in dpgaspar#2332 that
added default configuration for hash method and also there
scrypt was set as default, however Werkzeug < 3.0.0 does not
support it.

This PR retrieves the default method properly, depending on
installed Werkzeug version.
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Jun 21, 2025
…51858)

The dpgaspar/Flask-AppBuilder#2332 introduced
new configuration parameter, where it defaulted hash algorithm for
passwords to "scrypt". However with our (old) version of Werkzeug,
scrypt is not supported and default should be set to "pbkdf2:sha256"

Fixes: 51854
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 23, 2025
The dpgaspar/Flask-AppBuilder#2332 introduced
new configuration parameter, where it defaulted hash algorithm for
passwords to "scrypt". However with our (old) version of Werkzeug,
scrypt is not supported and default should be set to "pbkdf2:sha256"

Fixes: 51854
GitOrigin-RevId: 7cecc66069a2588dfaba95a030f09076552c4c68
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Feb 28, 2026
The dpgaspar/Flask-AppBuilder#2332 introduced
new configuration parameter, where it defaulted hash algorithm for
passwords to "scrypt". However with our (old) version of Werkzeug,
scrypt is not supported and default should be set to "pbkdf2:sha256"

Fixes: 51854
GitOrigin-RevId: 7cecc66069a2588dfaba95a030f09076552c4c68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants