Created
November 27, 2019 19:38
-
-
Save msoranno/6433af7b5fd9ddfc62accf1d8fb1889b to your computer and use it in GitHub Desktop.
Print almost all credentials from console.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class | |
) | |
for (c in creds) { | |
println(c.id) | |
if (c.properties.username) { | |
println(" description: " + c.description) | |
} | |
if (c.properties.username) { | |
println(" username: " + c.username) | |
} | |
if (c.properties.password) { | |
println(" password: " + c.password) | |
} | |
if (c.properties.passphrase) { | |
println(" passphrase: " + c.passphrase) | |
} | |
if (c.properties.secret) { | |
println(" secret: " + c.secret) | |
} | |
if (c.properties.privateKeySource) { | |
println(" privateKey: " + c.getPrivateKey()) | |
} | |
println("") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment