LDAPBindSecurityRealm.groovy

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LDAPBindSecurityRealm.groovy

Robert
Hello,

I was wondering if there was a way to override the file
"LDAPBindSecurityRealm.groovy" without repackaging the war file.  From
what I read in the source, this doesn't seem possible:

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/security/LDAPSecurityRealm.java
(line 352)

        BeanBuilder builder = new BeanBuilder();
 
builder.parse(Jenkins.getInstance().servletContext.getResourceAsStream("/
WEB-INF/security/LDAPBindSecurityRealm.groovy"),binding);
        WebApplicationContext appContext =
builder.createApplicationContext();

But maybe there a way to override the classpath?  Rebuilding a war
file isn't an, but, we would like to reuse the debian packages from
hudson.  We use a custom groovy file to define a custom group mapping
without modifying the hudson internals.

Right now, every time we restart the files in /var/run/hudson are
replaced with the contents of the war file.

cheers,
--Robert Scott
Reply | Threaded
Open this post in threaded view
|

Re: LDAPBindSecurityRealm.groovy

kohsuke Kawaguchi (CB)

Yeah, it makes sense. Fixed toward 1.416. It can be now loaded from
$JENKINS_HOME/LDAPSecurityRealm.groovy if it exists.

On 06/08/2011 07:34 PM, keyboard.operator wrote:

> Hello,
>
> I was wondering if there was a way to override the file
> "LDAPBindSecurityRealm.groovy" without repackaging the war file.  From
> what I read in the source, this doesn't seem possible:
>
> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/security/LDAPSecurityRealm.java
> (line 352)
>
>          BeanBuilder builder = new BeanBuilder();
>
> builder.parse(Jenkins.getInstance().servletContext.getResourceAsStream("/
> WEB-INF/security/LDAPBindSecurityRealm.groovy"),binding);
>          WebApplicationContext appContext =
> builder.createApplicationContext();
>
> But maybe there a way to override the classpath?  Rebuilding a war
> file isn't an, but, we would like to reuse the debian packages from
> hudson.  We use a custom groovy file to define a custom group mapping
> without modifying the hudson internals.
>
> Right now, every time we restart the files in /var/run/hudson are
> replaced with the contents of the war file.
>
> cheers,
> --Robert Scott
>


--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Reply | Threaded
Open this post in threaded view
|

Re: LDAPBindSecurityRealm.groovy

Robert
Many thanks!

cheers,
--Robert Scott

On Thu, Jun 9, 2011 at 3:41 PM, Kohsuke Kawaguchi <[hidden email]> wrote:

Yeah, it makes sense. Fixed toward 1.416. It can be now loaded from $JENKINS_HOME/LDAPSecurityRealm.groovy if it exists.

On 06/08/2011 07:34 PM, keyboard.operator wrote:
Hello,

I was wondering if there was a way to override the file
"LDAPBindSecurityRealm.groovy" without repackaging the war file.  From
what I read in the source, this doesn't seem possible:

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/security/LDAPSecurityRealm.java
(line 352)

        BeanBuilder builder = new BeanBuilder();

builder.parse(Jenkins.getInstance().servletContext.getResourceAsStream("/
WEB-INF/security/LDAPBindSecurityRealm.groovy"),binding);
        WebApplicationContext appContext =
builder.createApplicationContext();

But maybe there a way to override the classpath?  Rebuilding a war
file isn't an, but, we would like to reuse the debian packages from
hudson.  We use a custom groovy file to define a custom group mapping
without modifying the hudson internals.

Right now, every time we restart the files in /var/run/hudson are
replaced with the contents of the war file.

cheers,
--Robert Scott



--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/

Reply | Threaded
Open this post in threaded view
|

Re: LDAPBindSecurityRealm.groovy

Alan Harder-2
Robert, can you find a good place on the wiki and add documentation for this?
Thanks!
  - Alan


On 6/9/11 10:00 PM, Robert wrote:
Many thanks!

cheers,
--Robert Scott

On Thu, Jun 9, 2011 at 3:41 PM, Kohsuke Kawaguchi <[hidden email]> wrote:

Yeah, it makes sense. Fixed toward 1.416. It can be now loaded from $JENKINS_HOME/LDAPSecurityRealm.groovy if it exists.

On 06/08/2011 07:34 PM, keyboard.operator wrote:
Hello,

I was wondering if there was a way to override the file
"LDAPBindSecurityRealm.groovy" without repackaging the war file.  From
what I read in the source, this doesn't seem possible:

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/security/LDAPSecurityRealm.java
(line 352)

        BeanBuilder builder = new BeanBuilder();

builder.parse(Jenkins.getInstance().servletContext.getResourceAsStream("/
WEB-INF/security/LDAPBindSecurityRealm.groovy"),binding);
        WebApplicationContext appContext =
builder.createApplicationContext();

But maybe there a way to override the classpath?  Rebuilding a war
file isn't an, but, we would like to reuse the debian packages from
hudson.  We use a custom groovy file to define a custom group mapping
without modifying the hudson internals.

Right now, every time we restart the files in /var/run/hudson are
replaced with the contents of the war file.

cheers,
--Robert Scott



--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/