Я занимаюсь разработкой проекта в Symforny 5 и хочу использовать Google Cloud Storage, установить пакет phpleague / flysystem-bundle с поддержкой superbalist / flysystem-google-storage, как указано в документации, создать учетные данные. json в Консоль Google и ведро, но я получаю следующую ошибку:
{
"error": {
"code": 401,
"message": "Invalid Credentials",
"errors": [
{
"message": "Invalid Credentials",
"domain": "global",
"reason": "authError",
"locationType": "header",
"location": "Authorization"
}
]
}
}
\vendor\google\cloud-core\src\RequestWrapper.php (line 362)
Конфигурации:
flysystem:
storages:
default.storage:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/storage/default'
gcs.storage:
adapter: 'gcloud'
options:
client: 'gcloud_client_service' # The service ID of the Google\Cloud\Storage\StorageClient instance
bucket: 'test-storage'
#prefix: 'optional/path/prefix'
api_url: 'https://storage.googleapis.com'
В service.yml
gcloud_client_service:
class: Google\Cloud\Storage\StorageClient
arguments:
- projectId: 'storage-project'
- keyFilePath: '../credentials.json'