azure-storage-common 1.1.0 → 2.0.4

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.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  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/core.rb +47 -0
  21. data/lib/azure/http_response_helper.rb +38 -0
  22. data/lib/azure/storage/common/autoload.rb +62 -61
  23. data/lib/azure/storage/common/client.rb +162 -162
  24. data/lib/azure/storage/common/client_options.rb +363 -363
  25. data/lib/azure/storage/common/client_options_error.rb +41 -41
  26. data/lib/azure/storage/common/configurable.rb +212 -212
  27. data/lib/azure/storage/common/core/auth/anonymous_signer.rb +43 -43
  28. data/lib/azure/storage/common/core/auth/shared_access_signature.rb +30 -30
  29. data/lib/azure/storage/common/core/auth/shared_access_signature_generator.rb +399 -352
  30. data/lib/azure/storage/common/core/auth/shared_access_signature_signer.rb +57 -57
  31. data/lib/azure/storage/common/core/auth/shared_key.rb +60 -60
  32. data/lib/azure/storage/common/core/auth/token_signer.rb +43 -43
  33. data/lib/azure/storage/common/core/autoload.rb +53 -53
  34. data/lib/azure/storage/common/core/error.rb +43 -43
  35. data/lib/azure/storage/common/core/filter/exponential_retry_filter.rb +64 -64
  36. data/lib/azure/storage/common/core/filter/linear_retry_filter.rb +55 -55
  37. data/lib/azure/storage/common/core/filter/retry_filter.rb +300 -300
  38. data/lib/azure/storage/common/core/http_client.rb +82 -69
  39. data/lib/azure/storage/common/core/sr.rb +85 -85
  40. data/lib/azure/storage/common/core/token_credential.rb +64 -64
  41. data/lib/azure/storage/common/core/utility.rb +261 -255
  42. data/lib/azure/storage/common/core.rb +35 -35
  43. data/lib/azure/storage/common/default.rb +868 -868
  44. data/lib/azure/storage/common/service/access_policy.rb +37 -37
  45. data/lib/azure/storage/common/service/cors.rb +38 -38
  46. data/lib/azure/storage/common/service/cors_rule.rb +48 -48
  47. data/lib/azure/storage/common/service/enumeration_results.rb +32 -32
  48. data/lib/azure/storage/common/service/geo_replication.rb +40 -40
  49. data/lib/azure/storage/common/service/logging.rb +47 -47
  50. data/lib/azure/storage/common/service/metrics.rb +45 -45
  51. data/lib/azure/storage/common/service/retention_policy.rb +37 -37
  52. data/lib/azure/storage/common/service/serialization.rb +335 -335
  53. data/lib/azure/storage/common/service/signed_identifier.rb +40 -40
  54. data/lib/azure/storage/common/service/storage_service.rb +322 -322
  55. data/lib/azure/storage/common/service/storage_service_properties.rb +48 -48
  56. data/lib/azure/storage/common/service/storage_service_stats.rb +39 -39
  57. data/lib/azure/storage/common/service/user_delegation_key.rb +50 -0
  58. data/lib/azure/storage/common/version.rb +49 -49
  59. data/lib/azure/storage/common.rb +26 -26
  60. metadata +85 -17
@@ -1,69 +1,82 @@
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::Core
28
- module HttpClient
29
- # Returns the http agent based on uri
30
- # @param uri [URI|String] the base uri (scheme, host, port) of the http endpoint
31
- # @return [Net::HTTP] http agent for a given uri
32
- def agents(uri)
33
- key = uri.to_s
34
- @agents ||= {}
35
- unless @agents.key?(key)
36
- @agents[key] = build_http(uri)
37
- end
38
- @agents[key]
39
- end
40
-
41
- # Empties all the http agents
42
- def reset_agents!
43
- @agents = nil
44
- end
45
-
46
- private
47
-
48
- def build_http(uri)
49
- ssl_options = {}
50
- if uri.is_a?(URI) && uri.scheme.downcase == "https"
51
- ssl_options[:version] = self.ssl_version if self.ssl_version
52
- # min_version and max_version only supported in ruby 2.5
53
- ssl_options[:min_version] = self.ssl_min_version if self.ssl_min_version
54
- ssl_options[:max_version] = self.ssl_max_version if self.ssl_max_version
55
- ssl_options[:ca_file] = self.ca_file if self.ca_file
56
- ssl_options[:verify] = true
57
- end
58
- proxy_options = if ENV["HTTP_PROXY"]
59
- URI::parse(ENV["HTTP_PROXY"])
60
- elsif ENV["HTTPS_PROXY"]
61
- URI::parse(ENV["HTTPS_PROXY"])
62
- end || nil
63
- Faraday.new(uri, ssl: ssl_options, proxy: proxy_options) do |conn|
64
- conn.use FaradayMiddleware::FollowRedirects
65
- conn.adapter Faraday.default_adapter
66
- end
67
- end
68
- end
69
- 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
+
27
+ module Azure::Storage::Common::Core
28
+ module HttpClient
29
+ # Returns the http agent based on uri
30
+ # @param uri [URI|String] the base uri (scheme, host, port) of the http endpoint
31
+ # @return [Net::HTTP] http agent for a given uri
32
+ def agents(uri)
33
+ uri = URI(uri) unless uri.is_a? URI
34
+ key = uri.host
35
+
36
+ @agents ||= {}
37
+ unless @agents.key?(key)
38
+ @agents[key] = build_http(uri)
39
+ else
40
+ reuse_agent!(@agents[key])
41
+ end
42
+ @agents[key]
43
+ end
44
+
45
+ # Empties all the http agents
46
+ def reset_agents!
47
+ @agents = nil
48
+ end
49
+
50
+ private
51
+
52
+ # Empties all information that cannot be reused.
53
+ def reuse_agent!(agent)
54
+ agent.params.clear
55
+ agent.headers.clear
56
+ end
57
+
58
+ def build_http(uri)
59
+ ssl_options = {}
60
+ if uri.is_a?(URI) && uri.scheme.downcase == "https"
61
+ ssl_options[:version] = self.ssl_version if self.ssl_version
62
+ # min_version and max_version only supported in ruby 2.5
63
+ ssl_options[:min_version] = self.ssl_min_version if self.ssl_min_version
64
+ ssl_options[:max_version] = self.ssl_max_version if self.ssl_max_version
65
+ ssl_options[:ca_file] = self.ca_file if self.ca_file
66
+ ssl_options[:verify] = true
67
+ end
68
+ proxy_options = if ENV["HTTP_PROXY"]
69
+ URI::parse(ENV["HTTP_PROXY"])
70
+ elsif ENV["HTTPS_PROXY"]
71
+ URI::parse(ENV["HTTPS_PROXY"])
72
+ end || nil
73
+ Faraday.new(uri, ssl: ssl_options, proxy: proxy_options) do |conn|
74
+ conn.use FaradayMiddleware::FollowRedirects
75
+ conn.adapter :net_http_persistent, pool_size: 5 do |http|
76
+ # yields Net::HTTP::Persistent
77
+ http.idle_timeout = 100
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -1,85 +1,85 @@
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
-
28
- module Azure::Storage::Common::Core
29
- module SR
30
- ANONYMOUS_ACCESS_BLOBSERVICE_ONLY = "Anonymous access is only valid for the BlobService."
31
- ARGUMENT_NULL_OR_EMPTY = "The argument must not be null or an empty string. Argument name: %s."
32
- ARGUMENT_NULL_OR_UNDEFINED = "The argument must not be null or undefined. Argument name: %s."
33
- ARGUMENT_OUT_OF_RANGE_ERROR = "The argument is out of range. Argument name: %s, Value passed: %s."
34
- BATCH_ONE_PARTITION_KEY = "All entities in the batch must have the same PartitionKey value."
35
- BATCH_ONE_RETRIEVE = "If a retrieve operation is part of a batch, it must be the only operation in the batch."
36
- BATCH_TOO_LARGE = "Batches must not contain more than 100 operations."
37
- BLOB_INVALID_SEQUENCE_NUMBER = "The sequence number may not be specified for an increment operation."
38
- BLOB_TYPE_MISMATCH = 'Blob type of the blob reference doesn\'t match blob type of the blob.'
39
- CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY = "Cannot create Shared Access Signature unless the Account Name and Key are used to create the ServiceClient."
40
- CONTENT_LENGTH_MISMATCH = "An incorrect number of bytes was read from the connection. The connection may have been closed."
41
- CONTENT_TYPE_MISSING = "Content-Type response header is missing or invalid."
42
- EMPTY_BATCH = "Batch must not be empty."
43
- EXCEEDED_SIZE_LIMITATION = "Upload exceeds the size limitation. Max size is %s but the current size is %s"
44
- HASH_MISMATCH = "Hash mismatch (integrity check failed), Expected value is %s, retrieved %s."
45
- INCORRECT_ENTITY_KEYS = "PartitionKey and RowKey must be specified as strings in the entity object."
46
- INVALID_BLOB_LENGTH = "createBlockBlobFromText requires the size of text to be less than 64MB. Please use createBlockBlobFromLocalFile or createBlockBlobFromStream to upload large blobs."
47
- INVALID_CONNECTION_STRING = 'Connection strings must be of the form "key1=value1;key2=value2".'
48
- INVALID_CONNECTION_STRING_BAD_KEY = 'Connection string contains unrecognized key: "%s"'
49
- INVALID_CONNECTION_STRING_DUPLICATE_KEY = 'Connection string contains duplicate key: "%s"'
50
- INVALID_CONNECTION_STRING_EMPTY_KEY = "Connection strings must not contain empty keys."
51
- INVALID_CLIENT_OPTIONS = "Storage client options are invalid"
52
- INVALID_DELETE_SNAPSHOT_OPTION = "The deleteSnapshots option cannot be included when deleting a specific snapshot using the snapshotId option."
53
- INVALID_EDM_TYPE = 'The value \'%s\' does not match the type \'%s\'.'
54
- INVALID_FILE_LENGTH = "createFileFromText requires the size of text to be less than 4MB. Please use createFileFromLocalFile or createFileFromStream to upload large files."
55
- INVALID_FILE_RANGE_FOR_UPDATE = "Range size should be less than 4MB for a file range update operation."
56
- INVALID_HEADERS = "Headers are not supported in the 2012-02-12 version."
57
- INVALID_MESSAGE_ID = "Message ID cannot be null or undefined for deleteMessage and updateMessage operations."
58
- INVALID_PAGE_BLOB_LENGTH = "Page blob length must be multiple of 512."
59
- INVALID_PAGE_END_OFFSET = "Page end offset must be multiple of 512."
60
- INVALID_PAGE_RANGE_FOR_UPDATE = "Page range size should be less than 4MB for a page update operation."
61
- INVALID_PAGE_START_OFFSET = "Page start offset must be multiple of 512."
62
- INVALID_POP_RECEIPT = "Pop Receipt cannot be null or undefined for deleteMessage and updateMessage operations."
63
- INVALID_PROPERTY_RESOLVER = "The specified property resolver returned an invalid type. %s:{_:%s,$:%s }"
64
- INVALID_RANGE_FOR_MD5 = "The requested range should be less than 4MB when contentMD5 is expected from the server"
65
- INVALID_SAS_VERSION = "SAS Version ? is invalid. Valid versions include: ?."
66
- INVALID_SAS_TOKEN = "The SAS token should not contain api-version."
67
- INVALID_SIGNED_IDENTIFIERS = "Signed identifiers need to be an array."
68
- INVALID_STREAM_LENGTH = "The length of the provided stream is invalid."
69
- INVALID_STRING_ERROR = "Invalid string error."
70
- INVALID_TABLE_OPERATION = "Operation not found: %s"
71
- INVALID_TEXT_LENGTH = "The length of the provided text is invalid."
72
- MAXIMUM_EXECUTION_TIMEOUT_EXCEPTION = "The client could not finish the operation within specified maximum execution timeout."
73
- MD5_NOT_PRESENT_ERROR = "MD5 does not exist. If you do not want to force validation, please disable useTransactionalMD5."
74
- METADATA_KEY_INVALID = "The key for one of the metadata key-value pairs is null, empty, or whitespace."
75
- METADATA_VALUE_INVALID = "The value for one of the metadata key-value pairs is null, empty, or whitespace."
76
- NO_CREDENTIALS_PROVIDED = "Credentials must be provided when creating a service client."
77
- PRIMARY_ONLY_COMMAND = "This operation can only be executed against the primary storage location."
78
- QUERY_OPERATOR_REQUIRES_WHERE = "%s operator needs to be used after where."
79
- SECONDARY_ONLY_COMMAND = "This operation can only be executed against the secondary storage location."
80
- STORAGE_HOST_LOCATION_REQUIRED = "The host for the storage service must be specified."
81
- STORAGE_HOST_MISSING_LOCATION = 'The host for the target storage location is not specified. Please consider changing the request\'s location mode.'
82
- TYPE_NOT_SUPPORTED = "Type not supported when sending data to the service: "
83
- MAX_BLOB_SIZE_CONDITION_NOT_MEET = "The max blob size condition specified was not met."
84
- end
85
- 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
+
27
+
28
+ module Azure::Storage::Common::Core
29
+ module SR
30
+ ANONYMOUS_ACCESS_BLOBSERVICE_ONLY = "Anonymous access is only valid for the BlobService."
31
+ ARGUMENT_NULL_OR_EMPTY = "The argument must not be null or an empty string. Argument name: %s."
32
+ ARGUMENT_NULL_OR_UNDEFINED = "The argument must not be null or undefined. Argument name: %s."
33
+ ARGUMENT_OUT_OF_RANGE_ERROR = "The argument is out of range. Argument name: %s, Value passed: %s."
34
+ BATCH_ONE_PARTITION_KEY = "All entities in the batch must have the same PartitionKey value."
35
+ BATCH_ONE_RETRIEVE = "If a retrieve operation is part of a batch, it must be the only operation in the batch."
36
+ BATCH_TOO_LARGE = "Batches must not contain more than 100 operations."
37
+ BLOB_INVALID_SEQUENCE_NUMBER = "The sequence number may not be specified for an increment operation."
38
+ BLOB_TYPE_MISMATCH = 'Blob type of the blob reference doesn\'t match blob type of the blob.'
39
+ CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY = "Cannot create Shared Access Signature unless the Account Name and Key are used to create the ServiceClient."
40
+ CONTENT_LENGTH_MISMATCH = "An incorrect number of bytes was read from the connection. The connection may have been closed."
41
+ CONTENT_TYPE_MISSING = "Content-Type response header is missing or invalid."
42
+ EMPTY_BATCH = "Batch must not be empty."
43
+ EXCEEDED_SIZE_LIMITATION = "Upload exceeds the size limitation. Max size is %s but the current size is %s"
44
+ HASH_MISMATCH = "Hash mismatch (integrity check failed), Expected value is %s, retrieved %s."
45
+ INCORRECT_ENTITY_KEYS = "PartitionKey and RowKey must be specified as strings in the entity object."
46
+ INVALID_BLOB_LENGTH = "createBlockBlobFromText requires the size of text to be less than 64MB. Please use createBlockBlobFromLocalFile or createBlockBlobFromStream to upload large blobs."
47
+ INVALID_CONNECTION_STRING = 'Connection strings must be of the form "key1=value1;key2=value2".'
48
+ INVALID_CONNECTION_STRING_BAD_KEY = 'Connection string contains unrecognized key: "%s"'
49
+ INVALID_CONNECTION_STRING_DUPLICATE_KEY = 'Connection string contains duplicate key: "%s"'
50
+ INVALID_CONNECTION_STRING_EMPTY_KEY = "Connection strings must not contain empty keys."
51
+ INVALID_CLIENT_OPTIONS = "Storage client options are invalid"
52
+ INVALID_DELETE_SNAPSHOT_OPTION = "The deleteSnapshots option cannot be included when deleting a specific snapshot using the snapshotId option."
53
+ INVALID_EDM_TYPE = 'The value \'%s\' does not match the type \'%s\'.'
54
+ INVALID_FILE_LENGTH = "createFileFromText requires the size of text to be less than 4MB. Please use createFileFromLocalFile or createFileFromStream to upload large files."
55
+ INVALID_FILE_RANGE_FOR_UPDATE = "Range size should be less than 4MB for a file range update operation."
56
+ INVALID_HEADERS = "Headers are not supported in the 2012-02-12 version."
57
+ INVALID_MESSAGE_ID = "Message ID cannot be null or undefined for deleteMessage and updateMessage operations."
58
+ INVALID_PAGE_BLOB_LENGTH = "Page blob length must be multiple of 512."
59
+ INVALID_PAGE_END_OFFSET = "Page end offset must be multiple of 512."
60
+ INVALID_PAGE_RANGE_FOR_UPDATE = "Page range size should be less than 4MB for a page update operation."
61
+ INVALID_PAGE_START_OFFSET = "Page start offset must be multiple of 512."
62
+ INVALID_POP_RECEIPT = "Pop Receipt cannot be null or undefined for deleteMessage and updateMessage operations."
63
+ INVALID_PROPERTY_RESOLVER = "The specified property resolver returned an invalid type. %s:{_:%s,$:%s }"
64
+ INVALID_RANGE_FOR_MD5 = "The requested range should be less than 4MB when contentMD5 is expected from the server"
65
+ INVALID_SAS_VERSION = "SAS Version ? is invalid. Valid versions include: ?."
66
+ INVALID_SAS_TOKEN = "The SAS token should not contain api-version."
67
+ INVALID_SIGNED_IDENTIFIERS = "Signed identifiers need to be an array."
68
+ INVALID_STREAM_LENGTH = "The length of the provided stream is invalid."
69
+ INVALID_STRING_ERROR = "Invalid string error."
70
+ INVALID_TABLE_OPERATION = "Operation not found: %s"
71
+ INVALID_TEXT_LENGTH = "The length of the provided text is invalid."
72
+ MAXIMUM_EXECUTION_TIMEOUT_EXCEPTION = "The client could not finish the operation within specified maximum execution timeout."
73
+ MD5_NOT_PRESENT_ERROR = "MD5 does not exist. If you do not want to force validation, please disable useTransactionalMD5."
74
+ METADATA_KEY_INVALID = "The key for one of the metadata key-value pairs is null, empty, or whitespace."
75
+ METADATA_VALUE_INVALID = "The value for one of the metadata key-value pairs is null, empty, or whitespace."
76
+ NO_CREDENTIALS_PROVIDED = "Credentials must be provided when creating a service client."
77
+ PRIMARY_ONLY_COMMAND = "This operation can only be executed against the primary storage location."
78
+ QUERY_OPERATOR_REQUIRES_WHERE = "%s operator needs to be used after where."
79
+ SECONDARY_ONLY_COMMAND = "This operation can only be executed against the secondary storage location."
80
+ STORAGE_HOST_LOCATION_REQUIRED = "The host for the storage service must be specified."
81
+ STORAGE_HOST_MISSING_LOCATION = 'The host for the target storage location is not specified. Please consider changing the request\'s location mode.'
82
+ TYPE_NOT_SUPPORTED = "Type not supported when sending data to the service: "
83
+ MAX_BLOB_SIZE_CONDITION_NOT_MEET = "The max blob size condition specified was not met."
84
+ end
85
+ end
@@ -1,64 +1,64 @@
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
-
28
- module Azure::Storage::Common::Core
29
- class TokenCredential
30
-
31
- # Public: Initializes an instance of [Azure::Storage::Common::Core::TokenCredential]
32
- #
33
- # ==== Attributes
34
- #
35
- # * +token+ - String. The initial access token.
36
- #
37
- def initialize(token)
38
- @token = token
39
- @mutex = Mutex.new
40
- end
41
-
42
- # Public: Gets the access token
43
- #
44
- # Note: Providing this getter under the protect of a mutex
45
- #
46
- def token
47
- @mutex.synchronize do
48
- @token
49
- end
50
- end
51
-
52
- # Public: Renews the access token
53
- #
54
- # ==== Attributes
55
- #
56
- # * +new_token+ - String. The new access token.
57
- #
58
- def renew_token(new_token)
59
- @mutex.synchronize do
60
- @token = new_token
61
- end
62
- end
63
- end
64
- 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
+
28
+ module Azure::Storage::Common::Core
29
+ class TokenCredential
30
+
31
+ # Public: Initializes an instance of [Azure::Storage::Common::Core::TokenCredential]
32
+ #
33
+ # ==== Attributes
34
+ #
35
+ # * +token+ - String. The initial access token.
36
+ #
37
+ def initialize(token)
38
+ @token = token
39
+ @mutex = Mutex.new
40
+ end
41
+
42
+ # Public: Gets the access token
43
+ #
44
+ # Note: Providing this getter under the protect of a mutex
45
+ #
46
+ def token
47
+ @mutex.synchronize do
48
+ @token
49
+ end
50
+ end
51
+
52
+ # Public: Renews the access token
53
+ #
54
+ # ==== Attributes
55
+ #
56
+ # * +new_token+ - String. The new access token.
57
+ #
58
+ def renew_token(new_token)
59
+ @mutex.synchronize do
60
+ @token = new_token
61
+ end
62
+ end
63
+ end
64
+ end