承接 jccp/vault 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jccp/vault

Composer 安装命令:

composer require jccp/vault

包简介

README 文档

README

Build Status

Vault SDK

Supports:

  • auth
    • tokens
    • authrole
  • general
    • read
    • write

Examples

Configure Environment

The default client will leverage the environment variables VAULT_ADDR and VAULT_TOKEN

export VAULT_ADDR=http://localhost:8200
export VAULT_TOKEN=horde

Read and Write Secrets

$secrets = [
	"foo" => "bar",
	"baz" => "boo",
];

$config = new DefaultVaultConfig('http://localhost:8200', new Tokens('horde'), '');

$vaultClient = new VaultClient(new Client());
$vaultClient->withConfig($config);
$vaultClient->write('secret/testing', $secrets);
$found = $vaultClient->read('secret/testing');

print_r($found['data']);

// Output:
// Array
// (
//     [baz] => boo
//     [foo] => bar
// )

Login with AppRole

$roleId = "...";
$secretId = "...";
$secrets = [
	"foo" => "bar",
	"baz" => "boo",
];

$vaultClient = new VaultClient(new Client());

$auth = new AppRole($vaultClient);
$auth->with('theRoleId', 'theSecretId');

$config = new DefaultVaultConfig('http://localhost:8200', $auth, '');

$vaultClient->withConfig($config);
$vaultClient->write('secret/testing', $secrets);

$found = $vaultClient->read('secret/testing');
print_r($found['data']);

// Output:
// Array
// (
//     [baz] => boo
//     [foo] => bar
// )

Credit

This is a fork of https://github.com/fliglio/vault

统计信息

  • 总下载量: 152
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2017-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固