google-cloud-spanner 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bd07b2fc95f0e1d07f3e4e7ac3a0b87ad07a5d3037f612688c6c494ba0f6987
4
- data.tar.gz: 45684d1b7b3ae0d34a551a6469ff130225c238919048ec8e9243020762883520
3
+ metadata.gz: be9bac8912ff335f9d1bd4c18268b3796ad4bf521259559ccfd33bdc7aebd5b9
4
+ data.tar.gz: 5fe33da63dbe3ad1f733cc79c8a136a69f15ee013eda284a4d6c22e759728c33
5
5
  SHA512:
6
- metadata.gz: db4731a786c2af447d557b5f19196fcdd14d19bd98198cdc9ed729d0a15699dfe0b8f36c36f145f99b003be59eafa5887f2ec99193ea3669fba3634dd2b949d5
7
- data.tar.gz: 0201b3e7eda798bf0f587ec2f8158d374745e44c4904ad4dac7b4546130d4863e22d596fc756a28d8fe5f789ea9e5985bc9db8e1cc54346857f9e937125fa4d9
6
+ metadata.gz: 0c0939a408406551ade36f1bf01a43b2d9ced1a9556bfca9bb4642e348383da2ff3aa1e2285fa5acb1ed144dcdf6bf0e437419e9e07d1468bcc001203ed7c017
7
+ data.tar.gz: dc6d64fe998cd22ea0023516bb2429ea539c9e8230435800b4f19419b002a2313669880560a91297ff2a61c05b343b0de7f37aeaf15f6e093e8383813b153a63
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.15.0 (2022-09-07)
4
+
5
+ #### Features
6
+
7
+ * Support fine grained access control ([#19067](https://github.com/googleapis/google-cloud-ruby/issues/19067))
8
+
3
9
  ### 2.14.0 (2022-07-08)
4
10
 
5
11
  #### Features
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Apache License
2
2
  Version 2.0, January 2004
3
- https://www.apache.org/licenses/
3
+ http://www.apache.org/licenses/
4
4
 
5
5
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
6
 
@@ -192,7 +192,7 @@
192
192
  you may not use this file except in compliance with the License.
193
193
  You may obtain a copy of the License at
194
194
 
195
- https://www.apache.org/licenses/LICENSE-2.0
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
196
 
197
197
  Unless required by applicable law or agreed to in writing, software
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
@@ -52,10 +52,11 @@ module Google
52
52
  ##
53
53
  # @private Creates a new Spanner Client instance.
54
54
  def initialize project, instance_id, database_id, session_labels: nil,
55
- pool_opts: {}, query_options: nil
55
+ pool_opts: {}, query_options: nil, database_role: nil
56
56
  @project = project
57
57
  @instance_id = instance_id
58
58
  @database_id = database_id
59
+ @database_role = database_role
59
60
  @session_labels = session_labels
60
61
  @pool = Pool.new self, **pool_opts
61
62
  @query_options = query_options
@@ -97,6 +98,12 @@ module Google
97
98
  @project.database instance_id, database_id
98
99
  end
99
100
 
101
+ # The Spanner session creator role.
102
+ # @return [String]
103
+ def database_role
104
+ @database_role
105
+ end
106
+
100
107
  # A hash of values to specify the custom query options for executing
101
108
  # SQL query.
102
109
  # @return [Hash]
@@ -2115,7 +2122,8 @@ module Google
2115
2122
  Admin::Database::V1::DatabaseAdmin::Paths.database_path(
2116
2123
  project: project_id, instance: instance_id, database: database_id
2117
2124
  ),
2118
- labels: @session_labels
2125
+ labels: @session_labels,
2126
+ database_role: @database_role
2119
2127
  Session.from_grpc grpc, @project.service, query_options: @query_options
2120
2128
  end
2121
2129
 
@@ -2144,7 +2152,8 @@ module Google
2144
2152
  project: project_id, instance: instance_id, database: database_id
2145
2153
  ),
2146
2154
  session_count,
2147
- labels: @session_labels
2155
+ labels: @session_labels,
2156
+ database_role: @database_role
2148
2157
  resp.session.map { |grpc| Session.from_grpc grpc, @project.service, query_options: @query_options }
2149
2158
  end
2150
2159
 
@@ -277,8 +277,7 @@ module Google
277
277
  end
278
278
 
279
279
  def create_keepalive_task!
280
- @keepalive_task = Concurrent::TimerTask.new(execution_interval: 300,
281
- timeout_interval: 60) do
280
+ @keepalive_task = Concurrent::TimerTask.new execution_interval: 300 do
282
281
  keepalive_or_release!
283
282
  end
284
283
  @keepalive_task.execute
@@ -569,7 +569,7 @@ module Google
569
569
  # end
570
570
  #
571
571
  def client instance_id, database_id, pool: {}, labels: nil,
572
- query_options: nil
572
+ query_options: nil, database_role: nil
573
573
  # Convert from possible Google::Protobuf::Map
574
574
  labels = labels.to_h { |k, v| [String(k), String(v)] } if labels
575
575
  # Configs set by environment variables take over client-level configs.
@@ -581,7 +581,8 @@ module Google
581
581
  Client.new self, instance_id, database_id,
582
582
  session_labels: labels,
583
583
  pool_opts: valid_session_pool_options(pool),
584
- query_options: query_options
584
+ query_options: query_options,
585
+ database_role: database_role
585
586
  end
586
587
 
587
588
  ##
@@ -293,20 +293,20 @@ module Google
293
293
  end
294
294
 
295
295
  def create_session database_name, labels: nil,
296
- call_options: nil
296
+ call_options: nil, database_role: nil
297
297
  opts = default_options session_name: database_name,
298
298
  call_options: call_options
299
- session = V1::Session.new labels: labels if labels
299
+ session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role
300
300
  service.create_session(
301
301
  { database: database_name, session: session }, opts
302
302
  )
303
303
  end
304
304
 
305
305
  def batch_create_sessions database_name, session_count, labels: nil,
306
- call_options: nil
306
+ call_options: nil, database_role: nil
307
307
  opts = default_options session_name: database_name,
308
308
  call_options: call_options
309
- session = V1::Session.new labels: labels if labels
309
+ session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role
310
310
  # The response may have fewer sessions than requested in the RPC.
311
311
  request = {
312
312
  database: database_name,
@@ -604,7 +604,7 @@ module Google
604
604
  opts[:timeout] = call_options[:timeout] if call_options[:timeout]
605
605
  opts[:retry_policy] = call_options[:retry_policy] if call_options[:retry_policy]
606
606
  end
607
- return opts unless opts.empty?
607
+ ::Gapic::CallOptions.new(**opts)
608
608
  end
609
609
 
610
610
  def partition_options partition_size_bytes, max_partitions
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Spanner
19
- VERSION = "2.14.0".freeze
19
+ VERSION = "2.15.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-07-08 00:00:00.000000000 Z
12
+ date: 2022-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: gapic-common
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 0.11.0
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: 0.11.0
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: google-style
86
100
  requirement: !ruby/object:Gem::Requirement