Skip to content

Commit

Permalink
fix: Don't use self-signed JWT credentials if the global configuratio…
Browse files Browse the repository at this point in the history
…n endpoint has been modified
  • Loading branch information
gcf-owl-bot[bot] authored Jun 6, 2023
1 parent 9130510 commit 1297f12
Show file tree
Hide file tree
Showing 162 changed files with 930 additions and 728 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.0", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -11432,7 +11432,9 @@ def delete_event_create_rule request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "analyticsadmin.googleapis.com", ::String
DEFAULT_ENDPOINT = "analyticsadmin.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -8604,7 +8604,9 @@ def delete_event_create_rule request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "analyticsadmin.googleapis.com", ::String
DEFAULT_ENDPOINT = "analyticsadmin.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed.any? { |klass| klass === value }
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"client_library": {
"name": "google-analytics-admin-v1alpha",
"version": "0.20.0",
"version": "0.19.0",
"language": "RUBY",
"apis": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.0", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -1088,7 +1088,9 @@ def check_compatibility request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "analyticsdata.googleapis.com", ::String
DEFAULT_ENDPOINT = "analyticsdata.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -909,7 +909,9 @@ def check_compatibility request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "analyticsdata.googleapis.com", ::String
DEFAULT_ENDPOINT = "analyticsdata.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed.any? { |klass| klass === value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run_report request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_run_report_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -97,7 +97,7 @@ def run_pivot_report request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_run_pivot_report_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -135,7 +135,7 @@ def batch_run_reports request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_reports_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -173,7 +173,7 @@ def batch_run_pivot_reports request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_pivot_reports_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -211,7 +211,7 @@ def get_metadata request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_get_metadata_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -249,7 +249,7 @@ def run_realtime_report request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_run_realtime_report_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -287,7 +287,7 @@ def check_compatibility request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_check_compatibility_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.0", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -1359,7 +1359,9 @@ def batch_delete_rows request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "area120tables.googleapis.com", ::String
DEFAULT_ENDPOINT = "area120tables.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def initialize
credentials = @config.credentials
# Use self-signed JWT if the endpoint is unchanged from default,
# but only if the default endpoint does not have a region prefix.
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
!@config.endpoint.split(".").first.include?("-")
credentials ||= Credentials.default scope: @config.scope,
enable_self_signed_jwt: enable_self_signed_jwt
Expand Down Expand Up @@ -1069,7 +1069,9 @@ def batch_delete_rows request, options = nil
class Configuration
extend ::Gapic::Config

config_attr :endpoint, "area120tables.googleapis.com", ::String
DEFAULT_ENDPOINT = "area120tables.googleapis.com"

config_attr :endpoint, DEFAULT_ENDPOINT, ::String
config_attr :credentials, nil do |value|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
allowed.any? { |klass| klass === value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_table request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_get_table_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -97,7 +97,7 @@ def list_tables request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_list_tables_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -135,7 +135,7 @@ def get_workspace request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_get_workspace_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -173,7 +173,7 @@ def list_workspaces request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_list_workspaces_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -211,7 +211,7 @@ def get_row request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_get_row_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -249,7 +249,7 @@ def list_rows request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_list_rows_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -287,7 +287,7 @@ def create_row request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_create_row_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -325,7 +325,7 @@ def batch_create_rows request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_rows_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -363,7 +363,7 @@ def update_row request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_update_row_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -401,7 +401,7 @@ def batch_update_rows request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_rows_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -439,7 +439,7 @@ def delete_row request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_delete_row_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down Expand Up @@ -477,7 +477,7 @@ def batch_delete_rows request_pb, options = nil

verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_rows_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split("=", 2) }
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.0", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Loading

0 comments on commit 1297f12

Please sign in to comment.