strongdm 14.17.0 → 14.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6b8f409390da4d50e0f847b07f2ecffbbe0fd2788a71733362a14840e133c32
4
- data.tar.gz: 7ff9d3f9d6ce6e28f1fad7b5441d56e9170caa90d8dbb874415915803ca5b8a4
3
+ metadata.gz: ea507220c049fe086cc82c8d999f7e464d769f97c15bd2919dfad6a63d5bb649
4
+ data.tar.gz: 29287e9e69edb850ae9b79f052ec0e9d6095d8ec8fe284f8aec6442a7b27d3e9
5
5
  SHA512:
6
- metadata.gz: ba02cf5434706265d5081948135f74cd4a82d02011f17e08ed9b996840d5592a57bacba957b9fafbbec6d75aa72f09ee05da1cd3d38e45f3e55247583c63e78d
7
- data.tar.gz: cd45b5d0b226155336d3404256066469f85cbcfe4a0f62e1a1b0f9f28be4c296b808eb74ca48d843889e12c4961c6fc234bf7055e60328cb22d4c2d80324e3d6
6
+ metadata.gz: c8c7ecac665241c23b0661eafef599666ce408124d07852546330df45ef0118b933388b1f85f5a26a0120fdf0e993cda98f5eb37ada4579ca1c08a1a0428ba86
7
+ data.tar.gz: c6f8eac3a2e3c555b85493f721f7b51f86e2f565aba13822b86d1b72fb9d8b672988926bb8d52569870bf92c3d18fefe3ec40bd1c9392bbf54a1a541273b2d99
data/.git/ORIG_HEAD CHANGED
@@ -1 +1 @@
1
- 208194810b58fc7e050508e7df5360b4f39d5b68
1
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2
data/.git/index CHANGED
Binary file
data/.git/logs/HEAD CHANGED
@@ -1,3 +1,3 @@
1
- 0000000000000000000000000000000000000000 208194810b58fc7e050508e7df5360b4f39d5b68 root <root@16b027a199a6.(none)> 1747852935 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
2
- 208194810b58fc7e050508e7df5360b4f39d5b68 208194810b58fc7e050508e7df5360b4f39d5b68 root <root@16b027a199a6.(none)> 1747852935 +0000 checkout: moving from master to master
3
- 208194810b58fc7e050508e7df5360b4f39d5b68 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@16b027a199a6.(none)> 1747852935 +0000 merge origin/development: Fast-forward
1
+ 0000000000000000000000000000000000000000 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@35109c21c590.(none)> 1748964323 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
2
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@35109c21c590.(none)> 1748964323 +0000 checkout: moving from master to master
3
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2 803744e1c91e13635a6f0539e001b4c763ec9b26 root <root@35109c21c590.(none)> 1748964323 +0000 merge origin/development: Fast-forward
@@ -1,2 +1,2 @@
1
- 0000000000000000000000000000000000000000 208194810b58fc7e050508e7df5360b4f39d5b68 root <root@16b027a199a6.(none)> 1747852935 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
2
- 208194810b58fc7e050508e7df5360b4f39d5b68 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@16b027a199a6.(none)> 1747852935 +0000 merge origin/development: Fast-forward
1
+ 0000000000000000000000000000000000000000 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@35109c21c590.(none)> 1748964323 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
2
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2 803744e1c91e13635a6f0539e001b4c763ec9b26 root <root@35109c21c590.(none)> 1748964323 +0000 merge origin/development: Fast-forward
@@ -1 +1 @@
1
- 0000000000000000000000000000000000000000 208194810b58fc7e050508e7df5360b4f39d5b68 root <root@16b027a199a6.(none)> 1747852935 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
1
+ 0000000000000000000000000000000000000000 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@35109c21c590.(none)> 1748964323 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
data/.git/packed-refs CHANGED
@@ -1,6 +1,6 @@
1
1
  # pack-refs with: peeled fully-peeled sorted
2
- 88d2b85cd4a760ba5f48260c9a1799a441f96369 refs/remotes/origin/development
3
- 208194810b58fc7e050508e7df5360b4f39d5b68 refs/remotes/origin/master
2
+ 803744e1c91e13635a6f0539e001b4c763ec9b26 refs/remotes/origin/development
3
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2 refs/remotes/origin/master
4
4
  2e4fe8087177ddea9b3991ca499f758384839c89 refs/tags/untagged-84fd83a4484c785cce63
5
5
  04f604866214fab4d5663b5171a3e596331577bd refs/tags/v0.9.4
6
6
  6f9a7b75b345c65fb554884907b7060680c807b7 refs/tags/v0.9.5
@@ -86,7 +86,9 @@ d92875bdf2278c475f52984d1165544d287e2255 refs/tags/v14.10.0
86
86
  39946f5be0cf4bd4a6f3432cbe1caa0889a9fcf2 refs/tags/v14.12.0
87
87
  6a06ac49ca3c4d8d829450631d5f809c0fd5f593 refs/tags/v14.13.0
88
88
  208194810b58fc7e050508e7df5360b4f39d5b68 refs/tags/v14.14.0
89
+ 88d2b85cd4a760ba5f48260c9a1799a441f96369 refs/tags/v14.17.0
89
90
  f9539f7781664eb4681b99f12cbcc5d613e241ab refs/tags/v14.2.0
91
+ 7d85e318ab1eda4e409329d726facc84bbaa57c2 refs/tags/v14.20.0
90
92
  435ad5faee6a7b0f94295b5d5fe9060611a81df3 refs/tags/v14.3.0
91
93
  90b476259dcfed955ebd9339fbe2bbb0c2086b6d refs/tags/v14.4.0
92
94
  f5e3068d4f6c73c93d409699726cc9fb3c5cf482 refs/tags/v14.5.0
@@ -1 +1 @@
1
- 88d2b85cd4a760ba5f48260c9a1799a441f96369
1
+ 803744e1c91e13635a6f0539e001b4c763ec9b26
@@ -1215,6 +1215,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
1215
1215
  optional :subdomain, :string, 32775
1216
1216
  optional :allow_resource_role_bypass, :bool, 15
1217
1217
  optional :certificate_authority, :string, 4
1218
+ optional :discovery_enabled, :bool, 13
1219
+ optional :discovery_username, :string, 14
1218
1220
  optional :healthcheck_namespace, :string, 6
1219
1221
  optional :identity_alias_healthcheck_username, :string, 8
1220
1222
  optional :identity_set_id, :string, 7
@@ -70,6 +70,27 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
70
70
  optional :enforce_single_session, :bool, 29
71
71
  optional :discard_replays, :bool, 30
72
72
  optional :public_key_pem, :string, 31
73
+ optional :log_config, :message, 32, "v1.LogConfig"
74
+ end
75
+ add_message "v1.LogConfig" do
76
+ optional :local_storage, :string, 1
77
+ optional :local_encoder, :string, 2
78
+ optional :local_format, :string, 3
79
+ optional :local_tcp_address, :string, 4
80
+ optional :local_socket_path, :string, 5
81
+ optional :public_key, :string, 6
82
+ optional :categories, :message, 7, "v1.LogCategoryConfigMap"
83
+ end
84
+ add_message "v1.LogCategoryConfigMap" do
85
+ repeated :entries, :message, 1, "v1.LogCategoryConfigMap.Entry"
86
+ end
87
+ add_message "v1.LogCategoryConfigMap.Entry" do
88
+ optional :name, :string, 1
89
+ optional :config, :message, 2, "v1.LogCategoryConfig"
90
+ end
91
+ add_message "v1.LogCategoryConfig" do
92
+ optional :remote_encoder, :string, 1
93
+ optional :remote_discard_replays, :bool, 2
73
94
  end
74
95
  end
75
96
  end
@@ -79,4 +100,8 @@ module V1
79
100
  OrganizationHistoryListResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.OrganizationHistoryListResponse").msgclass
80
101
  OrganizationHistoryRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.OrganizationHistoryRecord").msgclass
81
102
  Organization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.Organization").msgclass
103
+ LogConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.LogConfig").msgclass
104
+ LogCategoryConfigMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.LogCategoryConfigMap").msgclass
105
+ LogCategoryConfigMap::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.LogCategoryConfigMap.Entry").msgclass
106
+ LogCategoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.LogCategoryConfig").msgclass
82
107
  end
data/lib/grpc/plumbing.rb CHANGED
@@ -7693,6 +7693,8 @@ module SDM
7693
7693
  porcelain.allow_resource_role_bypass = (plumbing.allow_resource_role_bypass)
7694
7694
  porcelain.bind_interface = (plumbing.bind_interface)
7695
7695
  porcelain.certificate_authority = (plumbing.certificate_authority)
7696
+ porcelain.discovery_enabled = (plumbing.discovery_enabled)
7697
+ porcelain.discovery_username = (plumbing.discovery_username)
7696
7698
  porcelain.egress_filter = (plumbing.egress_filter)
7697
7699
  porcelain.healthcheck_namespace = (plumbing.healthcheck_namespace)
7698
7700
  porcelain.healthy = (plumbing.healthy)
@@ -7716,6 +7718,8 @@ module SDM
7716
7718
  plumbing.allow_resource_role_bypass = (porcelain.allow_resource_role_bypass)
7717
7719
  plumbing.bind_interface = (porcelain.bind_interface)
7718
7720
  plumbing.certificate_authority = (porcelain.certificate_authority)
7721
+ plumbing.discovery_enabled = (porcelain.discovery_enabled)
7722
+ plumbing.discovery_username = (porcelain.discovery_username)
7719
7723
  plumbing.egress_filter = (porcelain.egress_filter)
7720
7724
  plumbing.healthcheck_namespace = (porcelain.healthcheck_namespace)
7721
7725
  plumbing.healthy = (porcelain.healthy)
@@ -11369,6 +11373,7 @@ module SDM
11369
11373
  porcelain.encrypted = (plumbing.encrypted)
11370
11374
  porcelain.id = (plumbing.id)
11371
11375
  porcelain.identity_alias_username = (plumbing.identity_alias_username)
11376
+ porcelain.metadata_json = (plumbing.metadata_json)
11372
11377
  porcelain.query_body = (plumbing.query_body)
11373
11378
  porcelain.query_category = (plumbing.query_category)
11374
11379
  porcelain.query_hash = (plumbing.query_hash)
@@ -11405,6 +11410,7 @@ module SDM
11405
11410
  plumbing.encrypted = (porcelain.encrypted)
11406
11411
  plumbing.id = (porcelain.id)
11407
11412
  plumbing.identity_alias_username = (porcelain.identity_alias_username)
11413
+ plumbing.metadata_json = (porcelain.metadata_json)
11408
11414
  plumbing.query_body = (porcelain.query_body)
11409
11415
  plumbing.query_category = (porcelain.query_category)
11410
11416
  plumbing.query_hash = (porcelain.query_hash)
@@ -65,6 +65,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
65
65
  optional :authzJson, :string, 28
66
66
  optional :client_ip, :string, 29
67
67
  optional :identity_alias_username, :string, 30
68
+ optional :metadata_json, :string, 31
68
69
  end
69
70
  add_message "v1.QueryCapture" do
70
71
  optional :width, :int32, 1
data/lib/grpc/spec_pb.rb CHANGED
@@ -89,9 +89,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
89
89
  add_message "v1.FulfillmentsMetadata" do
90
90
  repeated :fulfillments, :message, 1, "v1.Fulfillment"
91
91
  end
92
+ add_message "v1.MFA" do
93
+ optional :provider, :string, 1
94
+ repeated :methods_enabled, :string, 2
95
+ end
92
96
  add_message "v1.Requirement" do
93
97
  optional :type, :string, 1
94
98
  optional :value, :string, 2
99
+ optional :MFA, :message, 3, "v1.MFA"
95
100
  end
96
101
  add_message "v1.Fulfillment" do
97
102
  optional :requirement, :message, 1, "v1.Requirement"
@@ -123,6 +128,7 @@ module V1
123
128
  GenericResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.GenericResponseMetadata").msgclass
124
129
  RequirementsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.RequirementsMetadata").msgclass
125
130
  FulfillmentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.FulfillmentsMetadata").msgclass
131
+ MFA = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.MFA").msgclass
126
132
  Requirement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.Requirement").msgclass
127
133
  Fulfillment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("v1.Fulfillment").msgclass
128
134
  end
@@ -7696,6 +7696,11 @@ module SDM
7696
7696
  attr_accessor :bind_interface
7697
7697
  # The CA to authenticate TLS connections with.
7698
7698
  attr_accessor :certificate_authority
7699
+ # If true, configures discovery of a cluster to be run from a node.
7700
+ attr_accessor :discovery_enabled
7701
+ # If a cluster is configured for user impersonation, this is the user to impersonate when
7702
+ # running discovery.
7703
+ attr_accessor :discovery_username
7699
7704
  # A filter applied to the routing logic to pin datasource to nodes.
7700
7705
  attr_accessor :egress_filter
7701
7706
  # The path used to check the health of your connection. Defaults to `default`.
@@ -7725,6 +7730,8 @@ module SDM
7725
7730
  allow_resource_role_bypass: nil,
7726
7731
  bind_interface: nil,
7727
7732
  certificate_authority: nil,
7733
+ discovery_enabled: nil,
7734
+ discovery_username: nil,
7728
7735
  egress_filter: nil,
7729
7736
  healthcheck_namespace: nil,
7730
7737
  healthy: nil,
@@ -7741,6 +7748,8 @@ module SDM
7741
7748
  @allow_resource_role_bypass = allow_resource_role_bypass == nil ? false : allow_resource_role_bypass
7742
7749
  @bind_interface = bind_interface == nil ? "" : bind_interface
7743
7750
  @certificate_authority = certificate_authority == nil ? "" : certificate_authority
7751
+ @discovery_enabled = discovery_enabled == nil ? false : discovery_enabled
7752
+ @discovery_username = discovery_username == nil ? "" : discovery_username
7744
7753
  @egress_filter = egress_filter == nil ? "" : egress_filter
7745
7754
  @healthcheck_namespace = healthcheck_namespace == nil ? "" : healthcheck_namespace
7746
7755
  @healthy = healthy == nil ? false : healthy
@@ -11149,6 +11158,8 @@ module SDM
11149
11158
  attr_accessor :id
11150
11159
  # The username of the IdentityAlias used to access the Resource.
11151
11160
  attr_accessor :identity_alias_username
11161
+ # Driver specific metadata associated with this query.
11162
+ attr_accessor :metadata_json
11152
11163
  # The captured content of the Query.
11153
11164
  # For queries against SSH, Kubernetes, and RDP resources, this contains a JSON representation of the QueryCapture.
11154
11165
  attr_accessor :query_body
@@ -11199,6 +11210,7 @@ module SDM
11199
11210
  encrypted: nil,
11200
11211
  id: nil,
11201
11212
  identity_alias_username: nil,
11213
+ metadata_json: nil,
11202
11214
  query_body: nil,
11203
11215
  query_category: nil,
11204
11216
  query_hash: nil,
@@ -11228,6 +11240,7 @@ module SDM
11228
11240
  @encrypted = encrypted == nil ? false : encrypted
11229
11241
  @id = id == nil ? "" : id
11230
11242
  @identity_alias_username = identity_alias_username == nil ? "" : identity_alias_username
11243
+ @metadata_json = metadata_json == nil ? "" : metadata_json
11231
11244
  @query_body = query_body == nil ? "" : query_body
11232
11245
  @query_category = query_category == nil ? "" : query_category
11233
11246
  @query_hash = query_hash == nil ? "" : query_hash
data/lib/strongdm.rb CHANGED
@@ -25,25 +25,27 @@ module SDM #:nodoc:
25
25
 
26
26
  # Client bundles all the services together and initializes them.
27
27
  class Client
28
- DEFAULT_MAX_RETRIES = 3
29
- DEFAULT_BASE_RETRY_DELAY = 0.0030 # 30 ms
30
- DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
28
+ DEFAULT_BASE_RETRY_DELAY = 1 # 1 second
29
+ DEFAULT_MAX_RETRY_DELAY = 120 # 120 seconds
30
+ DEFAULT_RETRY_FACTOR = 1.6
31
+ DEFAULT_RETRY_JITTER = 0.2
31
32
  API_VERSION = "2025-04-14"
32
- USER_AGENT = "strongdm-sdk-ruby/14.17.0"
33
- private_constant :DEFAULT_MAX_RETRIES, :DEFAULT_BASE_RETRY_DELAY, :DEFAULT_MAX_RETRY_DELAY, :API_VERSION, :USER_AGENT
33
+ USER_AGENT = "strongdm-sdk-ruby/14.21.0"
34
+ private_constant :DEFAULT_BASE_RETRY_DELAY, :DEFAULT_MAX_RETRY_DELAY, :DEFAULT_RETRY_FACTOR, :DEFAULT_RETRY_JITTER, :API_VERSION, :USER_AGENT
34
35
 
35
36
  # Creates a new strongDM API client.
36
- def initialize(api_access_key, api_secret_key, host: "app.strongdm.com:443", insecure: false, retry_rate_limit_errors: true, page_limit: 50)
37
+ def initialize(api_access_key, api_secret_key, host: "app.strongdm.com:443", insecure: false, retry_rate_limit_errors: true, page_limit: 0)
37
38
  raise TypeError, "client access key must be a string" unless api_access_key.kind_of?(String)
38
39
  raise TypeError, "client secret key must be a string" unless api_secret_key.kind_of?(String)
39
40
  raise TypeError, "client host must be a string" unless host.kind_of?(String)
40
41
  @api_access_key = api_access_key.strip
41
42
  @api_secret_key = Base64.strict_decode64(api_secret_key.strip)
42
- @max_retries = DEFAULT_MAX_RETRIES
43
43
  @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
44
44
  @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
45
+ @retry_factor = DEFAULT_RETRY_FACTOR
46
+ @retry_jitter = DEFAULT_RETRY_JITTER
45
47
  @page_limit = page_limit
46
- @expose_rate_limit_errors = (not retry_rate_limit_errors)
48
+ @retry_rate_limit_errors = retry_rate_limit_errors
47
49
  @snapshot_time = nil
48
50
  begin
49
51
  if insecure
@@ -153,18 +155,44 @@ module SDM #:nodoc:
153
155
  end
154
156
 
155
157
  # @private
156
- def jitterSleep(iter)
157
- dur_max = @base_retry_delay * 2 ** iter
158
- if (dur_max > @max_retry_delay)
159
- dur_max = @max_retry_delay
158
+ def exponentialBackoff(retries, deadline = nil)
159
+ if retries == 0
160
+ return applyDeadline(@base_retry_delay, deadline)
160
161
  end
161
- dur = rand() * dur_max
162
- sleep(dur)
162
+ backoff, max = @base_retry_delay, @max_retry_delay
163
+ while backoff < max and retries > 0
164
+ backoff *= @retry_factor
165
+ retries -= 1
166
+ end
167
+ if backoff > max
168
+ backoff = max
169
+ end
170
+ # Randomize backoff delays so that if a cluster of requests start at
171
+ # the same time, they won't operate in lockstep.
172
+ backoff *= 1 + @retry_jitter * (rand() * 2 - 1)
173
+ if backoff < 0
174
+ return 0
175
+ end
176
+
177
+ return applyDeadline(backoff, deadline)
178
+ end
179
+
180
+ # @private
181
+ def applyDeadline(backoff, deadline)
182
+ if deadline.nil?
183
+ return backoff
184
+ end
185
+ remaining = deadline - Time.now
186
+ if remaining < 0
187
+ return 0
188
+ end
189
+ return [backoff, remaining].min
163
190
  end
164
191
 
165
192
  # @private
166
- def shouldRetry(iter, err)
167
- if (iter >= @max_retries - 1)
193
+ def shouldRetry(retries, err, deadline = nil)
194
+ # Check if we've passed the deadline
195
+ if !deadline.nil? && Time.now >= deadline
168
196
  return false
169
197
  end
170
198
  # The grpc library unfortunately does not raise a more specific error class.
@@ -172,20 +200,12 @@ module SDM #:nodoc:
172
200
  return false
173
201
  end
174
202
  if not err.is_a? GRPC::BadStatus
175
- return true
203
+ return false
176
204
  end
177
- porcelainErr = Plumbing::convert_error_to_porcelain(err)
178
- if (not @expose_rate_limit_errors) and (porcelainErr.is_a? RateLimitError)
179
- sleep_for = porcelainErr.rate_limit.reset_at - Time.now
180
- # If timezones or clock drift causes this calculation to fail,
181
- # wait at most one minute.
182
- if sleep_for < 0 or sleep_for > 60
183
- sleep_for = 60
184
- end
185
- sleep(sleep_for)
205
+ if @retry_rate_limit_errors and err.code() == 8
186
206
  return true
187
207
  end
188
- return (err.code() == 13 or err.code() == 14)
208
+ return (retries <= 3) && ((err.code() == 13) || (err.code() == 14))
189
209
  end
190
210
 
191
211
  # Constructs a read-only client that will provide historical data from the provided timestamp.
@@ -196,7 +216,11 @@ module SDM #:nodoc:
196
216
  return SnapshotClient.new(client)
197
217
  end
198
218
 
199
- attr_reader :max_retries
219
+ # @deprecated
220
+ def max_retries
221
+ 3
222
+ end
223
+
200
224
  attr_reader :base_retry_delay
201
225
  attr_reader :max_retry_delay
202
226
  attr_accessor :page_limit