diff --git a/.changeset/moody-crabs-march.md b/.changeset/moody-crabs-march.md
index 3d7bc2d290..f3ae24629a 100644
--- a/.changeset/moody-crabs-march.md
+++ b/.changeset/moody-crabs-march.md
@@ -1,6 +1,6 @@
---
-'@backstage/plugin-vault': minor
-'@backstage/plugin-vault-backend': minor
+'@backstage/plugin-vault': patch
+'@backstage/plugin-vault-backend': patch
---
Added a path notion in addition to secret name to allow to differentiate secrets in subpaths
diff --git a/plugins/vault/src/components/EntityVaultTable/EntityVaultTable.tsx b/plugins/vault/src/components/EntityVaultTable/EntityVaultTable.tsx
index 85035c04d9..5923a4db6b 100644
--- a/plugins/vault/src/components/EntityVaultTable/EntityVaultTable.tsx
+++ b/plugins/vault/src/components/EntityVaultTable/EntityVaultTable.tsx
@@ -32,6 +32,13 @@ export const vaultSecretPath = (entity: Entity) => {
return { secretPath };
};
+function getSecretRelativeName(
+ secretPath: string,
+ secret: VaultSecret,
+): string {
+ return `${secret.path.replace(`${secretPath}/`, '')}/${secret.name}`;
+}
+
export const EntityVaultTable = ({ entity }: { entity: Entity }) => {
const vaultApi = useApi(vaultApiRef);
const { secretPath } = vaultSecretPath(entity);
@@ -54,11 +61,11 @@ export const EntityVaultTable = ({ entity }: { entity: Entity }) => {
const data = (value || []).map(secret => {
return {
- secret: `${secret.path.replace(secretPath + "/", "")}/${secret.name}`,
+ secret: getSecretRelativeName(secretPath, secret),
view: (
@@ -67,7 +74,7 @@ export const EntityVaultTable = ({ entity }: { entity: Entity }) => {
edit: (