azure-storage-common 1.1.0 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/azure/core/auth/authorizer.rb +36 -0
- data/lib/azure/core/auth/shared_key.rb +125 -0
- data/lib/azure/core/auth/shared_key_lite.rb +48 -0
- data/lib/azure/core/auth/signer.rb +51 -0
- data/lib/azure/core/default.rb +23 -0
- data/lib/azure/core/error.rb +21 -0
- data/lib/azure/core/filtered_service.rb +45 -0
- data/lib/azure/core/http/debug_filter.rb +36 -0
- data/lib/azure/core/http/http_error.rb +135 -0
- data/lib/azure/core/http/http_filter.rb +53 -0
- data/lib/azure/core/http/http_request.rb +195 -0
- data/lib/azure/core/http/http_response.rb +102 -0
- data/lib/azure/core/http/retry_policy.rb +84 -0
- data/lib/azure/core/http/signer_filter.rb +33 -0
- data/lib/azure/core/service.rb +46 -0
- data/lib/azure/core/signed_service.rb +45 -0
- data/lib/azure/core/utility.rb +244 -0
- data/lib/azure/core/version.rb +33 -0
- data/lib/azure/core.rb +47 -0
- data/lib/azure/http_response_helper.rb +38 -0
- data/lib/azure/storage/common/autoload.rb +62 -61
- data/lib/azure/storage/common/client.rb +162 -162
- data/lib/azure/storage/common/client_options.rb +363 -363
- data/lib/azure/storage/common/client_options_error.rb +41 -41
- data/lib/azure/storage/common/configurable.rb +212 -212
- data/lib/azure/storage/common/core/auth/anonymous_signer.rb +43 -43
- data/lib/azure/storage/common/core/auth/shared_access_signature.rb +30 -30
- data/lib/azure/storage/common/core/auth/shared_access_signature_generator.rb +399 -352
- data/lib/azure/storage/common/core/auth/shared_access_signature_signer.rb +57 -57
- data/lib/azure/storage/common/core/auth/shared_key.rb +60 -60
- data/lib/azure/storage/common/core/auth/token_signer.rb +43 -43
- data/lib/azure/storage/common/core/autoload.rb +53 -53
- data/lib/azure/storage/common/core/error.rb +43 -43
- data/lib/azure/storage/common/core/filter/exponential_retry_filter.rb +64 -64
- data/lib/azure/storage/common/core/filter/linear_retry_filter.rb +55 -55
- data/lib/azure/storage/common/core/filter/retry_filter.rb +300 -300
- data/lib/azure/storage/common/core/http_client.rb +82 -69
- data/lib/azure/storage/common/core/sr.rb +85 -85
- data/lib/azure/storage/common/core/token_credential.rb +64 -64
- data/lib/azure/storage/common/core/utility.rb +261 -255
- data/lib/azure/storage/common/core.rb +35 -35
- data/lib/azure/storage/common/default.rb +868 -868
- data/lib/azure/storage/common/service/access_policy.rb +37 -37
- data/lib/azure/storage/common/service/cors.rb +38 -38
- data/lib/azure/storage/common/service/cors_rule.rb +48 -48
- data/lib/azure/storage/common/service/enumeration_results.rb +32 -32
- data/lib/azure/storage/common/service/geo_replication.rb +40 -40
- data/lib/azure/storage/common/service/logging.rb +47 -47
- data/lib/azure/storage/common/service/metrics.rb +45 -45
- data/lib/azure/storage/common/service/retention_policy.rb +37 -37
- data/lib/azure/storage/common/service/serialization.rb +335 -335
- data/lib/azure/storage/common/service/signed_identifier.rb +40 -40
- data/lib/azure/storage/common/service/storage_service.rb +322 -322
- data/lib/azure/storage/common/service/storage_service_properties.rb +48 -48
- data/lib/azure/storage/common/service/storage_service_stats.rb +39 -39
- data/lib/azure/storage/common/service/user_delegation_key.rb +50 -0
- data/lib/azure/storage/common/version.rb +49 -49
- data/lib/azure/storage/common.rb +26 -26
- metadata +85 -17
@@ -1,55 +1,55 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------
|
4
|
-
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
5
|
-
#
|
6
|
-
# The MIT License(MIT)
|
7
|
-
|
8
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
-
# of this software and associated documentation files(the "Software"), to deal
|
10
|
-
# in the Software without restriction, including without limitation the rights
|
11
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
12
|
-
# copies of the Software, and to permit persons to whom the Software is
|
13
|
-
# furnished to do so, subject to the following conditions :
|
14
|
-
|
15
|
-
# The above copyright notice and this permission notice shall be included in
|
16
|
-
# all copies or substantial portions of the Software.
|
17
|
-
|
18
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
21
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
-
# THE SOFTWARE.
|
25
|
-
#--------------------------------------------------------------------------
|
26
|
-
require "azure/core"
|
27
|
-
require "azure/core/http/retry_policy"
|
28
|
-
|
29
|
-
module Azure::Storage::Common::Core::Filter
|
30
|
-
class LinearRetryPolicyFilter < RetryPolicyFilter
|
31
|
-
def initialize(retry_count = nil, retry_interval = nil)
|
32
|
-
@retry_count = retry_count || LinearRetryPolicyFilter::DEFAULT_RETRY_COUNT
|
33
|
-
@retry_interval = retry_interval || LinearRetryPolicyFilter::DEFAULT_RETRY_INTERVAL
|
34
|
-
|
35
|
-
super @retry_count, @retry_interval
|
36
|
-
end
|
37
|
-
|
38
|
-
DEFAULT_RETRY_COUNT = 3
|
39
|
-
DEFAULT_RETRY_INTERVAL = 30
|
40
|
-
|
41
|
-
# Overrides the base class implementation of call to determine
|
42
|
-
# how the HTTP request should continue retrying
|
43
|
-
#
|
44
|
-
# retry_data - Hash. Stores stateful retry data
|
45
|
-
#
|
46
|
-
# The retry_data is a Hash which can be used to store
|
47
|
-
# stateful data about the request execution context (such as an
|
48
|
-
# incrementing counter, timestamp, etc). The retry_data object
|
49
|
-
# will be the same instance throughout the lifetime of the request
|
50
|
-
def apply_retry_policy(retry_data)
|
51
|
-
retry_data[:count] = retry_data[:count] == nil ? 1 : retry_data[:count] + 1
|
52
|
-
retry_data[:interval] = @retry_interval
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#-------------------------------------------------------------------------
|
4
|
+
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
5
|
+
#
|
6
|
+
# The MIT License(MIT)
|
7
|
+
|
8
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
# of this software and associated documentation files(the "Software"), to deal
|
10
|
+
# in the Software without restriction, including without limitation the rights
|
11
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
12
|
+
# copies of the Software, and to permit persons to whom the Software is
|
13
|
+
# furnished to do so, subject to the following conditions :
|
14
|
+
|
15
|
+
# The above copyright notice and this permission notice shall be included in
|
16
|
+
# all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
21
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
# THE SOFTWARE.
|
25
|
+
#--------------------------------------------------------------------------
|
26
|
+
require "azure/core"
|
27
|
+
require "azure/core/http/retry_policy"
|
28
|
+
|
29
|
+
module Azure::Storage::Common::Core::Filter
|
30
|
+
class LinearRetryPolicyFilter < RetryPolicyFilter
|
31
|
+
def initialize(retry_count = nil, retry_interval = nil)
|
32
|
+
@retry_count = retry_count || LinearRetryPolicyFilter::DEFAULT_RETRY_COUNT
|
33
|
+
@retry_interval = retry_interval || LinearRetryPolicyFilter::DEFAULT_RETRY_INTERVAL
|
34
|
+
|
35
|
+
super @retry_count, @retry_interval
|
36
|
+
end
|
37
|
+
|
38
|
+
DEFAULT_RETRY_COUNT = 3
|
39
|
+
DEFAULT_RETRY_INTERVAL = 30
|
40
|
+
|
41
|
+
# Overrides the base class implementation of call to determine
|
42
|
+
# how the HTTP request should continue retrying
|
43
|
+
#
|
44
|
+
# retry_data - Hash. Stores stateful retry data
|
45
|
+
#
|
46
|
+
# The retry_data is a Hash which can be used to store
|
47
|
+
# stateful data about the request execution context (such as an
|
48
|
+
# incrementing counter, timestamp, etc). The retry_data object
|
49
|
+
# will be the same instance throughout the lifetime of the request
|
50
|
+
def apply_retry_policy(retry_data)
|
51
|
+
retry_data[:count] = retry_data[:count] == nil ? 1 : retry_data[:count] + 1
|
52
|
+
retry_data[:interval] = @retry_interval
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|