strongdm 14.17.0 → 14.20.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 +4 -4
- data/.git/ORIG_HEAD +1 -1
- data/.git/index +0 -0
- data/.git/logs/HEAD +3 -3
- data/.git/logs/refs/heads/master +2 -2
- data/.git/logs/refs/remotes/origin/HEAD +1 -1
- data/.git/objects/pack/{pack-24c4cf0c75507a393cb1fe13b2f8e821195f436b.idx → pack-cc987a4c6562550feeb172431370ca51f7a4a95f.idx} +0 -0
- data/.git/objects/pack/{pack-24c4cf0c75507a393cb1fe13b2f8e821195f436b.pack → pack-cc987a4c6562550feeb172431370ca51f7a4a95f.pack} +0 -0
- data/.git/packed-refs +3 -2
- data/.git/refs/heads/master +1 -1
- data/lib/grpc/drivers_pb.rb +2 -0
- data/lib/grpc/plumbing.rb +6 -0
- data/lib/grpc/queries_pb.rb +1 -0
- data/lib/models/porcelain.rb +13 -0
- data/lib/strongdm.rb +52 -28
- data/lib/svc.rb +386 -385
- data/lib/version +1 -1
- data/lib/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffc2f684354edc591bd80a6bc6b06e5c60ba616361b52bbe4841615aa7038049
|
4
|
+
data.tar.gz: 4734c850b046b1d0a673500f38f75199396b10314c576b1fe8015db6d5ff9e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b574d54bf9023fbeb95d65992ec43a3ec8e7af1a4643ac01125e71517fc521c67605f4c243a2559c28ea34bfda1a9c628df14e71bd8163477fe019663dbdbb4c
|
7
|
+
data.tar.gz: c6e75c6c48358596a8d78428ef5e1499db065d3400e7bceddd7be4141526ea0a916e8d5c0b545a26bae42c158f39ccaeea2ee3069269279b733c36dd31e002ef
|
data/.git/ORIG_HEAD
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
88d2b85cd4a760ba5f48260c9a1799a441f96369
|
data/.git/index
CHANGED
Binary file
|
data/.git/logs/HEAD
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
2
|
-
|
3
|
-
|
1
|
+
0000000000000000000000000000000000000000 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@a26af7fed765.(none)> 1748044166 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
|
2
|
+
88d2b85cd4a760ba5f48260c9a1799a441f96369 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@a26af7fed765.(none)> 1748044166 +0000 checkout: moving from master to master
|
3
|
+
88d2b85cd4a760ba5f48260c9a1799a441f96369 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@a26af7fed765.(none)> 1748044166 +0000 merge origin/development: Fast-forward
|
data/.git/logs/refs/heads/master
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
2
|
-
|
1
|
+
0000000000000000000000000000000000000000 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@a26af7fed765.(none)> 1748044166 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
|
2
|
+
88d2b85cd4a760ba5f48260c9a1799a441f96369 7d85e318ab1eda4e409329d726facc84bbaa57c2 root <root@a26af7fed765.(none)> 1748044166 +0000 merge origin/development: Fast-forward
|
@@ -1 +1 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
1
|
+
0000000000000000000000000000000000000000 88d2b85cd4a760ba5f48260c9a1799a441f96369 root <root@a26af7fed765.(none)> 1748044166 +0000 clone: from github.com:strongdm/strongdm-sdk-ruby.git
|
Binary file
|
Binary file
|
data/.git/packed-refs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# pack-refs with: peeled fully-peeled sorted
|
2
|
-
|
3
|
-
|
2
|
+
7d85e318ab1eda4e409329d726facc84bbaa57c2 refs/remotes/origin/development
|
3
|
+
88d2b85cd4a760ba5f48260c9a1799a441f96369 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,6 +86,7 @@ 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
|
90
91
|
435ad5faee6a7b0f94295b5d5fe9060611a81df3 refs/tags/v14.3.0
|
91
92
|
90b476259dcfed955ebd9339fbe2bbb0c2086b6d refs/tags/v14.4.0
|
data/.git/refs/heads/master
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
7d85e318ab1eda4e409329d726facc84bbaa57c2
|
data/lib/grpc/drivers_pb.rb
CHANGED
@@ -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
|
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)
|
data/lib/grpc/queries_pb.rb
CHANGED
@@ -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/models/porcelain.rb
CHANGED
@@ -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
|
-
|
29
|
-
|
30
|
-
|
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.
|
33
|
-
private_constant :
|
33
|
+
USER_AGENT = "strongdm-sdk-ruby/14.20.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:
|
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
|
-
@
|
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
|
157
|
-
|
158
|
-
|
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
|
-
|
162
|
-
|
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(
|
167
|
-
if
|
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
|
203
|
+
return false
|
176
204
|
end
|
177
|
-
|
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
|
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
|
-
|
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
|