instance method
iam_client
Ruby on Rails 8.1.2
Since v8.1.2Signature
iam_client()
Returns the IAM client used for direct uploads and signed URLs. By default, the authorization for the IAM client is set to Application Default Credentials, fetched once at instantiation time, then refreshed automatically when expired. This can be set to a different value to use other authorization methods.
ActiveStorage::Blob.service.iam_client.authorization = Google::Auth::ImpersonatedServiceAccountCredentials.new(options)
Source
# File activestorage/lib/active_storage/service/gcs_service.rb, line 154
def iam_client
@iam_client ||= Google::Apis::IamcredentialsV1::IAMCredentialsService.new.tap do |client|
client.authorization ||= Google::Auth.get_application_default(["https://www.googleapis.com/auth/iam"])
rescue
nil
end
end
Defined in activestorage/lib/active_storage/service/gcs_service.rb line 154
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Service::GCSService