Added (optional) publicUrl to vault-backend plugin
Signed-off-by: Casper Thygesen <cth@trifork.com>
This commit is contained in:
@@ -27,6 +27,11 @@ export interface VaultConfig {
|
||||
*/
|
||||
baseUrl: string;
|
||||
|
||||
/**
|
||||
* The publicUrl for your Vault instance (Optional).
|
||||
*/
|
||||
publicUrl?: string;
|
||||
|
||||
/**
|
||||
* The token used by Backstage to access Vault.
|
||||
*/
|
||||
|
||||
@@ -135,11 +135,13 @@ export class VaultClient implements VaultApi {
|
||||
)),
|
||||
);
|
||||
} else {
|
||||
const vaultUrl =
|
||||
this.vaultConfig.publicUrl || this.vaultConfig.baseUrl;
|
||||
secrets.push({
|
||||
name: secret,
|
||||
path: secretPath,
|
||||
editUrl: `${this.vaultConfig.baseUrl}/ui/vault/secrets/${this.vaultConfig.secretEngine}/edit/${secretPath}/${secret}`,
|
||||
showUrl: `${this.vaultConfig.baseUrl}/ui/vault/secrets/${this.vaultConfig.secretEngine}/show/${secretPath}/${secret}`,
|
||||
editUrl: `${vaultUrl}/ui/vault/secrets/${this.vaultConfig.secretEngine}/edit/${secretPath}/${secret}`,
|
||||
showUrl: `${vaultUrl}/ui/vault/secrets/${this.vaultConfig.secretEngine}/show/${secretPath}/${secret}`,
|
||||
});
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user