Refactor Google::Auth#get_application_default
This commit is contained in:
parent
13bb435cf8
commit
377c679586
|
@ -87,9 +87,7 @@ END
|
||||||
# @param scope [string|array|nil] the scope(s) to access
|
# @param scope [string|array|nil] the scope(s) to access
|
||||||
# @param options [hash] allows override of the connection being used
|
# @param options [hash] allows override of the connection being used
|
||||||
def get_application_default(scope = nil, options = {})
|
def get_application_default(scope = nil, options = {})
|
||||||
creds = DefaultCredentials.from_env(scope)
|
creds = DefaultCredentials.from_env(scope) || DefaultCredentials.from_well_known_path(scope)
|
||||||
return creds unless creds.nil?
|
|
||||||
creds = DefaultCredentials.from_well_known_path(scope)
|
|
||||||
return creds unless creds.nil?
|
return creds unless creds.nil?
|
||||||
fail NOT_FOUND_ERROR unless GCECredentials.on_gce?(options)
|
fail NOT_FOUND_ERROR unless GCECredentials.on_gce?(options)
|
||||||
GCECredentials.new
|
GCECredentials.new
|
||||||
|
|
Loading…
Reference in New Issue