How shall I use EditRunTypeControllerExtension to encrypt password property


I'm developing a Runner plugin for sending test results to some external system and I have a password field on GUI.

I would like to encrypt passwords that users provide, so they are stored in build XML files in encrypted form.

I'm trying to change the value of passed password parameter in EditRunTypeControllerExtension.updateBuildType() method, but could not do that easily.

As far as I got, I need to update BuildTypeSettings object and pass changed value into it somehow. I was able to get correct SBuildRunnerDescriptor for my runner, but SBuildRunnerDescriptor interface does not provide any setters, and getParameters() returns UnmodifiableMap, so I cannot update it.

However, if I cast SBuildRunnerDescriptor to SBuildRunnerDescriptorImpl I can use setRunnerParameters() method and it seems to be working, but I don't really like relying on such approach, as it's your internal stuff which might change.

Do you know if there is a better approach for encryption of passwords entered in custom runner configuration form, so they are stored in encrypted form in build configuration XML file?



Please sign in to leave a comment.