azure-storage-common2 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/azure/core/auth/authorizer.rb +36 -0
  3. data/lib/azure/core/auth/shared_key.rb +125 -0
  4. data/lib/azure/core/auth/shared_key_lite.rb +48 -0
  5. data/lib/azure/core/auth/signer.rb +51 -0
  6. data/lib/azure/core/default.rb +23 -0
  7. data/lib/azure/core/error.rb +21 -0
  8. data/lib/azure/core/filtered_service.rb +45 -0
  9. data/lib/azure/core/http/debug_filter.rb +36 -0
  10. data/lib/azure/core/http/http_error.rb +135 -0
  11. data/lib/azure/core/http/http_filter.rb +53 -0
  12. data/lib/azure/core/http/http_request.rb +195 -0
  13. data/lib/azure/core/http/http_response.rb +102 -0
  14. data/lib/azure/core/http/retry_policy.rb +84 -0
  15. data/lib/azure/core/http/signer_filter.rb +33 -0
  16. data/lib/azure/core/service.rb +46 -0
  17. data/lib/azure/core/signed_service.rb +45 -0
  18. data/lib/azure/core/utility.rb +244 -0
  19. data/lib/azure/core/version.rb +33 -0
  20. data/lib/azure/storage/common/autoload.rb +62 -0
  21. data/lib/azure/storage/common/client.rb +162 -0
  22. data/lib/azure/storage/common/client_options.rb +363 -0
  23. data/lib/azure/storage/common/client_options_error.rb +41 -0
  24. data/lib/azure/storage/common/configurable.rb +212 -0
  25. data/lib/azure/storage/common/core/auth/anonymous_signer.rb +43 -0
  26. data/lib/azure/storage/common/core/auth/shared_access_signature.rb +30 -0
  27. data/lib/azure/storage/common/core/auth/shared_access_signature_generator.rb +399 -0
  28. data/lib/azure/storage/common/core/auth/shared_access_signature_signer.rb +57 -0
  29. data/lib/azure/storage/common/core/auth/shared_key.rb +60 -0
  30. data/lib/azure/storage/common/core/auth/token_signer.rb +43 -0
  31. data/lib/azure/storage/common/core/autoload.rb +53 -0
  32. data/lib/azure/storage/common/core/error.rb +43 -0
  33. data/lib/azure/storage/common/core/filter/exponential_retry_filter.rb +64 -0
  34. data/lib/azure/storage/common/core/filter/linear_retry_filter.rb +55 -0
  35. data/lib/azure/storage/common/core/filter/retry_filter.rb +300 -0
  36. data/lib/azure/storage/common/core/http_client.rb +82 -0
  37. data/lib/azure/storage/common/core/sr.rb +85 -0
  38. data/lib/azure/storage/common/core/token_credential.rb +64 -0
  39. data/lib/azure/storage/common/core/utility.rb +261 -0
  40. data/lib/azure/storage/common/core.rb +35 -0
  41. data/lib/azure/storage/common/default.rb +868 -0
  42. data/lib/azure/storage/common/service/access_policy.rb +37 -0
  43. data/lib/azure/storage/common/service/cors.rb +38 -0
  44. data/lib/azure/storage/common/service/cors_rule.rb +48 -0
  45. data/lib/azure/storage/common/service/enumeration_results.rb +32 -0
  46. data/lib/azure/storage/common/service/geo_replication.rb +40 -0
  47. data/lib/azure/storage/common/service/logging.rb +47 -0
  48. data/lib/azure/storage/common/service/metrics.rb +45 -0
  49. data/lib/azure/storage/common/service/retention_policy.rb +37 -0
  50. data/lib/azure/storage/common/service/serialization.rb +335 -0
  51. data/lib/azure/storage/common/service/signed_identifier.rb +40 -0
  52. data/lib/azure/storage/common/service/storage_service.rb +322 -0
  53. data/lib/azure/storage/common/service/storage_service_properties.rb +48 -0
  54. data/lib/azure/storage/common/service/storage_service_stats.rb +39 -0
  55. data/lib/azure/storage/common/service/user_delegation_key.rb +50 -0
  56. data/lib/azure/storage/common/version.rb +49 -0
  57. metadata +57 -2
@@ -0,0 +1,40 @@
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/storage/common/service/access_policy"
27
+
28
+ module Azure::Storage::Common
29
+ module Service
30
+ class SignedIdentifier
31
+ def initialize
32
+ @access_policy = AccessPolicy.new
33
+ yield self if block_given?
34
+ end
35
+
36
+ attr_accessor :id
37
+ attr_accessor :access_policy
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,322 @@
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
+
27
+ require "azure/core/signed_service"
28
+ require "azure/storage/common/core"
29
+ require "azure/storage/common/service/storage_service_properties"
30
+ require "azure/storage/common/service/storage_service_stats"
31
+
32
+ module Azure::Storage::Common
33
+ module Service
34
+ # A base class for StorageService implementations
35
+ class StorageService < Azure::Core::SignedService
36
+ # @!attribute storage_service_host
37
+ # @return [Hash] Get or set the storage service host
38
+ attr_accessor :storage_service_host
39
+
40
+ # Create a new instance of the StorageService
41
+ #
42
+ # @param signer [Azure::Core::Auth::Signer] An implementation of Signer used for signing requests.
43
+ # (optional, Default=Azure::Storage::CommonAuth::SharedKey.new)
44
+ # @param account_name [String] The account name (optional, Default=Azure::Storage.storage_account_name)
45
+ # @param options [Azure::Storage::CommonConfigurable] the client configuration context
46
+ def initialize(signer = nil, account_name = nil, options = {}, &block)
47
+ StorageService.register_request_callback(&block) if block_given?
48
+ client_config = options[:client]
49
+ signer = signer || Azure::Storage::Common::Core::Auth::SharedKey.new(
50
+ client_config.storage_account_name,
51
+ client_config.storage_access_key) if client_config.storage_access_key
52
+ signer = signer || Azure::Storage::Common::Core::Auth::SharedAccessSignatureSigner.new(
53
+ client_config.storage_account_name,
54
+ client_config.storage_sas_token)
55
+ @storage_service_host = { primary: "", secondary: "" };
56
+ super(signer, account_name, options)
57
+ end
58
+
59
+ def call(method, uri, body = nil, headers = {}, options = {})
60
+ super(method, uri, body, StorageService.common_headers(options, body).merge(headers), options)
61
+ end
62
+
63
+ # Public: Get Storage Service properties
64
+ #
65
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452239
66
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452243
67
+ #
68
+ # ==== Options
69
+ #
70
+ # * +:timeout+ - Integer. A timeout in seconds.
71
+ # * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
72
+ # in the analytics logs when storage analytics logging is enabled.
73
+ #
74
+ # Returns a Hash with the service properties or nil if the operation failed
75
+ def get_service_properties(options = {})
76
+ query = {}
77
+ StorageService.with_query query, "timeout", options[:timeout].to_s if options[:timeout]
78
+
79
+ response = call(:get, service_properties_uri(query), nil, {}, options)
80
+ Serialization.service_properties_from_xml response.body
81
+ end
82
+
83
+ # Public: Set Storage Service properties
84
+ #
85
+ # service_properties - An instance of Azure::Storage::CommonService::StorageServiceProperties
86
+ #
87
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452235
88
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452232
89
+ #
90
+ # ==== Options
91
+ #
92
+ # * +:timeout+ - Integer. A timeout in seconds.
93
+ # * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
94
+ # in the analytics logs when storage analytics logging is enabled.
95
+ #
96
+ # Returns boolean indicating success.
97
+ def set_service_properties(service_properties, options = {})
98
+ query = {}
99
+ StorageService.with_query query, "timeout", options[:timeout].to_s if options[:timeout]
100
+
101
+ body = Serialization.service_properties_to_xml service_properties
102
+ call(:put, service_properties_uri(query), body, {}, options)
103
+ nil
104
+ end
105
+
106
+ # Public: Retrieves statistics related to replication for the service.
107
+ # It is only available on the secondary location endpoint when read-access geo-redundant
108
+ # replication is enabled for the storage account.
109
+ #
110
+ # See https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats
111
+ # See https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-service-stats
112
+ # See https://docs.microsoft.com/en-us/rest/api/storageservices/get-table-service-stats
113
+ #
114
+ # ==== Options
115
+ #
116
+ # * +:timeout+ - Integer. A timeout in seconds.
117
+ # * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
118
+ # in the analytics logs when storage analytics logging is enabled.
119
+ #
120
+ # Returns a Hash with the service statistics or nil if the operation failed
121
+ def get_service_stats(options = {})
122
+ query = {}
123
+ StorageService.with_query query, "timeout", options[:timeout].to_s if options[:timeout]
124
+
125
+ options.update(
126
+ location_mode: LocationMode::SECONDARY_ONLY,
127
+ request_location_mode: RequestLocationMode::SECONDARY_ONLY)
128
+ response = call(:get, service_stats_uri(query, options), nil, {}, options)
129
+ Serialization.service_stats_from_xml response.body
130
+ end
131
+
132
+ # Public: Generate the URI for the service properties
133
+ #
134
+ # * +:query+ - see Azure::Storage::CommonServices::GetServiceProperties#call documentation.
135
+ #
136
+ # Returns a URI.
137
+ def service_properties_uri(query = {})
138
+ query.update(restype: "service", comp: "properties")
139
+ generate_uri("", query)
140
+ end
141
+
142
+ # Public: Generate the URI for the service statistics
143
+ #
144
+ # * +:query+ - see Azure::Storage::CommonServices::GetServiceStats#call documentation.
145
+ #
146
+ # Returns a URI.
147
+ def service_stats_uri(query = {}, options = {})
148
+ query.update(restype: "service", comp: "stats")
149
+ generate_uri("", query, options)
150
+ end
151
+
152
+ # Overrides the base class implementation to determine the request uri
153
+ #
154
+ # path - String. the request path
155
+ # query - Hash. the query parameters
156
+ #
157
+ # ==== Options
158
+ #
159
+ # * +:encode+ - bool. Specifies whether to encode the path.
160
+ # * +:location_mode+ - LocationMode. Specifies the location mode used to decide
161
+ # which location the request should be sent to.
162
+ # * +:request_location_mode+ - RequestLocationMode. Specifies the location used to indicate
163
+ # which location the operation (REST API) can be performed against.
164
+ # This is determined by the API and cannot be specified by the users.
165
+ #
166
+ # Returns the uri hash
167
+ def generate_uri(path = "", query = {}, options = {})
168
+ location_mode =
169
+ if options[:location_mode].nil?
170
+ LocationMode::PRIMARY_ONLY
171
+ else
172
+ options[:location_mode]
173
+ end
174
+
175
+ request_location_mode =
176
+ if options[:request_location_mode].nil?
177
+ RequestLocationMode::PRIMARY_ONLY
178
+ else
179
+ request_location_mode = options[:request_location_mode]
180
+ end
181
+
182
+ location = StorageService.get_location location_mode, request_location_mode
183
+
184
+ if self.client.is_a?(Azure::Storage::Common::Client) && self.client.options[:use_path_style_uri]
185
+ account_path = get_account_path location
186
+ path = path.length > 0 ? account_path + "/" + path : account_path
187
+ end
188
+
189
+ @host = location == StorageLocation::PRIMARY ? @storage_service_host[:primary] : @storage_service_host[:secondary]
190
+
191
+ encode = options[:encode].nil? ? false : options[:encode]
192
+ if encode
193
+ path = CGI.escape(path.encode("UTF-8"))
194
+
195
+ # decode the forward slashes to match what the server expects.
196
+ path = path.gsub(/%2F/, "/")
197
+ # decode the backward slashes to match what the server expects.
198
+ path = path.gsub(/%5C/, "/")
199
+ # Re-encode the spaces (encoded as space) to the % encoding.
200
+ path = path.gsub(/\+/, "%20")
201
+ end
202
+
203
+ @host = storage_service_host[:primary]
204
+ options[:primary_uri] = super path, query
205
+
206
+ @host = storage_service_host[:secondary]
207
+ options[:secondary_uri] = super path, query
208
+
209
+ if location == StorageLocation::PRIMARY
210
+ @host = @storage_service_host[:primary]
211
+ return options[:primary_uri]
212
+ else
213
+ @host = @storage_service_host[:secondary]
214
+ return options[:secondary_uri]
215
+ end
216
+ end
217
+
218
+ # Get account path according to the location settings.
219
+ #
220
+ # * +:location+ - StorageLocation. Specifies the request location.
221
+ #
222
+ # Returns the account path
223
+ def get_account_path(location)
224
+ if location == StorageLocation::PRIMARY
225
+ self.client.options[:storage_account_name]
226
+ else
227
+ self.client.options[:storage_account_name] + "-secondary"
228
+ end
229
+ end
230
+
231
+ class << self
232
+ # @!attribute user_agent_prefix
233
+ # @return [Proc] Get or set the user agent prefix
234
+ attr_accessor :user_agent_prefix
235
+
236
+ # @!attribute request_callback
237
+ # @return [Proc] The callback before the request is signed and sent
238
+ attr_reader :request_callback
239
+
240
+ # Registers the callback when sending the request
241
+ # The headers in the request can be viewed or changed in the code block
242
+ def register_request_callback(&block)
243
+ @request_callback = block
244
+ end
245
+
246
+ # Get the request location.
247
+ #
248
+ # * +:location_mode+ - LocationMode. Specifies the location mode used to decide
249
+ # which location the request should be sent to.
250
+ # * +:request_location_mode+ - RequestLocationMode. Specifies the location used to indicate
251
+ # which location the operation (REST API) can be performed against.
252
+ # This is determined by the API and cannot be specified by the users.
253
+ #
254
+ # Returns the reqeust location
255
+ def get_location(location_mode, request_location_mode)
256
+ if request_location_mode == RequestLocationMode::PRIMARY_ONLY && location_mode == LocationMode::SECONDARY_ONLY
257
+ raise InvalidOptionsError, "This operation can only be executed against the primary storage location."
258
+ end
259
+
260
+ if request_location_mode == RequestLocationMode::SECONDARY_ONLY && location_mode == LocationMode::PRIMARY_ONLY
261
+ raise InvalidOptionsError, "This operation can only be executed against the secondary storage location."
262
+ end
263
+
264
+ if request_location_mode == RequestLocationMode::PRIMARY_ONLY
265
+ return StorageLocation::PRIMARY
266
+ elsif request_location_mode == RequestLocationMode::SECONDARY_ONLY
267
+ return StorageLocation::SECONDARY
268
+ end
269
+
270
+ if location_mode == LocationMode::PRIMARY_ONLY || location_mode == LocationMode::PRIMARY_THEN_SECONDARY
271
+ StorageLocation::PRIMARY
272
+ elsif location_mode == LocationMode::SECONDARY_ONLY || location_mode == LocationMode::SECONDARY_THEN_PRIMARY
273
+ StorageLocation::SECONDARY
274
+ end
275
+ end
276
+
277
+ # Adds metadata properties to header hash with required prefix
278
+ #
279
+ # * +:metadata+ - A Hash of metadata name/value pairs
280
+ # * +:headers+ - A Hash of HTTP headers
281
+ def add_metadata_to_headers(metadata, headers)
282
+ if metadata
283
+ metadata.each do |key, value|
284
+ headers["x-ms-meta-#{key}"] = value
285
+ end
286
+ end
287
+ end
288
+
289
+ # Adds a value to the Hash object
290
+ #
291
+ # * +:object+ - A Hash object
292
+ # * +:key+ - The key name
293
+ # * +:value+ - The value
294
+ def with_value(object, key, value)
295
+ object[key] = value.to_s if value
296
+ end
297
+
298
+ # Adds a header with the value
299
+ #
300
+ # * +:headers+ - A Hash of HTTP headers
301
+ # * +:name+ - The header name
302
+ # * +:value+ - The value
303
+ alias with_header with_value
304
+
305
+ # Adds a query parameter
306
+ #
307
+ # * +:query+ - A Hash of HTTP query
308
+ # * +:name+ - The parameter name
309
+ # * +:value+ - The value
310
+ alias with_query with_value
311
+
312
+ # Declares a default hash object for request headers
313
+ def common_headers(options = {}, body = nil)
314
+ headers = {}
315
+ headers.merge!("x-ms-client-request-id" => options[:request_id]) if options[:request_id]
316
+ @request_callback.call(headers) if @request_callback
317
+ headers
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
@@ -0,0 +1,48 @@
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/storage/common/service/logging"
27
+ require "azure/storage/common/service/metrics"
28
+ require "azure/storage/common/service/cors"
29
+
30
+ module Azure::Storage::Common
31
+ module Service
32
+ class StorageServiceProperties
33
+ def initialize
34
+ @logging = Logging.new
35
+ @hour_metrics = Metrics.new
36
+ @minute_metrics = Metrics.new
37
+ @cors = Cors.new
38
+ yield self if block_given?
39
+ end
40
+
41
+ attr_accessor :logging
42
+ attr_accessor :hour_metrics
43
+ attr_accessor :minute_metrics
44
+ attr_accessor :cors
45
+ attr_accessor :default_service_version
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,39 @@
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/storage/common/service/geo_replication"
27
+
28
+ module Azure::Storage::Common
29
+ module Service
30
+ class StorageServiceStats
31
+ def initialize
32
+ @geo_replication = GeoReplication.new
33
+ yield self if block_given?
34
+ end
35
+
36
+ attr_accessor :geo_replication
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,50 @@
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
+
27
+ module Azure::Storage::Common
28
+ module Service
29
+ class UserDelegationKey
30
+ def initialize
31
+ @signed_oid = nil
32
+ @signed_tid = nil
33
+ @signed_start = nil
34
+ @signed_expiry = nil
35
+ @signed_service = nil
36
+ @signed_version = nil
37
+ @value = nil
38
+ yield self if block_given?
39
+ end
40
+
41
+ attr_accessor :signed_oid
42
+ attr_accessor :signed_tid
43
+ attr_accessor :signed_start
44
+ attr_accessor :signed_expiry
45
+ attr_accessor :signed_service
46
+ attr_accessor :signed_version
47
+ attr_accessor :value
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,49 @@
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
+
27
+ module Azure
28
+ module Storage
29
+ module Common
30
+ class Version
31
+ # Fields represent the parts defined in http://semver.org/
32
+ MAJOR = 2 unless defined? MAJOR
33
+ MINOR = 0 unless defined? MINOR
34
+ UPDATE = 9 unless defined? UPDATE
35
+
36
+ class << self
37
+ # @return [String]
38
+ def to_s
39
+ [MAJOR, MINOR, UPDATE].compact.join(".")
40
+ end
41
+
42
+ def to_uas
43
+ [MAJOR, MINOR, UPDATE].join(".")
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-storage-common2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
@@ -213,6 +213,61 @@ files:
213
213
  - "./lib/azure/core.rb"
214
214
  - "./lib/azure/http_response_helper.rb"
215
215
  - "./lib/azure/storage/common.rb"
216
+ - lib/azure/core/auth/authorizer.rb
217
+ - lib/azure/core/auth/shared_key.rb
218
+ - lib/azure/core/auth/shared_key_lite.rb
219
+ - lib/azure/core/auth/signer.rb
220
+ - lib/azure/core/default.rb
221
+ - lib/azure/core/error.rb
222
+ - lib/azure/core/filtered_service.rb
223
+ - lib/azure/core/http/debug_filter.rb
224
+ - lib/azure/core/http/http_error.rb
225
+ - lib/azure/core/http/http_filter.rb
226
+ - lib/azure/core/http/http_request.rb
227
+ - lib/azure/core/http/http_response.rb
228
+ - lib/azure/core/http/retry_policy.rb
229
+ - lib/azure/core/http/signer_filter.rb
230
+ - lib/azure/core/service.rb
231
+ - lib/azure/core/signed_service.rb
232
+ - lib/azure/core/utility.rb
233
+ - lib/azure/core/version.rb
234
+ - lib/azure/storage/common/autoload.rb
235
+ - lib/azure/storage/common/client.rb
236
+ - lib/azure/storage/common/client_options.rb
237
+ - lib/azure/storage/common/client_options_error.rb
238
+ - lib/azure/storage/common/configurable.rb
239
+ - lib/azure/storage/common/core.rb
240
+ - lib/azure/storage/common/core/auth/anonymous_signer.rb
241
+ - lib/azure/storage/common/core/auth/shared_access_signature.rb
242
+ - lib/azure/storage/common/core/auth/shared_access_signature_generator.rb
243
+ - lib/azure/storage/common/core/auth/shared_access_signature_signer.rb
244
+ - lib/azure/storage/common/core/auth/shared_key.rb
245
+ - lib/azure/storage/common/core/auth/token_signer.rb
246
+ - lib/azure/storage/common/core/autoload.rb
247
+ - lib/azure/storage/common/core/error.rb
248
+ - lib/azure/storage/common/core/filter/exponential_retry_filter.rb
249
+ - lib/azure/storage/common/core/filter/linear_retry_filter.rb
250
+ - lib/azure/storage/common/core/filter/retry_filter.rb
251
+ - lib/azure/storage/common/core/http_client.rb
252
+ - lib/azure/storage/common/core/sr.rb
253
+ - lib/azure/storage/common/core/token_credential.rb
254
+ - lib/azure/storage/common/core/utility.rb
255
+ - lib/azure/storage/common/default.rb
256
+ - lib/azure/storage/common/service/access_policy.rb
257
+ - lib/azure/storage/common/service/cors.rb
258
+ - lib/azure/storage/common/service/cors_rule.rb
259
+ - lib/azure/storage/common/service/enumeration_results.rb
260
+ - lib/azure/storage/common/service/geo_replication.rb
261
+ - lib/azure/storage/common/service/logging.rb
262
+ - lib/azure/storage/common/service/metrics.rb
263
+ - lib/azure/storage/common/service/retention_policy.rb
264
+ - lib/azure/storage/common/service/serialization.rb
265
+ - lib/azure/storage/common/service/signed_identifier.rb
266
+ - lib/azure/storage/common/service/storage_service.rb
267
+ - lib/azure/storage/common/service/storage_service_properties.rb
268
+ - lib/azure/storage/common/service/storage_service_stats.rb
269
+ - lib/azure/storage/common/service/user_delegation_key.rb
270
+ - lib/azure/storage/common/version.rb
216
271
  homepage: http://github.com/azure/azure-storage-ruby
217
272
  licenses:
218
273
  - MIT
@@ -232,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
287
  - !ruby/object:Gem::Version
233
288
  version: '0'
234
289
  requirements: []
235
- rubygems_version: 3.1.4
290
+ rubygems_version: 3.3.7
236
291
  signing_key:
237
292
  specification_version: 4
238
293
  summary: Official Ruby client library to consume Azure Storage Common service