Accessing another plugin's configuration

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Accessing another plugin's configuration

dschulten-2
Hi,

I am looking into https://issues.jenkins-ci.org/browse/JENKINS-6964
(Selenium plugin can't start RCs on slaves.) where Kohsuke proposed to
tunnel the Selenium communication.

In order to establish the tunnel, I would like to read the
configuration of the slave and get SSH credentials from there.

The ssh-slave plugin persists the slave credentials for its own use,
but is it possible to access this information from other plugins? If
so, how?

Best regards,
Dietrich
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

Emanuele Zattin
Let's suppose you have a Project object you want the instance of a
particular Publisher that job is configured for... then you can:

MyPublisher = Iterables.filter(p.getPublishers().values(),
Predicates.instanceOf(MyPublisher.class));

I hope this helps.

BR,

Emanuele Zattin
---------------------------------------------------
-I don't have to know an answer. I don't feel frightened by not
knowing things; by being lost in a mysterious universe without any
purpose — which is the way it really is, as far as I can tell,
possibly. It doesn't frighten me.- Richard Feynman



On Wed, Feb 22, 2012 at 11:06 AM, dschulten
<[hidden email]> wrote:

> Hi,
>
> I am looking into https://issues.jenkins-ci.org/browse/JENKINS-6964
> (Selenium plugin can't start RCs on slaves.) where Kohsuke proposed to
> tunnel the Selenium communication.
>
> In order to establish the tunnel, I would like to read the
> configuration of the slave and get SSH credentials from there.
>
> The ssh-slave plugin persists the slave credentials for its own use,
> but is it possible to access this information from other plugins? If
> so, how?
>
> Best regards,
> Dietrich
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

Ulli Hafner
I think this approach is quite fragile (well it works but may break very
soon...).

I would suggest that you talk with the author of the plug-in to see if
he could add an extension point for those properties.

Ulli


On 02/22/2012 11:12 AM, Emanuele Zattin wrote:

> Let's suppose you have a Project object you want the instance of a
> particular Publisher that job is configured for... then you can:
>
> MyPublisher = Iterables.filter(p.getPublishers().values(),
> Predicates.instanceOf(MyPublisher.class));
>
> I hope this helps.
>
> BR,
>
> Emanuele Zattin
> ---------------------------------------------------
> -I don't have to know an answer. I don't feel frightened by not
> knowing things; by being lost in a mysterious universe without any
> purpose — which is the way it really is, as far as I can tell,
> possibly. It doesn't frighten me.- Richard Feynman
>
>
>
> On Wed, Feb 22, 2012 at 11:06 AM, dschulten
> <[hidden email]> wrote:
>> Hi,
>>
>> I am looking into https://issues.jenkins-ci.org/browse/JENKINS-6964
>> (Selenium plugin can't start RCs on slaves.) where Kohsuke proposed to
>> tunnel the Selenium communication.
>>
>> In order to establish the tunnel, I would like to read the
>> configuration of the slave and get SSH credentials from there.
>>
>> The ssh-slave plugin persists the slave credentials for its own use,
>> but is it possible to access this information from other plugins? If
>> so, how?
>>
>> Best regards,
>> Dietrich

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

Emanuele Zattin
Hmm... I was proposed that by Kohsuke... his example in particular was:

Shell s = project.getBuildersList().get(Shell.class)

BR,

Emanuele Zattin
---------------------------------------------------
-I don't have to know an answer. I don't feel frightened by not
knowing things; by being lost in a mysterious universe without any
purpose — which is the way it really is, as far as I can tell,
possibly. It doesn't frighten me.- Richard Feynman



On Wed, Feb 22, 2012 at 11:39 AM, Ullrich Hafner
<[hidden email]> wrote:

> I think this approach is quite fragile (well it works but may break very
> soon...).
>
> I would suggest that you talk with the author of the plug-in to see if
> he could add an extension point for those properties.
>
> Ulli
>
>
> On 02/22/2012 11:12 AM, Emanuele Zattin wrote:
>> Let's suppose you have a Project object you want the instance of a
>> particular Publisher that job is configured for... then you can:
>>
>> MyPublisher = Iterables.filter(p.getPublishers().values(),
>> Predicates.instanceOf(MyPublisher.class));
>>
>> I hope this helps.
>>
>> BR,
>>
>> Emanuele Zattin
>> ---------------------------------------------------
>> -I don't have to know an answer. I don't feel frightened by not
>> knowing things; by being lost in a mysterious universe without any
>> purpose — which is the way it really is, as far as I can tell,
>> possibly. It doesn't frighten me.- Richard Feynman
>>
>>
>>
>> On Wed, Feb 22, 2012 at 11:06 AM, dschulten
>> <[hidden email]> wrote:
>>> Hi,
>>>
>>> I am looking into https://issues.jenkins-ci.org/browse/JENKINS-6964
>>> (Selenium plugin can't start RCs on slaves.) where Kohsuke proposed to
>>> tunnel the Selenium communication.
>>>
>>> In order to establish the tunnel, I would like to read the
>>> configuration of the slave and get SSH credentials from there.
>>>
>>> The ssh-slave plugin persists the slave credentials for its own use,
>>> but is it possible to access this information from other plugins? If
>>> so, how?
>>>
>>> Best regards,
>>> Dietrich
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

dschulten-2
Meanwhile I know a bit more precise what I would like ;-)
The ssl-slaves plugin maintains a list of ssh connections which I
could use to open tunnels, at least it seems so.

However, getting the plugin instance is difficult. This fails:

Plugin sshSlavesPlugin = Hudson.getInstance()
                                       .getPlugin("ssh-slaves");

because the Hudson instance is null in the HudsonRemoteControlPool.
When exactly can I expect a valid Hudson instance? Within an
@Extension that seems to be the case, but I need it in the remote
control pool.

Who would be the right person for the ssl-slaves Plugin? Stephen
Connolly is the @author. Does anyone know how to contact him?

Best regards,
Dietrich Schulten


On 22 Feb., 12:22, Emanuele Zattin <[hidden email]> wrote:

> Hmm... I was proposed that by Kohsuke... his example in particular was:
>
> Shell s = project.getBuildersList().get(Shell.class)
>
> BR,
>
> Emanuele Zattin
> ---------------------------------------------------
> -I don't have to know an answer. I don't feel frightened by not
> knowing things; by being lost in a mysterious universe without any
> purpose — which is the way it really is, as far as I can tell,
> possibly. It doesn't frighten me.- Richard Feynman
>
> On Wed, Feb 22, 2012 at 11:39 AM, Ullrich Hafner
>
>
>
>
>
>
>
> <[hidden email]> wrote:
> > I think this approach is quite fragile (well it works but may break very
> > soon...).
>
> > I would suggest that you talk with the author of the plug-in to see if
> > he could add an extension point for those properties.
>
> > Ulli
>
> > On 02/22/2012 11:12 AM, Emanuele Zattin wrote:
> >> Let's suppose you have a Project object you want the instance of a
> >> particular Publisher that job is configured for... then you can:
>
> >> MyPublisher = Iterables.filter(p.getPublishers().values(),
> >> Predicates.instanceOf(MyPublisher.class));
>
> >> I hope this helps.
>
> >> BR,
>
> >> Emanuele Zattin
> >> ---------------------------------------------------
> >> -I don't have to know an answer. I don't feel frightened by not
> >> knowing things; by being lost in a mysterious universe without any
> >> purpose — which is the way it really is, as far as I can tell,
> >> possibly. It doesn't frighten me.- Richard Feynman
>
> >> On Wed, Feb 22, 2012 at 11:06 AM, dschulten
> >> <[hidden email]> wrote:
> >>> Hi,
>
> >>> I am looking intohttps://issues.jenkins-ci.org/browse/JENKINS-6964
> >>> (Selenium plugin can't start RCs on slaves.) where Kohsuke proposed to
> >>> tunnel the Selenium communication.
>
> >>> In order to establish the tunnel, I would like to read the
> >>> configuration of the slave and get SSH credentials from there.
>
> >>> The ssh-slave plugin persists the slave credentials for its own use,
> >>> but is it possible to access this information from other plugins? If
> >>> so, how?
>
> >>> Best regards,
> >>> Dietrich
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

danielpetisme
In reply to this post by dschulten-2
Hi guys,

If Iunderstand the problem, it's all about sharing information betwwen plugins, right? And what about centralize these information?
In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we have and may fit your needs.

https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ

To centralize information (For instance, SSH connections details) we define RESOURCES. This resource (a SSH Site for instance) will be your credentials storage.
Some of our plugins, built upon this one, display the list of the available resources (preventing user mistakes).

If you (or other) are interested by this plugin, we can release it.

Cheers

Daniel



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

stephenconnolly
Actually CloudBees have a credentials store plugin that we will be
releasing OSS in the near future. That plugin should solve quite a few
credentials management problems.

On 22 February 2012 16:38, Daniel PETISME <[hidden email]> wrote:

> Hi guys,
>
> If Iunderstand the problem, it's all about sharing information betwwen
> plugins, right? And what about centralize these information?
> In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we
> have and may fit your needs.
>
> https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ
>
> To centralize information (For instance, SSH connections details) we define
> RESOURCES. This resource (a SSH Site for instance) will be your credentials
> storage.
> Some of our plugins, built upon this one, display the list of the available
> resources (preventing user mistakes).
>
> If you (or other) are interested by this plugin, we can release it.
>
> Cheers
>
> Daniel
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

stephenconnolly
Just to let people know what kind of things it can do:

1. Introduces Global (all jobs in the system) & System (only root
actions) scoped credentials
2. Introduces per-user credentials (only available to the user that owns them)
3. (With enhancements to our folders plugin) Introduces per folder credentials

Some things we need to do before OSSing it involve finding a nice way
to integrate it into the git & subversion auth, so that this
credential store can be used in addition to the current (what I would
see as legacy) auth store(s)

Plugins depending on the cloudbees-credentials plugin can define their
own credentials types and those credentials types will be available
via the same API.

The API allows resolving credentials for a specific item and for a
specific authentication.

On 22 February 2012 17:02, Stephen Connolly
<[hidden email]> wrote:

> Actually CloudBees have a credentials store plugin that we will be
> releasing OSS in the near future. That plugin should solve quite a few
> credentials management problems.
>
> On 22 February 2012 16:38, Daniel PETISME <[hidden email]> wrote:
>> Hi guys,
>>
>> If Iunderstand the problem, it's all about sharing information betwwen
>> plugins, right? And what about centralize these information?
>> In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we
>> have and may fit your needs.
>>
>> https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ
>>
>> To centralize information (For instance, SSH connections details) we define
>> RESOURCES. This resource (a SSH Site for instance) will be your credentials
>> storage.
>> Some of our plugins, built upon this one, display the list of the available
>> resources (preventing user mistakes).
>>
>> If you (or other) are interested by this plugin, we can release it.
>>
>> Cheers
>>
>> Daniel
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

dschulten-2

In my case I need at least access to ssh slave credentials to open an ssh tunnel for selenium remote controls, or maybe even to the established connections stored within ssh-slaves pluginImpl, if they can be used to create tunnels.
But it seems currently I would need an extension point in ssh-slaves in order to access its active connections safely.
@Stephen: would you accept such an extension point in ssh-slaves? Or would you rather have me read the credentials from the plugin you mentioned above?

Cheers,
D'

Am 22.02.2012 18:26 schrieb "Stephen Connolly" <[hidden email]>:
Just to let people know what kind of things it can do:

1. Introduces Global (all jobs in the system) & System (only root
actions) scoped credentials
2. Introduces per-user credentials (only available to the user that owns them)
3. (With enhancements to our folders plugin) Introduces per folder credentials

Some things we need to do before OSSing it involve finding a nice way
to integrate it into the git & subversion auth, so that this
credential store can be used in addition to the current (what I would
see as legacy) auth store(s)

Plugins depending on the cloudbees-credentials plugin can define their
own credentials types and those credentials types will be available
via the same API.

The API allows resolving credentials for a specific item and for a
specific authentication.

On 22 February 2012 17:02, Stephen Connolly
<[hidden email]> wrote:
> Actually CloudBees have a credentials store plugin that we will be
> releasing OSS in the near future. That plugin should solve quite a few
> credentials management problems.
>
> On 22 February 2012 16:38, Daniel PETISME <[hidden email]> wrote:
>> Hi guys,
>>
>> If Iunderstand the problem, it's all about sharing information betwwen
>> plugins, right? And what about centralize these information?
>> In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we
>> have and may fit your needs.
>>
>> https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ
>>
>> To centralize information (For instance, SSH connections details) we define
>> RESOURCES. This resource (a SSH Site for instance) will be your credentials
>> storage.
>> Some of our plugins, built upon this one, display the list of the available
>> resources (preventing user mistakes).
>>
>> If you (or other) are interested by this plugin, we can release it.
>>
>> Cheers
>>
>> Daniel
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

stephenconnolly
My aim is that *all* plugins that need to store credentials would use this plugin as the store. The type of credentials is an extension point, and you ask for credentials of a specific type, so ssh-slaves would define its credential type and store/retrieve from the central store... Other plugins, if they depend on ssh-slaves, will have access to the ssh credentials type, and by depending on cloudbees-credentials, can then access the store also

On Wednesday, 22 February 2012, Dietrich Schulten wrote:

In my case I need at least access to ssh slave credentials to open an ssh tunnel for selenium remote controls, or maybe even to the established connections stored within ssh-slaves pluginImpl, if they can be used to create tunnels.
But it seems currently I would need an extension point in ssh-slaves in order to access its active connections safely.
@Stephen: would you accept such an extension point in ssh-slaves? Or would you rather have me read the credentials from the plugin you mentioned above?

Cheers,
D'

Am 22.02.2012 18:26 schrieb "Stephen Connolly" <<a href="javascript:_e({}, &#39;cvml&#39;, &#39;stephen.alan.connolly@gmail.com&#39;);" target="_blank">stephen.alan.connolly@...>:
Just to let people know what kind of things it can do:

1. Introduces Global (all jobs in the system) & System (only root
actions) scoped credentials
2. Introduces per-user credentials (only available to the user that owns them)
3. (With enhancements to our folders plugin) Introduces per folder credentials

Some things we need to do before OSSing it involve finding a nice way
to integrate it into the git & subversion auth, so that this
credential store can be used in addition to the current (what I would
see as legacy) auth store(s)

Plugins depending on the cloudbees-credentials plugin can define their
own credentials types and those credentials types will be available
via the same API.

The API allows resolving credentials for a specific item and for a
specific authentication.

On 22 February 2012 17:02, Stephen Connolly
<<a href="javascript:_e({}, &#39;cvml&#39;, &#39;stephen.alan.connolly@gmail.com&#39;);" target="_blank">stephen.alan.connolly@...> wrote:
> Actually CloudBees have a credentials store plugin that we will be
> releasing OSS in the near future. That plugin should solve quite a few
> credentials management problems.
>
> On 22 February 2012 16:38, Daniel PETISME <<a href="javascript:_e({}, &#39;cvml&#39;, &#39;daniel.petisme@gmail.com&#39;);" target="_blank">daniel.petisme@...> wrote:
>> Hi guys,
>>
>> If Iunderstand the problem, it's all about sharing information betwwen
>> plugins, right? And what about centralize these information?
>> In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we
>> have and may fit your needs.
>>
>> https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ
>>
>> To centralize information (For instance, SSH connections details) we define
>> RESOURCES. This resource (a SSH Site for instance) will be your credentials
>> storage.
>> Some of our plugins, built upon this one, display the list of the available
>> resources (preventing user mistakes).
>>
>> If you (or other) are interested by this plugin, we can release it.
>>
>> Cheers
>>
>> Daniel
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Accessing another plugin's configuration

dschulten-2

Great! I'll use that, then. Thank you very much.

Am 22.02.2012 21:52 schrieb "Stephen Connolly" <[hidden email]>:
My aim is that *all* plugins that need to store credentials would use this plugin as the store. The type of credentials is an extension point, and you ask for credentials of a specific type, so ssh-slaves would define its credential type and store/retrieve from the central store... Other plugins, if they depend on ssh-slaves, will have access to the ssh credentials type, and by depending on cloudbees-credentials, can then access the store also

On Wednesday, 22 February 2012, Dietrich Schulten wrote:

In my case I need at least access to ssh slave credentials to open an ssh tunnel for selenium remote controls, or maybe even to the established connections stored within ssh-slaves pluginImpl, if they can be used to create tunnels.
But it seems currently I would need an extension point in ssh-slaves in order to access its active connections safely.
@Stephen: would you accept such an extension point in ssh-slaves? Or would you rather have me read the credentials from the plugin you mentioned above?

Cheers,
D'

Am 22.02.2012 18:26 schrieb "Stephen Connolly" <[hidden email]>:
Just to let people know what kind of things it can do:

1. Introduces Global (all jobs in the system) & System (only root
actions) scoped credentials
2. Introduces per-user credentials (only available to the user that owns them)
3. (With enhancements to our folders plugin) Introduces per folder credentials

Some things we need to do before OSSing it involve finding a nice way
to integrate it into the git & subversion auth, so that this
credential store can be used in addition to the current (what I would
see as legacy) auth store(s)

Plugins depending on the cloudbees-credentials plugin can define their
own credentials types and those credentials types will be available
via the same API.

The API allows resolving credentials for a specific item and for a
specific authentication.

On 22 February 2012 17:02, Stephen Connolly
<[hidden email]> wrote:
> Actually CloudBees have a credentials store plugin that we will be
> releasing OSS in the near future. That plugin should solve quite a few
> credentials management problems.
>
> On 22 February 2012 16:38, Daniel PETISME <[hidden email]> wrote:
>> Hi guys,
>>
>> If Iunderstand the problem, it's all about sharing information betwwen
>> plugins, right? And what about centralize these information?
>> In fact, Romain Seguy already talk about a (not open-sourced yet) plugin we
>> have and may fit your needs.
>>
>> https://groups.google.com/d/msg/jenkinsci-dev/baNWBRuThWE/QARWQE-b8KEJ
>>
>> To centralize information (For instance, SSH connections details) we define
>> RESOURCES. This resource (a SSH Site for instance) will be your credentials
>> storage.
>> Some of our plugins, built upon this one, display the list of the available
>> resources (preventing user mistakes).
>>
>> If you (or other) are interested by this plugin, we can release it.
>>
>> Cheers
>>
>> Daniel
>>
>>
>>
Loading...