-
Bug
-
Resolution: Unresolved
-
Minor
-
None
FileOnMasterPrivateKeySource is serialized as DirectEntryPrivateKeySource.
To reproduce it:
- Create new credentials of type "SSH Username with private key"
- Fill fields with test data
- Select "From a file on Jenkins master" for "Private Key" and fill the field with something ("/tmp/my-cert" or the like).
- Save
Now read the credential from CLI:
java -jar jenkins-cli.jar -noKeyAuth -s http://localhost:8080/jenkins/ get-credentials-as-xml system::system::jenkins _ [your-credentials-id]
Output is:
<com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey plugin="ssh-credentials@1.10"> <scope>GLOBAL</scope> <id>58ec63b5-92ab-4521-83b8-701fb7bd8162</id> <description>test</description> <username>test</username> <passphrase> <secret-redacted/> </passphrase> <privateKeySource class="com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource"> <privateKey></privateKey> </privateKeySource> </com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey>
Note the privateKeySource is com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource instead of com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$FileOnMasterPrivateKeySource
I've checked serialization on disk is correct.