1.76.3 • Published 1 year ago

@biorate/vault v1.76.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Vault

Vault connector

Examples:

import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { VaultConnector } from '@biorate/vault';

export class Root extends Core() {
  @inject(VaultConnector) public connector: VaultConnector;
}

container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
container.bind<VaultConnector>(VaultConnector).toSelf().inSingletonScope();
container.bind<Root>(Root).toSelf().inSingletonScope();

container.get<IConfig>(Types.Config).merge({
  Vault: [
    {
      name: 'connection',
      options: {
        apiVersion: 'v1',
        endpoint: 'http://localhost:8200',
        token: 'admin',
      },
    },
  ],
});

(async () => {
  const root = container.get<Root>(Root);
  await root.$run();
  await root.connector.current!.write('secret/data/test.json', {
    data: { hello: 'world' },
  });
  const result = await root.connector.current!.read('secret/data/test.json');
  console.log(result.data.data); // { hello: 'world' }
})();

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

1.76.3

1 year ago

1.65.4

1 year ago

1.54.0

2 years ago

1.38.2

2 years ago

1.38.3

2 years ago

1.38.1

2 years ago

1.38.4

2 years ago

1.42.2

2 years ago

1.43.0

2 years ago

1.42.1

2 years ago

1.30.12

2 years ago

1.29.0

2 years ago

1.28.1

2 years ago

1.28.0

2 years ago

1.26.0

2 years ago

1.27.2

2 years ago

1.27.0

2 years ago

1.27.1

2 years ago

1.24.0

2 years ago

1.20.1

3 years ago

1.11.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago