insites-consulting / azure-key-vault

Allow secrets to be easily fetched from an Azure Key Vault from within a Laravel application
4 stars 10 forks source link

Non-static method InsitesConsulting\AzureKeyVault\Vault::secret() cannot be called statically #7

Closed carlituxman closed 2 years ago

carlituxman commented 2 years ago

I'm trying this bug using with laravel 8 and have this error

if quit use InsitesConsulting\AzureKeyVault\Vault; throws this: Undefined array key "access_token"

insites-consulting/azure-key-vault (v0.3.1)

shealavington commented 2 years ago

I've been looking into this package myself. I came across the same issue, the cause of the issue is because authentication is failing due to invalid details.

I found this through normal debugging, however, really, the package should provide an exception if authentication fails, unfortunately it expects a success and doesn't handle any failures.

Some error handling needs adding before this line to fix it: https://github.com/insites-consulting/azure-key-vault/blob/d7ea628c5da3188ebd7e200985a603e77d457c90/src/Vault.php#L43

I've added a PR that should make that error clearer.

stephen-isc commented 2 years ago

Thanks for this, @shealavington - that is now in v0.3.2, released today.