简体   繁体   中英

When intergrating Active Storage and Google Cloud Storage, is the "project" key in storage.yml really necessary?

Below is an example of GCS settings in storage.yml :

google:
  service: GCS
  credentials: <%= Rails.root.join("path/to/keyfile.json") %>
  project: ""
  bucket: ""

Since there is already project_id inside credentials , what is the purpose of project ? Does this make any difference if I omit this key?

This seems to be a requirement from Active Storage as mentioned here . Most likely, both parameters are needed due to the fact that you could create a service account in one project, and give it access to a different one. If you did this, the credentials of the service account would have the origin project, however, you could access the second project with the same file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM