Merge pull request #20315 from ivangonzalezacuna/vault-new-backend-system

(new-backend-system): Migrate vault to new backend system
This commit is contained in:
Patrik Oldsberg
2023-10-24 11:53:36 +02:00
committed by GitHub
22 changed files with 446 additions and 12 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-vault-node': minor
---
Initial version of the `plugin-vault-node`` package. It contains the extension point definitions
for the vault backend, as well as some types that will be deprecated in the backend plugin.
+33
View File
@@ -0,0 +1,33 @@
---
'@backstage/plugin-vault-backend': minor
---
Added support for the [new backend system](https://backstage.io/docs/backend-system/).
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
// ... other feature additions
+ backend.add(import('@backstage/plugin-vault-backend');
backend.start();
```
If you use the new backend system, the token renewal task can be defined via configuration file:
```diff
vault:
baseUrl: <BASE_URL>
token: <TOKEN>
schedule:
+ frequency: ...
+ timeout: ...
+ # Other schedule options, such as scope or initialDelay
```
If the `schedule` is omitted or set to `false` no token renewal task will be scheduled.
If the value of `schedule` is set to `true` the renew will be scheduled hourly (the default).
In other cases (like in the diff above), the defined schedule will be used.
**DEPRECATIONS**: The interface `VaultApi` and the type `VaultSecret` are now deprecated. Import them from `@backstage/plugin-vault-node`.