mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Demonstrate providing keyfile data in lieu of a path [ci skip]
This commit is contained in:
parent
09d4cb4225
commit
dab7d401e8
1 changed files with 33 additions and 24 deletions
|
@ -141,18 +141,27 @@ Declare a Google Cloud Storage service in `config/storage.yml`:
|
|||
```yaml
|
||||
google:
|
||||
service: GCS
|
||||
keyfile: {
|
||||
type: "service_account",
|
||||
project_id: "",
|
||||
private_key_id: "",
|
||||
private_key: "",
|
||||
client_email: "",
|
||||
client_id: "",
|
||||
auth_uri: "https://accounts.google.com/o/oauth2/auth",
|
||||
token_uri: "https://accounts.google.com/o/oauth2/token",
|
||||
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
|
||||
credentials: <%= Rails.root.join("path/to/keyfile.json") %>
|
||||
project: ""
|
||||
bucket: ""
|
||||
```
|
||||
|
||||
Optionally provide a Hash of credentials instead of a keyfile path:
|
||||
|
||||
```yaml
|
||||
google:
|
||||
service: GCS
|
||||
credentials:
|
||||
type: "service_account"
|
||||
project_id: ""
|
||||
private_key_id: <%= Rails.application.credentials.dig(:gcs, :private_key_id) %>
|
||||
private_key: <%= Rails.application.credentials.dig(:gcs, :private_key) %>
|
||||
client_email: ""
|
||||
client_id: ""
|
||||
auth_uri: "https://accounts.google.com/o/oauth2/auth"
|
||||
token_uri: "https://accounts.google.com/o/oauth2/token"
|
||||
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs"
|
||||
client_x509_cert_url: ""
|
||||
}
|
||||
project: ""
|
||||
bucket: ""
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue