This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
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.
This patch adds three new features to ChiliProject to resolve https://www.chiliproject.org/issues/177:
User.try_to_login
. It allows to cache the auth credentials in the Rails.cache (e.g. Memcached). It creates a hash from the session secret, username, and password and saves it to the cache on successful login. This hash is less secure than the default hash in the database (it is SHA1-based and salted by the session secret), it is probably sufficient for storage in a memory cache. This mode is required to use either "expensive" hashes (e.g when we switch to PBKDF2) or when using external auth sources like LDAP which are rather slow.Redmine.pm
calledChiliProject.pm
which uses the new sys API for authentication.This has several advantages as it completely removes the duplication of the complex authentication and authorization logic from the Perl module. We no longer require database modules and the code is now probably even threadsafe (allowing the usage of the Apache worker mpm).
The downside is that we use the ChiliProject for each auth request which might slow things down for very limited (or not concurrent) installs. However, each request right now takes <= 20 ms with Passenger on my systems, so it should probably be okay.
The Perl module still needs some more testing (which I would gladly take if you have some time) so I'm targeting this module for ChiliProject 3.5.