keboola/vault-api-client
Composer 安装命令:
composer require keboola/vault-api-client
包简介
Keboola Vault API client
README 文档
README
PHP client for the Keboola Vault API, built on top of keboola/php-api-client-base.
Installation
composer require keboola/vault-api-client
Usage
use Keboola\VaultApiClient\Variables\Model\ListOptions; use Keboola\VaultApiClient\Variables\Model\Variable; use Keboola\VaultApiClient\Variables\VariablesApiClient; $client = new VariablesApiClient( baseUrl: 'https://vault.keboola.com', token: 'your-storage-api-token', ); // Create a variable $variable = $client->createVariable( key: 'MY_SECRET', value: 'secret-value', flags: [Variable::FLAG_ENCRYPTED], attributes: ['branchId' => '123'], ); // List variables $variables = $client->listVariables(new ListOptions(offset: 0, limit: 50)); // List scoped variables for a branch $branchVariables = $client->listScopedVariablesForBranch(branchId: '123'); // Delete a variable $client->deleteVariable(hash: $variable->hash);
Custom configuration
Pass retry, timeout, and logging options directly as constructor parameters:
use Monolog\Logger; $client = new VariablesApiClient( baseUrl: 'https://vault.keboola.com', token: 'your-storage-api-token', backoffMaxTries: 3, logger: new Logger('vault'), );
License
MIT licensed, see LICENSE file.
统计信息
- 总下载量: 6.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-25