Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support K/V Secret Engine #6

Open
rizvisx opened this issue Jun 1, 2021 · 1 comment
Open

Support K/V Secret Engine #6

rizvisx opened this issue Jun 1, 2021 · 1 comment
Labels
feature help wanted Extra attention is needed

Comments

@rizvisx
Copy link

rizvisx commented Jun 1, 2021

I am trying to fetch kv secrets with EndpointResponse like this

$response = $client->sendApiRequest(
		  	'GET',
            '/v1/secret/data/creds',
            EndpointResponse::class);

However, In the EndpointResponse class the data is never being set in the properties as this condition below never meets to find the key in the class. there is a declaration for $metaData, but we get metadata in $key below. Also, since there is no $data property it fails on this condition again.

if (property_exists(static::class, (string) $key)) {

So, adding these missing properties gives me data in the response.

 protected $metadata;
 protected $data;

Now, I am new to Vault so I may be doing things wrong way.
Looking forward for your feedback.

Thanks !!

@rizvisx rizvisx changed the title Data missing from EndpointResponse Missing 'data' property from EndpointResponse Jun 1, 2021
@ins0
Copy link
Member

ins0 commented Jun 1, 2021

Hey! Currently vaultPHP only supports the transit secret engine - so the K/V secret engine is not implemented. Feel free to adapt the current implementation from SecretEngines/Transit to support K/V and open a pull request. Every file in that folder is the abstraction between api calls and mapping to a data object that gets parsed and finally served as a response dto.

@ins0 ins0 added feature help wanted Extra attention is needed labels Jun 1, 2021
@ins0 ins0 changed the title Missing 'data' property from EndpointResponse Support K/V Secret Engine Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants