プロジェクト

全般

プロフィール

Vote #64614

未完了

Use Redmine.pm to authenticate for any directory

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
SCM extra_46
対象バージョン:
-
開始日:
2009/02/07
期日:
進捗率:

0%

予定工数:
category_id:
46
version_id:
0
issue_org_id:
2693
author_id:
3866
assigned_to_id:
0
comments:
3
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Redmine: r2363

I'd like to be able to use the Redmine user credentials to authenticate users for other directories than svn repositories in Apache. I've already tried hacking my way through the perl module (I don't know a bit of perl...) and came up with the following patch (from svn diff extra/svn/Redmine.pm):

Index: extra/svn/Redmine.pm
===================================================================
--- extra/svn/Redmine.pm        (revision 2383)
+++ extra/svn/Redmine.pm        (working copy)
@@ -142,6 +142,11 @@
     args_how => TAKE1,
     errmsg => 'RedmineCacheCredsMax must be decimal number',
   },
+  {
+    name => 'RedmineProject',
+    req_override => OR_AUTHCFG,
+    args_how => TAKE1,
+  },
 );
 
 sub RedmineDSN { 
@@ -166,6 +171,11 @@
   $self->{RedmineQuery} = trim($self->{RedmineQuery}.($arg ? $arg : "")." ");
 }
 
+sub RedmineProject { set_val('RedmineProject', @_); }
+
 sub RedmineCacheCredsMax { 
   my ($self, $parms, $arg) = @_;
   if ($arg) {
@@ -327,9 +337,18 @@
 
 sub get_project_identifier {
     my $r = shift;
-    
-    my $location = $r->location;
-    my ($identifier) = $r->uri =~ m{$location/*([^/]+)};
+    my $cfg = Apache2::Module::get_config(__PACKAGE__, $r->server, $r->per_dir_config);
+    my $identifier;
+    my $project = $cfg->{RedmineProject} ? $cfg->{RedmineProject} : "";
+
+    if ($project) {
+      $identifier = $project;
+    } else {
+      my $location = $r->location;
+      ($identifier) = $r->uri =~ m{$location/*([^/]+)};
+    }
     $identifier;
 }

This seems to not brake the authentication for svn repositories, and get_project_identifier() returns the RedmineProject value defined in the apache config if set, but I sill can't log in in the directory I'm trying to use it for. Here the relevant part in the apache config:

        
                AuthType basic
                AuthName "Digischrank Test"
                Require valid-user
                PerlAccessHandler Apache::Authn::Redmine::access_handler
                PerlAuthenHandler Apache::Authn::Redmine::authen_handler
                RedmineDSN "DBI:mysql:database=SomedaTaBAse;host=localhost"
                RedmineDbUser "SoMeuSer"
                RedmineDbPass "SomePaSS"
                RedmineProject "digischrank"
        

As I said, my perl is nearly non-existant, so the above hackery might make your eyeballs hurt, and my understanding of the whole apache authentication thing isn't that good either, but I'd be happy for any help to solve this, and even if it's not considered a feature redmine should get shipped with, I'm sure other people would be happy to have something like this.


journals

Hey Alex,

i like that approach. I've also submitted a patch for a similar problem (#2647) and i believe we should throw all these things into a generic approach covering all different aspects of authentication.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリSCM extra_46 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0