{"id":26246415,"url":"https://github.com/mittwald/vaultphp","last_synced_at":"2025-04-23T20:28:01.656Z","repository":{"id":36951729,"uuid":"277473832","full_name":"mittwald/vaultPHP","owner":"mittwald","description":"A PHP client library for \"Vault by HashiCorp\"","archived":false,"fork":false,"pushed_at":"2024-08-26T11:40:25.000Z","size":85,"stargazers_count":43,"open_issues_count":2,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-15T21:20:53.242Z","etag":null,"topics":["client-library","hashicorp","php","php-library","vault"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mittwald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-06T07:34:46.000Z","updated_at":"2024-12-21T00:05:49.000Z","dependencies_parsed_at":"2024-06-25T15:06:05.346Z","dependency_job_id":"860f24c2-9436-47d8-bc7c-96fc5361a40a","html_url":"https://github.com/mittwald/vaultPHP","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":"0.47619047619047616","last_synced_commit":"930b408fef3d932a818cdd4adf320e3718e7c85a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2FvaultPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2FvaultPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2FvaultPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2FvaultPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mittwald","download_url":"https://codeload.github.com/mittwald/vaultPHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250508531,"owners_count":21442246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-library","hashicorp","php","php-library","vault"],"created_at":"2025-03-13T13:18:28.713Z","updated_at":"2025-04-23T20:28:01.636Z","avatar_url":"https://github.com/mittwald.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Hashicorp Vault Client\n\n![Tests](https://github.com/mittwald/vaultPHP/workflows/CI%20Tests/badge.svg)\n\nPHP Client Library for the Hashicorp Vault Service. \nThis Client follows the Request and Response Data equal to the Hashicorp Vault Client Documentation.\n- Authentication https://www.vaultproject.io/api-docs/auth\n- Secret Engines https://www.vaultproject.io/api-docs/secret\n\nFeel free to open Pull Requests to add improvements or missing functionality.\n\n## Installation\n\n### Composer\n`composer require mittwald/vault-php`\n\n## Implemented Functionality:\n- Auth\n  - User/Password\n  - Token\n  - Kubernetes\n  - AppRole\n- Secret Engines\n  - Transit Engine\n    - Encrypt/Decrypt\n    - Update Key Config\n    - Create Key\n    - Delete Key\n    - List Keys\n    - Sign Data\n\n## Basic Usage\n\n```php\n// setting up independent http client \n$httpClient = new Client();\n\n// setting up vault auth provider\n$auth = new Token('foo');\n\n// creating the vault request client\n$client = new VaultClient(\n    $httpClient,\n    $auth,\n    'http://127.0.0.1:8200'\n);\n\n// selecting the desired secret engine\n// e.g. Transit Secret Engine\n$api = new Transit($client);\n\n// calling specific endpoint\n$response = $api-\u003elistKeys();\n\n//reading results\nvar_dump($response-\u003egetKeys());\n//...\n//...\n//Profit...\n```\n\n#### VaultClient\n\n````php\npublic function __construct(\n    HttpClient $httpClient,\n    AuthenticationProviderInterface $authProvider,\n    string $apiHost\n)\n````\n\n`HttpClient` takes every PSR-18 compliant HTTP Client Adapter like `\"php-http/curl-client\": \"^1.7\"`\n\n`AuthenticationProviderInterface` Authentication Provider from `/authentication/provider/*`\n\n`$apiHost` Hashicorp Vault REST Endpoint URL\n\n## Bulk Requests\nUsing Bulk Requests also requires to iterate through the Response\nand calling `hasErrors` within the `MetaData` of each Bulk Item to ensure it was processed successfully.\n\n## Exceptions\nCalling library methods will throw exceptions, indicating where ever invalid data was provided\nor HTTP errors occurred or Vault Generic Endpoint Errors are encountered.\n___\n\n`VaultException`\n\nGeneric Root Exception where every exception in this library extends from.\n___\n\n`VaultHttpException`\n\nException will thrown when something inside the HTTP handling will cause an error.\n___\n\n`VaultAuthenticationException`\n\nWill be thrown when API Endpoint Authentication fails.\n___\n\n`VaultResponseException`\n\nWill be thrown on 5xx status code errors.\n___\n\n`InvalidRouteException`\n\nCalling an Invalid/Non Existing/Disabled Vault API Endpoint will throw this Exception.\n___\n\n`InvalidDataException`\n\nException indicates a failed server payload validation. \n\n___\n\n`KeyNameNotFoundException`\n\nWill be thrown when trying to request an API Endpoint where the Key Name - that is indicated within the url - will not exist.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmittwald%2Fvaultphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmittwald%2Fvaultphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmittwald%2Fvaultphp/lists"}