简体   繁体   中英

How to restrict access to only service account users in google cloud storage permissions

我正在尝试使用django-storages为带有服务帐户json文件的Google云存储桶授予权限。但是只有当我授予具有Objects View Permissions的allUsers访问权限时,才可以访问存储桶中的项目。如何限制对存储桶的公共访问。

You can take a look to this link that contains a useful guide about the process required to connect Django to GCS by using Service account JSON files; in this way, you can implement this authentication method to access to your buckets instead of making your data public . Adittionally, please keep in mind it is required to assign the Cloud Storage IAM Roles to the service account, by using the IAM console or by creating ACLs , in order to grant the access permissions.

Finally, once you have your Service account key file ready, you can authenticate your application by setting the GOOGLE_APPLICATION_CREDENTIALS environment variable with the path of the json file or passing the path directly into your code, as explained in the GCS official documentation .

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