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

Replace Redmine.pm with ChiliProject.pm #229

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@meineerde
Member

meineerde commented Sep 5, 2012

This patch adds three new features to ChiliProject to resolve https://www.chiliproject.org/issues/177:

  1. A new action to the sys controller to check if a user (identified by basic auth) is has a certain named permission
  2. A new mode for 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.
  3. A replacement for Redmine.pm called ChiliProject.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.

meineerde added some commits Sep 5, 2012

Add option to cache the authentication #177
It caches the credentials in the Rails cache in a way that they are checked at least once every 10 minutes (if supported by the used cache store).
Add auth action to sys controller #177
This action can be used to check if a certain user (identified with
basic auth) has a certain permission on a named project.
# The full URL to your ChiliProject instance
ChiliProjectBaseUrl "http://your.server/chiliproject"
# The key as enterd in your ChiliProject in

This comment has been minimized.

@thegcat

thegcat Jan 2, 2013

Member

Typo: enterd -> entered

$self->{ChiliProjectGitSmartHttp} = 1;
} else {
$self->{ChiliProjectGitSmartHttp} = 0;
}

This comment has been minimized.

@thegcat

thegcat Jan 2, 2013

Member

How about making smart HTTP the default? I think git 1.7 is new enough for that.

This comment has been minimized.

@meineerde

meineerde Jan 2, 2013

Member

Then it won't work for svn or webdav anymore. The default is the simple stuff, i.e. to decide read or write based on the HTTP verb. That means GitSmartHttp off. With GitSmartHttp, we decide based on the the URL pattern for Git.

This comment has been minimized.

@thegcat

thegcat Jan 2, 2013

Member

Mmh, I thought with GitSmartHttp both would work. How about adding a config option for the type of repo to make it more clear what it does?

by the owner for each of your projects.
- Use "http://host/git/repo", and store your credentials in the ~/.netrc
file. This is the recommended solution when using Git <= 1.7.9 on the client,

This comment has been minimized.

@thegcat

thegcat Jan 2, 2013

Member

As the credentials-to-system-keystore bridges have also been around for long enough I'd rather not have this in the docs. Same goes for the above http://user:pass@ method.

@thegcat

This comment has been minimized.

Member

thegcat commented Jan 2, 2013

See line notes, everything else looks good.

@meineerde meineerde closed this Feb 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment