Select an OAuthProvider from BuildConfiguration edit page

Hi,

I'm trying to make a build-step plugin access an OAuthProvider which has been configured under Project->Connections.

What's the best way to do this - i.e. how can the edit*.jsp get access to the OAuthConnectionsManager (then filter it?)?

 

cheers,

Trent.

 

4 comments
Comment actions Permalink

To extend the idea - the BuildAgent would need to use the parameters of the referenced connection to connect to the external service.

Which means that _somewhere_ the connection parameters need to be copied into the RunnerParameters...somehow.

0
Comment actions Permalink

Hi, you will have to pass (as an argument) OAuthConnectionManager to whatever controller you implement to support the respective settings editing form. It will be autowired then. Then you can use its methods to extract the list of connections by type for example and pass as one of the values to your jsp code. 

0
Comment actions Permalink

This is to form part of a Custom Runtype - so 2 questions:
1. Does Controller fit well with the Runtypes (haven't tried this before)
2. Does this solution mean I can get the connection parameters across to the agent for using during the BuildProcess?

0
Comment actions Permalink

Ok, think I got it.

In my derived Runtype class, I set the editJspPage to a string containing a html extension.
Then create a Controller which listens at said address, creates a ModelAndView based on a JSP file, and pass in the OAuthProvider (or details there of) as a parameter on the request.

 

Done.

0

Please sign in to leave a comment.