承接 nohnaimer/yii2-vault-client 相关项目开发

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

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

nohnaimer/yii2-vault-client

最新稳定版本:0.1.0

Composer 安装命令:

composer require nohnaimer/yii2-vault-client

包简介

This extension client for Hashicorp Vault backend.

README 文档

README

Latest Stable Version License Total Downloads

This extension client for Hashicorp Vault.

Installation

The preferred way to install this extension through composer.

You can set the console

~$ composer require "nohnaimer/yii2-vault-client" --prefer-dist

or add

"require": {
    "nohnaimer/yii2-vault-client": "0.1.*"
}

in require section in composer.json file.

Configuration

For store php-fpm environment variables from system (macOS, Linux, Unix) need to uncomment clear_env = no string in /etc/php/php-fpm.d/www.conf

Need add environment variables:

VAULT_ADDR=https://vault.url/
VAULT_TOKEN=token
VAULT_KV_PATH=/kv

docker-compose example:

...
php:
  image: php:latest
  container_name: php
  restart: on-failure
  working_dir: /var/www
  environment:
    VAULT_ADDR: https://127:0:0:1:8200/
    VAULT_TOKEN: hvs.hrpvk3rEpD2HaHckeb976Ppw
  volumes:
    - .:/var/www:cached
  depends_on:
    - postgres
...

Use yii2 migrations

class m221103_161325_vault_init extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $client = new Client([
            'url' => 'url',
            'token' => 'token',
        ]);

        $kv = new KVv1([
            'path' => '/kv',
            'client' => $client,
        ]);
        
        //add
        $kv->post('/my/secret', ['key' => 'value']);
        
        //delete
        $kv->delete('/my/secret/key');
    }
}

License

yii2-vault-client it is available under a BSD 3-Clause License. Detailed information can be found in the LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-11-07