lundi 12 janvier 2015

Assistance Navigating Jenkins Source Code

I'm a junior developer, first of all.


I'm modifying a plugin (reverse-proxy-auth-plugin-Jenkins) for Jenkins, but getting a little bit turned around trying to figure out the relationships between the different parts. My biggest problem is conceptually trying to understand where things are called.


In my case, I'm building a filter that should accept header values and modify the Full Name and E-mail fields for a given user. This is a filter I'm placing within a subclass of hudson.security.SecurityRealm. To allow admins to change the header names for Full Name and E-mail I've modified config.jelley by adding:



<f:entry title="${%Header User Full Name}">
<f:textbox name="headerFullName" default="fullName"/>
</f:entry>

<f:entry title="${%Header Email}">
<f:textbox field="headerEmail" default="email" />
</f:entry>


There were already existent similar entries for other headers that the user may change: user-id, user groups etc. I am not sure how this config.jelly gets parsed and where the data gets stored. I would like to be able to access it's elements.


Once that is understood, I would like to modify the constructor for this class (ReverseProxySecurityRealm) to add one more parameter. My problem is that once I add one more parameter it has a null pointer exception. I'm not sure how to add a new parameter to the constructor and ensure that where it is called it includes the header name provided by the user.


I think people who have modified Jenkins code will have the clues I need to move forward. I appreciate any ideas.


Thanks!






Aucun commentaire:

Enregistrer un commentaire