strongdm 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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-a86846bb97666919e629e876c52e6b012d588625.idx → pack-ae9c31d15ecb69c51d515e053295673b38840788.idx} +0 -0
- data/.git/objects/pack/{pack-a86846bb97666919e629e876c52e6b012d588625.pack → pack-ae9c31d15ecb69c51d515e053295673b38840788.pack} +0 -0
- data/.git/packed-refs +3 -2
- data/.git/refs/heads/master +1 -1
- data/lib/strongdm.rb +15 -2
- 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: 1b6e8f6265ce3592ff88385cb196161bdd2f54169e3145c59136c7b8e96a726e
|
4
|
+
data.tar.gz: 7895128b0ddc5a7fa52cce02d398fb5566a5139c706745b49b337a766d13ab07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eef164f34da7ead4c9fd4586810029ddcb487e24d799bd5738b495cf8702108838b1d3cf07974ce0515636afc0bb4b888e6f50dbc13abac0c568dafce46fb162
|
7
|
+
data.tar.gz: 245a3d329f792fbda7cc98713d3ff2ba4c054fc8ad563c64f8c4e033211db8db43abb2696800da1ee65ad09a0fbefdf1f6a653c1a8d2045b9619435bfd0ff69b
|
data/.git/ORIG_HEAD
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c
|
data/.git/index
CHANGED
Binary file
|
data/.git/logs/HEAD
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
2
|
-
|
3
|
-
|
1
|
+
0000000000000000000000000000000000000000 62a146d9d56852b2ad14ec5d2796cad158d66e1c sdmrelease <support@strongdm.com> 1652276439 +0000 clone: from git@github.com:strongdm/strongdm-sdk-ruby.git
|
2
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c 62a146d9d56852b2ad14ec5d2796cad158d66e1c sdmrelease <support@strongdm.com> 1652276439 +0000 checkout: moving from master to master
|
3
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c 9de04e628082f4ad0eb9511311479a089d302008 sdmrelease <support@strongdm.com> 1652276439 +0000 merge origin/development: Fast-forward
|
data/.git/logs/refs/heads/master
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
2
|
-
|
1
|
+
0000000000000000000000000000000000000000 62a146d9d56852b2ad14ec5d2796cad158d66e1c sdmrelease <support@strongdm.com> 1652276439 +0000 clone: from git@github.com:strongdm/strongdm-sdk-ruby.git
|
2
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c 9de04e628082f4ad0eb9511311479a089d302008 sdmrelease <support@strongdm.com> 1652276439 +0000 merge origin/development: Fast-forward
|
@@ -1 +1 @@
|
|
1
|
-
0000000000000000000000000000000000000000
|
1
|
+
0000000000000000000000000000000000000000 62a146d9d56852b2ad14ec5d2796cad158d66e1c sdmrelease <support@strongdm.com> 1652276439 +0000 clone: from git@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
|
+
9de04e628082f4ad0eb9511311479a089d302008 refs/remotes/origin/development
|
3
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c 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
|
@@ -34,3 +34,4 @@ f05d3be5bc992d5a37ba13bc4ce092056769d9c8 refs/tags/v1.0.4
|
|
34
34
|
d035aa3acb4c3a0935121bc00bfbb0a9e999d410 refs/tags/v1.0.7
|
35
35
|
5b01475679f3312831a0fa1009e7cf90889effa8 refs/tags/v1.0.8
|
36
36
|
e0b1ec0134c7015ccb8c14464cc713c20034159e refs/tags/v2.0.0
|
37
|
+
62a146d9d56852b2ad14ec5d2796cad158d66e1c refs/tags/v2.1.0
|
data/.git/refs/heads/master
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
9de04e628082f4ad0eb9511311479a089d302008
|
data/lib/strongdm.rb
CHANGED
@@ -18,6 +18,7 @@
|
|
18
18
|
require_relative "./svc"
|
19
19
|
require "base64"
|
20
20
|
require "openssl"
|
21
|
+
require "time"
|
21
22
|
|
22
23
|
module SDM #:nodoc:
|
23
24
|
|
@@ -27,11 +28,11 @@ module SDM #:nodoc:
|
|
27
28
|
DEFAULT_BASE_RETRY_DELAY = 0.0030 # 30 ms
|
28
29
|
DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
|
29
30
|
API_VERSION = "2021-08-23"
|
30
|
-
USER_AGENT = "strongdm-sdk-ruby/2.
|
31
|
+
USER_AGENT = "strongdm-sdk-ruby/2.2.0"
|
31
32
|
private_constant :DEFAULT_MAX_RETRIES, :DEFAULT_BASE_RETRY_DELAY, :DEFAULT_MAX_RETRY_DELAY, :API_VERSION, :USER_AGENT
|
32
33
|
|
33
34
|
# Creates a new strongDM API client.
|
34
|
-
def initialize(api_access_key, api_secret_key, host: "api.strongdm.com:443", insecure: false)
|
35
|
+
def initialize(api_access_key, api_secret_key, host: "api.strongdm.com:443", insecure: false, retry_rate_limit_errors: true)
|
35
36
|
raise TypeError, "client access key must be a string" unless api_access_key.kind_of?(String)
|
36
37
|
raise TypeError, "client secret key must be a string" unless api_secret_key.kind_of?(String)
|
37
38
|
raise TypeError, "client host must be a string" unless host.kind_of?(String)
|
@@ -40,6 +41,7 @@ module SDM #:nodoc:
|
|
40
41
|
@max_retries = DEFAULT_MAX_RETRIES
|
41
42
|
@base_retry_delay = DEFAULT_BASE_RETRY_DELAY
|
42
43
|
@max_retry_delay = DEFAULT_MAX_RETRY_DELAY
|
44
|
+
@expose_rate_limit_errors = (not retry_rate_limit_errors)
|
43
45
|
@account_attachments = AccountAttachments.new(host, insecure, self)
|
44
46
|
@account_grants = AccountGrants.new(host, insecure, self)
|
45
47
|
@accounts = Accounts.new(host, insecure, self)
|
@@ -94,6 +96,17 @@ module SDM #:nodoc:
|
|
94
96
|
if not err.is_a? GRPC::BadStatus
|
95
97
|
return true
|
96
98
|
end
|
99
|
+
porcelainErr = Plumbing::convert_error_to_porcelain(err)
|
100
|
+
if (not @expose_rate_limit_errors) and (porcelainErr.is_a? RateLimitError)
|
101
|
+
sleep_for = porcelainErr.rate_limit.reset_at - Time.now
|
102
|
+
# If timezones or clock drift causes this calculation to fail,
|
103
|
+
# wait at most one minute.
|
104
|
+
if sleep_for < 0 or sleep_for > 60
|
105
|
+
sleep_for = 60
|
106
|
+
end
|
107
|
+
sleep(sleep_for)
|
108
|
+
return true
|
109
|
+
end
|
97
110
|
return err.code() == 13
|
98
111
|
end
|
99
112
|
|
data/lib/version
CHANGED
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongdm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- strongDM Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -79,8 +79,8 @@ files:
|
|
79
79
|
- "./.git/logs/HEAD"
|
80
80
|
- "./.git/logs/refs/heads/master"
|
81
81
|
- "./.git/logs/refs/remotes/origin/HEAD"
|
82
|
-
- "./.git/objects/pack/pack-
|
83
|
-
- "./.git/objects/pack/pack-
|
82
|
+
- "./.git/objects/pack/pack-ae9c31d15ecb69c51d515e053295673b38840788.idx"
|
83
|
+
- "./.git/objects/pack/pack-ae9c31d15ecb69c51d515e053295673b38840788.pack"
|
84
84
|
- "./.git/packed-refs"
|
85
85
|
- "./.git/refs/heads/master"
|
86
86
|
- "./.git/refs/remotes/origin/HEAD"
|