Skip to content
This repository has been archived by the owner. It is now read-only.

Replace Redmine.pm with ChiliProject.pm #229

Closed

Conversation

@meineerde
Copy link
Member

@meineerde 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 3 commits Sep 5, 2012
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).
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
Author 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
Copy link
Member

@thegcat thegcat commented Jan 2, 2013

See line notes, everything else looks good.

@meineerde meineerde closed this Feb 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants