<%- assert_locals service -%> <% @requires = capture do %> require "googleauth" <% end %> # Credentials for the <%= service.name %> API. class <%= service.credentials_name %> < Google::Auth::Credentials <%- if service.client_scopes.any? -%> self.scope = [ <%- service.client_scopes.each_with_index do |client_scope, index| -%> <%- comma = index == service.client_scopes.count - 1 ? "" : "," -%> <%= client_scope.inspect %><%= comma %> <%- end -%> ] <%- end -%> self.env_vars = [ "<%= service.gem.env_prefix %>_CREDENTIALS", "<%= service.gem.env_prefix %>_KEYFILE", "GOOGLE_CLOUD_CREDENTIALS", "GOOGLE_CLOUD_KEYFILE", "GCLOUD_KEYFILE", "<%= service.gem.env_prefix %>_CREDENTIALS_JSON", "<%= service.gem.env_prefix %>_KEYFILE_JSON", "GOOGLE_CLOUD_CREDENTIALS_JSON", "GOOGLE_CLOUD_KEYFILE_JSON", "GCLOUD_KEYFILE_JSON" ] self.paths = [ "~/.config/google_cloud/application_default_credentials.json" ] end