定制 mittwald/vault-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mittwald/vault-php

Composer 安装命令:

composer require mittwald/vault-php

包简介

A PHP client library for 'Vault by HashiCorp'

README 文档

README

Latest Release CI License: MIT

A modern PHP client for HashiCorp Vault — unlock secure secrets management in your PHP applications.

Features

  • API Client for HashiCorp Vault
    Simple and intuitive interface for Vault HTTP API.
  • Bulk Operations
    Perform read/write operations on multiple secrets in a single workflow for efficiency.
  • Authentication Support
    Compatible with popular Vault auth backends (Token, AppRole, User/Password, etc.).
  • Secret Engines
    Easy interaction with common secret engines (Transit, etc.).
  • Typed Responses
    Strong-typed, doctrine-based responses for safer PHP development.
  • Extendable & PSR-compliant
    Easily extend class behaviors and integrate with PSR-18 HTTP clients.

Installation

Install via Composer:

composer require mittwald/vault-php

Usage

Below is a basic example of how to interact with Vault using this library:

<?php

require 'vendor/autoload.php';

use VaultPHP\VaultClient;
use VaultPHP\Authentication\Provider\Token;
use VaultPHP\SecretEngines\Engines\Transit\Transit;

use GuzzleHttp\Client;

// setting up independent http client - example with guzzle http client
$httpClient = new Client(['verify' => false]);

// setting up desired vault strategy
$authProvider = new Token('dummyToken');

// Initialize Vault client
$client = new VaultClient(
    $httpClient,
    $authProvider,
    'https://vault.example.com:1337/transit/'
);

// List all keys from Transit Secret engine
$api = new Transit($client);
var_dump($api->listKeys());

For more advanced use (custom HTTP clients, other auth methods, etc.), see the examples/ directory.

Supported Vault Operations

  • Authentication
    • Token
    • AppRole
    • User/Password
    • Kubernetes
  • Transit Secret Engine
    • Encrypt/Decrypt
    • Update Key Config
    • Create Key
    • Delete Key
    • List Keys
    • Sign Data

Configuration

You can inject any PSR-18 HTTP Client for maximum flexibility:

$client = new VaultClient(
    $yourPsr18Client,
    $auth,
    'https://vault.example.com:1337'
);

Testing

To run the test suite:

composer install
composer test

Security

If you discover any security issues, please see SECURITY.md for responsible disclosure guidelines.

License

This library is Open Source and distributed under the MIT license.

Links

mittwald/vault-php 适用场景与选型建议

mittwald/vault-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 103.81k 次下载、GitHub Stars 达 57, 最近一次更新时间为 2020 年 07 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mittwald/vault-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mittwald/vault-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 mittwald/vault-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 57
  • Watchers: 5
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-06