mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-12-02 21:39:11 -05:00
* Replace bcrypt challenge auth with direct password comparison Closes #2428 Highlights: * Replaced the bcrypt challenge authentication flow with direct password comparison against the bcrypt hash stored in the user configuration. * Removed the `bcrypt.js` dependency, so authentication no longer depends on JavaScript. * Removed the nonce and challenge mechanism and the `nonce` endpoint from the `javascript` controller. * Removed the JavaScript and HTML code used for the previous authentication flow. * Removed the `<noscript>` blocks that were only needed for the previous authentication flow. * Updated `FreshRSS_FormAuth::checkCredentials()` to accept the username, stored bcrypt hash, and plain-text password directly. * The stored password hash must still use the expected bcrypt format. * Empty or whitespace-only passwords are rejected even if the hash would otherwise match. * The bcrypt 72-byte limit is enforced during normal authentication. * Existing bcrypt passwords are handled correctly when the 72-byte limit cuts through a UTF-8 character. * Password input is no longer trimmed before authentication or password changes. Leading and trailing whitespace is therefore kept as part of the password. * Added `FreshRSS_FormAuth::passwordRequirementsMet()` to replace `FreshRSS_password_Util::check()`. * New passwords must be between 7 and 72 bytes by default. * The minimum length check can be disabled where needed. * Password requirements are now checked server-side for all password creation and update paths. * Added client-side byte-length validation for password fields using `TextEncoder` and `data-max-bytes`. * This gives better feedback for UTF-8 passwords. * Server-side validation remains authoritative. * Updated password handling in authentication, re-authentication, self-deletion, user creation, and user update paths so passwords are not trimmed automatically. * Added `FormAuthTest` to cover: * password length limits in bytes * UTF-8 passwords around the 72-byte limit * bcrypt truncation behavior during authentication * malformed and non-bcrypt hashes * empty passwords * authentication failures and log messages * Removed `bcrypt.js` from the documented dependencies and updated the authentication documentation. * Updated the installation and authentication views and JavaScript to match the new password handling. This simplifies the authentication flow, removes the client-side bcrypt challenge, makes password validation consistent between the client and server, and adds more test coverage while keeping compatibility with existing bcrypt password hashes. Because the password is now sent directly to the server instead of being processed by `bcrypt.js`, deployments should use HTTPS. Documentation for HTTPS setup can be handled separately. * Add test case with password truncated down to 71 characters * Compare log messages too during form auth tests * Mark the `getLastLog()` method as impure * Fix: Check password reqs against new password instead of current * Fix: Add custom JS validator for UTF-8, handle cut-off UTF-8 during login * Fix: Enforce password requirements everywhere server-side * Add TODO for updateUser in CLI * make readme * Fix extra.js in install.php * Don't report validity yet if the password is too short or not filled out * Simplify checking of whether to report validity * Fix: Do not trim password from user's input * Also `trim: false` in some userController paths * Use the proper argument order for PHPUnit's `assertSame()` * Remove `maxlength` in favor of `data-max-bytes` But add `pattern` again for some nojs support * make readme * composer run-script translations * Update i18n string for web form admin setting * i18n: fr * Minor whitespace --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
56 lines
3.1 KiB
PHP
56 lines
3.1 KiB
PHP
<?php
|
|
|
|
/******************************************************************************
|
|
* Each entry of that file can be associated with a comment to indicate its *
|
|
* state. When there is no comment, it means the entry is fully translated. *
|
|
* The recognized comments are (comment matching is case-insensitive): *
|
|
* + TODO: the entry has never been translated. *
|
|
* + DIRTY: the entry has been translated but needs to be updated. *
|
|
* + IGNORE: the entry does not need to be translated. *
|
|
* When a comment is not recognized, it is discarded. *
|
|
******************************************************************************/
|
|
|
|
return array(
|
|
'email' => array(
|
|
'feedback' => array(
|
|
'invalid' => ' این آدرس ایمیل نامعتبر است.',
|
|
'required' => ' یک آدرس ایمیل مورد نیاز است.',
|
|
),
|
|
'validation' => array(
|
|
'change_email' => ' میتوانید آدرس ایمیل خود را <a href="%s">در صفحه نمایه</a> تغییر دهید.',
|
|
'email_sent_to' => ' ما یک ایمیل برای شما به آدرس <strong>%s</strong> ارسال کردیم. لطفاً دستورالعمل های آن را برای تأیید اعتبار آدرس خود دنبال کنید.',
|
|
'feedback' => array(
|
|
'email_failed' => ' به دلیل یک خطای پیکربندی سرور نتوانستیم برای شما ایمیل ارسال کنیم.',
|
|
'email_sent' => ' یک ایمیل به آدرس شما ارسال شده است.',
|
|
'error' => ' اعتبار آدرس ایمیل ناموفق بود.',
|
|
'ok' => ' این آدرس ایمیل تایید شده است.',
|
|
'unnecessary' => ' این آدرس ایمیل قبلاً تأیید شده است.',
|
|
'wrong_token' => ' این آدرس ایمیل به دلیل یک توکن اشتباه تأیید نشد.',
|
|
),
|
|
'need_to' => 'پیش از اینکه بتوانید از %s استفاده کنید، باید آدرس ایمیل خود را تأیید کنید.',
|
|
'resend_email' => ' ایمیل را دوباره ارسال کنید',
|
|
'title' => ' اعتبار سنجی آدرس ایمیل',
|
|
),
|
|
),
|
|
'mailer' => array(
|
|
'email_need_validation' => array(
|
|
'body' => 'شما بهتازگی در %s ثبتنام کردهاید، اما هنوز باید آدرس ایمیل خود را تأیید کنید. برای این کار، کافی است این پیوند را دنبال کنید:',
|
|
'title' => ' باید حساب خود را تأیید کنید',
|
|
'welcome' => 'خوش آمدید %s،',
|
|
),
|
|
),
|
|
'password' => array(
|
|
'invalid' => ' رمز عبور نامعتبر است.',
|
|
'provided_password_too_long' => 'The provided password is too long.', // TODO
|
|
),
|
|
'tos' => array(
|
|
'feedback' => array(
|
|
'invalid' => ' برای اینکه بتوانید ثبت نام کنید باید شرایط خدمات را بپذیرید.',
|
|
),
|
|
),
|
|
'username' => array(
|
|
'invalid' => ' این نام کاربری نامعتبر است.',
|
|
'taken' => 'این نام کاربری، %s، قبلاً گرفته شده است.',
|
|
),
|
|
);
|