Created
December 4, 2019 15:40
-
-
Save sammcgeown/2e43101c758e080cde74c134ebeb2099 to your computer and use it in GitHub Desktop.
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
if(userName == "" || userName == null) { | |
return "Please select a user..." | |
} | |
var vaultUser = "vra" | |
var vaultPassword = "VMware1!" | |
var vaultServer = "vault.definit.local" | |
var vaultPort = "8200" | |
var vaultSecretPath = "vra/ssh" | |
var vaultToken = System.getModule("local.definit.vault").getVaultToken(vaultUser,vaultPassword,vaultServer,vaultPort); | |
var vaultData = System.getModule("local.definit.vault").getVaultSecretData(vaultServer,vaultPort,vaultSecretPath,vaultToken); | |
var vaultDataObj = JSON.parse(vaultData) | |
for (var name in vaultDataObj) { | |
if(name == userName) { | |
return vaultDataObj[name]; | |
} | |
} | |
return "SSH Key not found"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment