csharpru / vault-php Goto Github PK
View Code? Open in Web Editor NEWBest Vault client for PHP that you can find
License: MIT License
Best Vault client for PHP that you can find
License: MIT License
Right now tests will run only if you have VCR prepared or real initialised Vault, but that is not acceptable for unit testing. We need to replace real Vault usage with mock.
Hi,
I have seen that the examples & tests given are using "Zend/Diactoros" which has been abandoned 2019-12-31.
The repo has been moved to "laminas/laminas-diactoros".
Are there already any tests replacing "Zend/Diactoros" with "laminas/laminas-diactoros"?
Do you still recommend to use "Zend/Diactoros"?
We definitely need this, because fetching secrets one by one is very slow in PHP world.
When I call the new Client(new Guzzle6Transport())
, there is an error that can not find Guzzle6Transport class
so I have to download the composer require csharpru/vault-php-guzzle6-transport
manually.
I'm unable to install this library in a Drupal 8.5.x application as there is a conflict on the dependency doctrine/inflector
.
Changing the version constraint from ~1.1.0
to ~1.1
resolves this issue for me.
I can see this was intentionally set in this commit - b7fc83d
Is there a specific issue which necessitated this? If so, is it a bug that can be resolved in this library?
Line 21 in 04be977
Can you please provide a smallest working example which fetches a single secret from vault? I see the docs currently cover everything up to connecting with a vault as a client, but I don't see how they actually query.
Vault KV2 expects the JSON Body to be formed as documented here:
https://www.vaultproject.io/api/secret/kv/kv-v2.html#data
We should consider providing an optional parameter that defines the kv version used.
I'm gonna provide a PR.
Update:
I probpably won't provide a PR :)
Did a workaround in the AbstractionClass, i.e.:
* @param string $path
* @param array $secrets
* @return bool
*/
public function put(string $path, array $secrets): bool
{
try {
$secrets = ['data' => $secrets];
$result = $this->client->write($path, $secrets);
...
The warning in the README.txt is from August of 2017. Is it still an unstable project? Or is it there a RC planned?
Right now we're using Guzzle 5 and Guzzle 6 transports.
Due to that decision you cannot run tests without installation of Guzzle 6 transport and PHP >= 5.5, so we need to implement default transport that will be compatible with 5.3 and above, so that you don't need to install transport if you don't want to.
Could a new release be tagged?
4.1 version is currently not usable.
Currently LeaseTrait::$leaseId is an 'int|null' and LeaseTrait::getLeaseId() return an integer or null.
An example of the response on $client->read() for $leaseId against the AWS vault backend shows a string of aws/creds/test/QALQZOlBOnl5LsFReqohr7gl
which when calling getLease() causes a TypeError NOTICE: PHP message: TypeError: Vault\ResponseModels\Response::getLeaseId(): Return value must be of type ?int, string returned in /var/www/html/vendor/csharpru/vault-php/src/ResponseModels/Traits/LeaseTrait.php on line 32
https://www.vaultproject.io/api-docs/system/leases also appears to indicate this should be a string.
{
"id": "auth/token/create/25c75065466dfc5f920525feafe47502c4c9915c",
"issue_time": "2017-04-30T10:18:11.228946471-04:00",
"expire_time": "2017-04-30T11:18:11.228946708-04:00",
"last_renewal_time": null,
"renewable": true,
"ttl": 3558
}
PHP-HTTP is used by many libraries to get rid of transport management using an abstraction: http://docs.php-http.org/en/latest/
Basically, with that, you don't need to maintain your Guzzle transports anymore and you let the possibility to the user to use the transport he wants: http://docs.php-http.org/en/latest/clients.html
Plus, it will reduce dependencies on end project.
Regards
Hi,
We can't install a dependency which use this project because we have another dependency which use the latest version of doctrine/inflector.
I see this project use a strict version (~1.1) of doctrine/inflector. In #14 it is said that there was a bug at this time.
Is there any plan to test with the new version (1.3.1) and maybe update it ?
I don't know enough about Composer to know if this is an issue with your repo or an issue with composer, but when I do a composer require for your project, the "transports" folder is missing. Which is of course causing an error when the guzzle6transport file tries to call it:
"PHP Fatal error: Uncaught Error: Interface 'Vault\Transports\Transport' not found"
Need to improve documentation and add examples. Of course test are talking, but not so explicitly :)
See magento/magento2-functional-testing-framework#723 :)
I notice this is already done on master branch, it probably just needs to be tagged and pushed.
The title says for itself :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.