Open Vinze opened 1 year ago
This indeed would be a welcome feature!
Sorry it's taken me a while to get to this. I have an initial version of something to do this on the branch feature/secret-list in this repository. There's no tests for it yet, but it seems to work.
This returns a LazyCollection so all the pagination is dealt with inside this package.
I won't be able to do much more on this before the new year, but please let me know what you think.
I should note that there might be some throttling to deal with here, since we can only return 25 results in a page and therefore might reasonably need to make quite a few requests.
See https://learn.microsoft.com/en-us/rest/api/azure/#async-operations-throttling-and-paging for more information on this.
I'll give that branch a try, thank you!
Regarding the 25 results limit, I'm syncing the secrets with a scheduled task and then it isn´t really a problem if this takes a couple of minutes.
For other use cases it might be helpful to create 2 functions, for example:
Vault::allSecrets()
Vault::listSecrets($nextLink)
?
First of all, thanks for creating this neat little package!
I'm wondering, would it be possible to list all secrets? (
Vault::listSecrets()
?) After listing the secrets we could use theVault::secret('name')
function to retreive the secret. I found an existing package which already contains this function (see: https://github.com/wapacro/az-keyvault-php/blob/master/src/Secret.php#L93) but your package integrates better with Laravel and I find it easier to use.Would you be willing to add something like this to the package? I tried forking your repo and creating a pull request, but I wasn't able to figure out how to write the required unit tests and install the package on my dev machine.