vault-php icon indicating copy to clipboard operation
vault-php copied to clipboard

List API has changed to GET Method

Open Error042 opened this issue 11 months ago • 2 comments

In the BaseClient.php the list method uses LIST as the HTTP Method.

In the Hashicorp Vault documentation all the list endpoints use a standard GET HTTP method. So I get an Error when sending the call.

It just needs to change from this:

/**
 * @param string $path
 *
 * @return Response
 * @throws InvalidArgumentException
 * @throws ClientExceptionInterface
 */
public function list(string $path = ''): Response
{
    return $this->responseBuilder->build($this->send('LIST', $path));
}

To this:

/**
 * @param string $path
 *
 * @return Response
 * @throws InvalidArgumentException
 * @throws ClientExceptionInterface
 */
public function list(string $path = ''): Response
{
    return $this->responseBuilder->build($this->send('GET', $path));
}

Should be not a big deal. :)

Error042 avatar Feb 19 '25 13:02 Error042

I saw that below the list method there was a get method so I used it inside the keys method. :)

Error042 avatar Feb 19 '25 14:02 Error042

As I see in the doc they still use LIST method on some calls, are you sure that we need to delete it and replace with get?

Image

CSharpRU avatar Apr 23 '25 08:04 CSharpRU