Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GCloudex.Auth do

# Compute Engine scopes
@compute_read_only "https://www.googleapis.com/auth/compute.readonly"
@compute "https://www.googleapis.com/auth/compute"
@compute "https://www.googleapis.com/auth/compute"

@doc """
Retrieves an authentication token for the Google Cloud Storage service.
Expand Down Expand Up @@ -49,7 +49,7 @@ defmodule GCloudex.Auth do
get_token_response |> Map.get(:token)

:sql_admin ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @sql_scope_admin

get_token_response |> Map.get(:token)
Expand All @@ -66,16 +66,16 @@ defmodule GCloudex.Auth do
get_token_response |> Map.get(:token)

:compute_read_only ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @compute_read_only

get_token_response |> Map.get(:token)

:compute ->
{:ok, get_token_response} =
{:ok, get_token_response} =
GoogleAuth.for_scope @compute

get_token_response |> Map.get(:token)
end
end
end
end
3 changes: 1 addition & 2 deletions lib/cloud_speech/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ defmodule GCloudex.CloudSpeech.Request do
quote do

@endpoint "speech.googleapis.com"
@project GCloudex.get_project_id

@doc"""
Sends an HTTP request without any query parameters.
Expand All @@ -23,7 +22,7 @@ defmodule GCloudex.CloudSpeech.Request do
"https://" <> Path.join(@endpoint, path),
body,
headers ++ [{"Authorization", "Bearer #{Auth.get_token_storage(:cs)}"},
{"x-goog-project-id", @project}],
{"x-goog-project-id", GCloudex.get_project_id()}],
[timeout: 50_000, recv_timeout: 50_000]
)
end
Expand Down
Loading