gitlab-fog-azure-rm 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +1 -1
  3. data/.rubocop.yml +3 -0
  4. data/CHANGELOG.md +4 -0
  5. data/Gemfile +0 -3
  6. data/gitlab-fog-azure-rm.gemspec +7 -1
  7. data/lib/fog/azurerm/version.rb +1 -1
  8. metadata +146 -93
  9. data/vendor/azure-storage-ruby/.env_sample +0 -8
  10. data/vendor/azure-storage-ruby/.gitignore +0 -35
  11. data/vendor/azure-storage-ruby/.rubocop.yml +0 -132
  12. data/vendor/azure-storage-ruby/.travis.yml +0 -23
  13. data/vendor/azure-storage-ruby/BreakingChanges.md +0 -34
  14. data/vendor/azure-storage-ruby/CONTRIBUTING.md +0 -74
  15. data/vendor/azure-storage-ruby/ChangeLog.md +0 -198
  16. data/vendor/azure-storage-ruby/Gemfile +0 -41
  17. data/vendor/azure-storage-ruby/README.md +0 -48
  18. data/vendor/azure-storage-ruby/Rakefile +0 -216
  19. data/vendor/azure-storage-ruby/SECURITY.md +0 -41
  20. data/vendor/azure-storage-ruby/blob/BreakingChanges.md +0 -10
  21. data/vendor/azure-storage-ruby/blob/ChangeLog.md +0 -33
  22. data/vendor/azure-storage-ruby/blob/Gemfile +0 -30
  23. data/vendor/azure-storage-ruby/blob/LICENSE.txt +0 -21
  24. data/vendor/azure-storage-ruby/blob/README.md +0 -188
  25. data/vendor/azure-storage-ruby/blob/azure-storage-blob.gemspec +0 -52
  26. data/vendor/azure-storage-ruby/common/BreakingChanges.md +0 -8
  27. data/vendor/azure-storage-ruby/common/ChangeLog.md +0 -41
  28. data/vendor/azure-storage-ruby/common/Gemfile +0 -30
  29. data/vendor/azure-storage-ruby/common/LICENSE.txt +0 -21
  30. data/vendor/azure-storage-ruby/common/README.md +0 -146
  31. data/vendor/azure-storage-ruby/common/azure-storage-common.gemspec +0 -57
  32. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/auth/authorizer.rb +0 -0
  33. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/auth/shared_key.rb +0 -0
  34. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/auth/shared_key_lite.rb +0 -0
  35. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/auth/signer.rb +0 -0
  36. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/default.rb +0 -0
  37. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/error.rb +0 -0
  38. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/filtered_service.rb +0 -0
  39. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/debug_filter.rb +0 -0
  40. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/http_error.rb +0 -0
  41. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/http_filter.rb +0 -0
  42. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/http_request.rb +0 -0
  43. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/http_response.rb +0 -0
  44. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/retry_policy.rb +0 -0
  45. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/http/signer_filter.rb +0 -0
  46. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/service.rb +0 -0
  47. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/signed_service.rb +0 -0
  48. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/utility.rb +0 -0
  49. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core/version.rb +0 -0
  50. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/core.rb +0 -0
  51. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/http_response_helper.rb +0 -0
  52. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/append.rb +0 -0
  53. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/autoload.rb +0 -0
  54. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/blob.rb +0 -0
  55. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/blob_service.rb +0 -0
  56. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/block.rb +0 -0
  57. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/container.rb +0 -0
  58. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/default.rb +0 -0
  59. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/page.rb +0 -0
  60. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/serialization.rb +0 -0
  61. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob/version.rb +0 -0
  62. /data/{vendor/azure-storage-ruby/blob/lib → lib}/azure/storage/blob.rb +0 -0
  63. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/autoload.rb +0 -0
  64. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/client.rb +0 -0
  65. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/client_options.rb +0 -0
  66. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/client_options_error.rb +0 -0
  67. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/configurable.rb +0 -0
  68. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/anonymous_signer.rb +0 -0
  69. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/shared_access_signature.rb +0 -0
  70. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/shared_access_signature_generator.rb +0 -0
  71. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/shared_access_signature_signer.rb +0 -0
  72. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/shared_key.rb +0 -0
  73. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/auth/token_signer.rb +0 -0
  74. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/autoload.rb +0 -0
  75. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/error.rb +0 -0
  76. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/filter/exponential_retry_filter.rb +0 -0
  77. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/filter/linear_retry_filter.rb +0 -0
  78. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/filter/retry_filter.rb +0 -0
  79. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/http_client.rb +0 -0
  80. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/sr.rb +0 -0
  81. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/token_credential.rb +0 -0
  82. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core/utility.rb +0 -0
  83. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/core.rb +0 -0
  84. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/default.rb +0 -0
  85. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/access_policy.rb +0 -0
  86. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/cors.rb +0 -0
  87. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/cors_rule.rb +0 -0
  88. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/enumeration_results.rb +0 -0
  89. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/geo_replication.rb +0 -0
  90. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/logging.rb +0 -0
  91. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/metrics.rb +0 -0
  92. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/retention_policy.rb +0 -0
  93. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/serialization.rb +0 -0
  94. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/signed_identifier.rb +0 -0
  95. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/storage_service.rb +0 -0
  96. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/storage_service_properties.rb +0 -0
  97. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/storage_service_stats.rb +0 -0
  98. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/service/user_delegation_key.rb +0 -0
  99. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common/version.rb +0 -0
  100. /data/{vendor/azure-storage-ruby/common/lib → lib}/azure/storage/common.rb +0 -0
@@ -1,188 +0,0 @@
1
- # Microsoft Azure Storage Blob Client Library for Ruby
2
-
3
- [![Gem Version](https://badge.fury.io/rb/azure-storage-blob.svg)](https://badge.fury.io/rb/azure-storage-blob)
4
- * Master: [![Master Build Status](https://travis-ci.org/Azure/azure-storage-ruby.svg?branch=master)](https://travis-ci.org/Azure/azure-storage-ruby/branches) [![Coverage Status](https://coveralls.io/repos/github/Azure/azure-storage-ruby/badge.svg?branch=master)](https://coveralls.io/github/Azure/azure-storage-ruby?branch=master)
5
- * Dev: [![Dev Build Status](https://travis-ci.org/Azure/azure-storage-ruby.svg?branch=dev)](https://travis-ci.org/Azure/azure-storage-ruby/branches) [![Coverage Status](https://coveralls.io/repos/github/Azure/azure-storage-ruby/badge.svg?branch=dev)](https://coveralls.io/github/Azure/azure-storage-ruby?branch=dev)
6
-
7
- This project provides a Ruby package that makes it easy to access and manage Microsoft Azure Storage Blob Services.
8
-
9
-
10
- # Supported Ruby Versions
11
-
12
- * Ruby 2.3 to 2.7
13
-
14
- Note:
15
-
16
- * x64 Ruby for Windows is known to have some compatibility issues.
17
- * azure-storage-blob depends on gem nokogiri.
18
-
19
- # Getting Started
20
-
21
- ## Install the rubygem package
22
-
23
- You can install the azure storage blob rubygem package directly.
24
-
25
- ```bash
26
- gem install azure-storage-blob
27
- ```
28
-
29
- ## Setup Connection
30
-
31
- You can use this Client Library against the Microsoft Azure Storage Blob Services in the cloud, or against the local Storage Emulator if you are on Windows.
32
-
33
- There are two ways you can set up the connections:
34
-
35
- 1. [via code](#via-code)
36
- 2. [via environment variables](#via-environment-variables)
37
-
38
- <a name="via-code"></a>
39
- ### Via Code
40
- * Against Microsoft Azure Services in the cloud
41
-
42
- ```ruby
43
-
44
- require 'azure/storage/blob'
45
-
46
- # Setup a specific instance of an Azure::Storage::Blob::BlobService
47
- blob_client = Azure::Storage::Blob::BlobService.create(storage_account_name: <your account name>, storage_access_key: <your access key>)
48
-
49
- # Or create a client and initialize with it.
50
- require 'azure/storage/common'
51
- common_client = Azure::Storage::Common::Client.create(storage_account_name: <your account name>, storage_access_key: <your access key>)
52
- blob_client = Azure::Storage::Blob::BlobService.new(client: common_client)
53
-
54
- # Configure a ca_cert.pem file if you are having issues with ssl peer verification
55
- blob_client.ca_file = './ca_file.pem'
56
-
57
- ```
58
-
59
- * Against local Emulator (Windows Only)
60
-
61
- ```ruby
62
-
63
- require 'azure/storage/blob'
64
- client = Azure::Storage::Blob::BlobService.create_development
65
-
66
- # Or create by options and provide your own proxy_uri
67
- client = Azure::Storage::Blob::BlobService.create(use_development_storage: true, development_storage_proxy_uri: <your proxy uri>)
68
-
69
- ```
70
-
71
- <a name="via-environment-variables"></a>
72
- ### Via Environment Variables
73
-
74
- * Against Microsoft Azure Storage Blob Services in the cloud
75
-
76
- ```bash
77
- export AZURE_STORAGE_ACCOUNT = <your azure storage account name>
78
- export AZURE_STORAGE_ACCESS_KEY = <your azure storage access key>
79
- ```
80
-
81
- * Against local Emulator (Windows Only)
82
-
83
- ```bash
84
- export EMULATED = true
85
- ```
86
-
87
- * [SSL Certificate File](https://gist.github.com/fnichol/867550) if having issues with ssl peer verification
88
-
89
- ```bash
90
- SSL_CERT_FILE=<path to *.pem>
91
- ```
92
-
93
- # Usage
94
-
95
- <a name="usage"></a>
96
- ## Usage
97
-
98
- ```ruby
99
-
100
- # Require the azure storage blob rubygem
101
- require 'azure/storage/blob'
102
-
103
- # Setup a specific instance of an Azure::Storage::Blob::BlobService
104
- client = Azure::Storage::Blob::BlobService.create(storage_account_name: <your account name>, storage_access_key: <your access key>)
105
-
106
- # Alternatively, create a client that can anonymously access public containers for read operations
107
- client = Azure::Storage::Blob::BlobService.create(storage_blob_host: "https://youraccountname.blob.core.windows.net")
108
-
109
- # Add retry filter to the service object
110
- require "azure/storage/common"
111
- client.with_filter(Azure::Storage::Common::Core::Filter::ExponentialRetryPolicyFilter.new)
112
-
113
- # Create a container
114
- container = client.create_container('test-container')
115
-
116
- # Upload a Blob
117
- content = ::File.open('test.jpg', 'rb') { |file| file.read }
118
- client.create_block_blob(container.name, 'image-blob', content)
119
-
120
- # List containers
121
- client.list_containers()
122
-
123
- # List Blobs
124
- client.list_blobs(container.name)
125
-
126
- # Download a Blob
127
- blob, content = client.get_blob(container.name, 'image-blob')
128
- ::File.open('download.png', 'wb') {|f| f.write(content)}
129
-
130
- # Delete a Blob
131
- client.delete_blob(container.name, 'image-blob')
132
-
133
- ```
134
-
135
- <a name="token"></a>
136
- ## Access Token
137
-
138
- Please refer to the below links for obtaining an access token:
139
- * [Authenticate with Azure Active Directory](https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-azure-active-directory)
140
- * [Getting a MSI access token](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-linux-vm-access-storage#get-an-access-token-and-use-it-to-call-azure-storage)
141
-
142
- ```ruby
143
- require "azure/storage/common"
144
-
145
- access_token = <your initial access token>
146
-
147
- # Creating an instance of `Azure::Storage::Common::Core::TokenCredential`
148
- token_credential = Azure::Storage::Common::Core::TokenCredential.new access_token
149
- token_signer = Azure::Storage::Common::Core::Auth::TokenSigner.new token_credential
150
- blob_token_client = Azure::Storage::Blob::BlobService.new(storage_account_name: <your_account_name>, signer: token_signer)
151
-
152
- # Refresh internal is 50 minutes
153
- refresh_interval = 50 * 60
154
- # The user-defined thread that renews the access token
155
- cancelled = false
156
- renew_token = Thread.new do
157
- Thread.stop
158
- while !cancelled
159
- sleep(refresh_interval)
160
-
161
- # Renew the access token here
162
-
163
- # Update the access token to the credential
164
- token_credential.renew_token <new_access_token>
165
- end
166
- end
167
- sleep 0.1 while renew_token.status != 'sleep'
168
- renew_token.run
169
-
170
- # Call blob client functions as usaual
171
-
172
- ```
173
-
174
- <a name="Customize the user-agent"></a>
175
- ## Customize the user-agent
176
-
177
- You can customize the user-agent string by setting your user agent prefix when creating the service client.
178
-
179
- ```ruby
180
- # Require the azure storage blob rubygem
181
- require "azure/storage/blob"
182
-
183
- # Setup a specific instance of an Azure::Storage::Client with :user_agent_prefix option
184
- client = Azure::Storage::Blob::BlobService.create(storage_account_name: <your account name>, storage_access_key: <your access key>, user_agent_prefix: <your application name>)
185
- ```
186
-
187
- # Code of Conduct
188
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@@ -1,52 +0,0 @@
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 "date"
27
-
28
- require_relative "./lib/azure/storage/blob/version"
29
-
30
- Gem::Specification.new do |s|
31
- s.name = "azure-storage-blob"
32
- s.version = Azure::Storage::Blob::Version
33
- s.authors = ["Microsoft Corporation"]
34
- s.email = "ascl@microsoft.com"
35
- s.description = "Microsoft Azure Storage Blob Client Library for Ruby"
36
- s.summary = "Official Ruby client library to consume Azure Storage Blob service"
37
- s.homepage = "http://github.com/azure/azure-storage-ruby"
38
- s.license = "MIT"
39
- s.files = `git ls-files ./lib/azure/storage/blob/`.split("\n") << "./lib/azure/storage/blob.rb"
40
-
41
- s.required_ruby_version = ">= 2.3.0"
42
-
43
- s.add_runtime_dependency("azure-storage-common", "~> 2.0")
44
- s.add_runtime_dependency("nokogiri", "~> 1", ">= 1.10.8")
45
- s.add_development_dependency("dotenv", "~> 2.0")
46
- s.add_development_dependency("minitest", "~> 5")
47
- s.add_development_dependency("minitest-reporters", "~> 1")
48
- s.add_development_dependency("mocha", "~> 1.0")
49
- s.add_development_dependency("rake", "~> 13.0")
50
- s.add_development_dependency("timecop", "~> 0.7")
51
- s.add_development_dependency("yard", "~> 0.9", ">= 0.9.11")
52
- end
@@ -1,8 +0,0 @@
1
- Tracking Breaking Changes in 2.0.0
2
-
3
- * This module now supports Ruby versions to 2.3 through 2.7
4
-
5
- Tracking Breaking Changes in 1.0.0
6
-
7
- * This module now consists of functionalities to support service client library modules.
8
- * All namespaces in this module now begin with "Azure::Storage::Common" instead of "Azure::Storage".
@@ -1,41 +0,0 @@
1
- 2021.12 - version 2.0.4
2
- * Lifted Ruby-version-based restrictions on Nokogiri version.
3
-
4
- 2021.10 - version 2.0.3
5
- * Allowed to use any version 1.x of Nokogiri for Ruby version later than or equal to 2.5.0.
6
- * Fixed handling of invalid connection strings
7
-
8
- 2020.8 - version 2.0.2
9
- * Bumped up Nokogiri version to 1.11.0.rc2 for Ruby version later than or equal to 2.4.0.
10
- * Changed to use persistent HTTP client to speed up requests #168.
11
- * Explicitly requiring `tempfile` to avoid runtime errors.
12
-
13
- 2020.3 - version 2.0.1
14
- * Resolved an issue where the rubygem 'azure-storage-common' cannot resolve 'faraday_middleware' version automatically.
15
- * Resolved an issue where automation does not report error for sanity check failure.
16
-
17
- 2020.3 - version 2.0.0
18
- * This module now supports Ruby versions to 2.3 through 2.7
19
- * Service version is upgraded to 2018-11-09.
20
- * Add support for generating user delegation shared access signatures.
21
- * This module now contains azure-core which was originally in azure-ruby-asm-core.
22
- * The following dependency version was bumped up to the specified version for security update:
23
- Nokogiri 1.10.4
24
- Faraday 1.0.0
25
- Rake 13.0
26
- * Now reuses the HTTP Client on host level.
27
-
28
- 2018.11 - version 1.1.0
29
- * Added the support for sending a request with a bearer token.
30
- * Added the configuration for SSL versions.
31
- * Fixed the issue that the retry interval could be negative. [#121]
32
- * Fixed the timeout issue when the resource doesn't exist. [#122]
33
-
34
- 2018.1 - version 1.0.1
35
- * Resolved an issue where user cannot use Gem package using `gem install`.
36
-
37
- 2018.1 - version 1.0.0
38
-
39
- * This module now consists of functionalities to support service client library modules.
40
- * All namespaces in this module now begin with "Azure::Storage::Common" instead of "Azure::Storage".
41
- * Resolved an issue where user tries to access `Azure::Storage::Common::Default::signer` would throw `undefined method 'signer' for Azure::Storage::Default:Module`.
@@ -1,30 +0,0 @@
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
- source "https://rubygems.org"
27
-
28
- gemspec name: "azure-storage-common"
29
-
30
- gem "coveralls", require: false
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Microsoft Corporation
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,146 +0,0 @@
1
- # Microsoft Azure Storage Common Client Library for Ruby
2
-
3
- [![Gem Version](https://badge.fury.io/rb/azure-storage-common.svg)](https://badge.fury.io/rb/azure-storage-common)
4
- * Master: [![Master Build Status](https://travis-ci.org/Azure/azure-storage-ruby.svg?branch=master)](https://travis-ci.org/Azure/azure-storage-ruby/branches) [![Coverage Status](https://coveralls.io/repos/github/Azure/azure-storage-ruby/badge.svg?branch=master)](https://coveralls.io/github/Azure/azure-storage-ruby?branch=master)
5
- * Dev: [![Dev Build Status](https://travis-ci.org/Azure/azure-storage-ruby.svg?branch=dev)](https://travis-ci.org/Azure/azure-storage-ruby/branches) [![Coverage Status](https://coveralls.io/repos/github/Azure/azure-storage-ruby/badge.svg?branch=dev)](https://coveralls.io/github/Azure/azure-storage-ruby?branch=dev)
6
-
7
- This project provides a Ruby package that supports service client libraries.
8
-
9
- # Supported Ruby Versions
10
-
11
- * Ruby 2.3 to 2.7
12
-
13
- Note:
14
-
15
- * x64 Ruby for Windows is known to have some compatibility issues.
16
- * azure-storage-common depends on gem nokogiri.
17
-
18
- # Getting Started
19
-
20
- ## Install the rubygem package
21
-
22
- You can install the azure storage common rubygem package directly.
23
-
24
- ```bash
25
- gem install azure-storage-common
26
- ```
27
-
28
- ## Create client
29
-
30
- You can use this module to create client that can be later shared by service modules, to avoid repeating code of creating storage client.
31
-
32
- There are two ways you can create the client:
33
-
34
- 1. [via code](#via-code)
35
- 2. [via environment variables](#via-environment-variables)
36
-
37
- <a name="via-code"></a>
38
- ### Via Code
39
- * Against Microsoft Azure Services in the cloud
40
-
41
- ```ruby
42
-
43
- require 'azure/storage/common'
44
-
45
- # Setup a specific instance of an Azure::Storage::Common::Client
46
- client = Azure::Storage::Common::Client.create(storage_account_name: <your account name>, storage_access_key: <your access key>)
47
-
48
- # Configure a ca_cert.pem file if you are having issues with ssl peer verification
49
- client.ca_file = './ca_file.pem'
50
-
51
- ```
52
-
53
- * Against local Emulator (Windows Only)
54
-
55
- ```ruby
56
-
57
- require 'azure/storage/common'
58
- client = Azure::Storage::Common::Client.create_development
59
-
60
- # Or create by options and provide your own proxy_uri
61
- client = Azure::Storage::Common::Client.create(use_development_storage: true, development_storage_proxy_uri: <your proxy uri>)
62
-
63
- ```
64
-
65
- <a name="via-environment-variables"></a>
66
- ### Via Environment Variables
67
-
68
- * Against Microsoft Azure Storage Services in the cloud
69
-
70
- ```bash
71
- export AZURE_STORAGE_ACCOUNT = <your azure storage account name>
72
- export AZURE_STORAGE_ACCESS_KEY = <your azure storage access key>
73
- ```
74
-
75
- * Against local Emulator (Windows Only)
76
-
77
- ```bash
78
- export EMULATED = true
79
- ```
80
-
81
- * [SSL Certificate File](https://gist.github.com/fnichol/867550) if having issues with ssl peer verification
82
-
83
- ```bash
84
- SSL_CERT_FILE=<path to *.pem>
85
- ```
86
-
87
- # Usage
88
-
89
- <a name="sas"></a>
90
- ## Shared Access Signature generation
91
-
92
- ```ruby
93
-
94
- require "azure/storage/common"
95
-
96
- # Creating an instance of `Azure::Storage::Common::Core::Auth::SharedAccessSignature`
97
- generator = Azure::Storage::Common::Core::Auth::SharedAccessSignature.new(your_account_name, your_access_key)
98
-
99
- # The generator now can be used to create service SAS or account SAS.
100
- generator.generate_service_sas_token(my_path_or_table_name, my_sas_options)
101
- generator.generate_account_sas_token(my_account_sas_options)
102
- # For details about the possible options, please reference the document of the class `Azure::Storage::Common::Core::Auth::SharedAccessSignature`
103
-
104
- ```
105
-
106
- <a name="token"></a>
107
- ## Access Token
108
-
109
- Please refer to the below links for obtaining an access token:
110
- * [Authenticate with Azure Active Directory](https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-azure-active-directory)
111
- * [Getting a MSI access token](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-linux-vm-access-storage#get-an-access-token-and-use-it-to-call-azure-storage)
112
-
113
- ```ruby
114
- require "azure/storage/common"
115
-
116
- access_token = <your initial access token>
117
-
118
- # Creating an instance of `Azure::Storage::Common::Core::TokenCredential`
119
- token_credential = Azure::Storage::Common::Core::TokenCredential.new access_token
120
- token_signer = Azure::Storage::Common::Core::Auth::TokenSigner.new token_credential
121
- common_token_client = Azure::Storage::Common::Client.create.new(storage_account_name: <your_account_name>, signer: token_signer)
122
-
123
- # Refresh internal is 50 minutes
124
- refresh_interval = 50 * 60
125
- # The user-defined thread that renews the access token
126
- cancelled = false
127
- renew_token = Thread.new do
128
- Thread.stop
129
- while !cancelled
130
- sleep(refresh_interval)
131
-
132
- # Renew the access token here
133
-
134
- # Update the access token to the credential
135
- token_credential.renew_token <new_access_token>
136
- end
137
- end
138
- sleep 0.1 while renew_token.status != 'sleep'
139
- renew_token.run
140
-
141
- # Call client functions as usaual
142
-
143
- ```
144
-
145
- # Code of Conduct
146
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@@ -1,57 +0,0 @@
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 "date"
27
-
28
- require_relative "./lib/azure/storage/common/version"
29
-
30
- Gem::Specification.new do |s|
31
- s.name = "azure-storage-common"
32
- s.version = Azure::Storage::Common::Version
33
- s.authors = ["Microsoft Corporation"]
34
- s.email = "ascl@microsoft.com"
35
- s.description = "Microsoft Azure Storage Common Client Library for Ruby"
36
- s.summary = "Official Ruby client library to consume Azure Storage Common service"
37
- s.homepage = "http://github.com/azure/azure-storage-ruby"
38
- s.license = "MIT"
39
- s.files = `git ls-files ./lib/azure/storage/common/`.split("\n") << "./lib/azure/storage/common.rb"
40
- s.files += `git ls-files ./lib/azure/core/`.split("\n") << "./lib/azure/core.rb" << "./lib/azure/http_response_helper.rb"
41
-
42
- s.required_ruby_version = ">= 2.3.0"
43
-
44
- s.add_runtime_dependency('faraday', '~> 2.0')
45
- s.add_runtime_dependency('faraday-follow_redirects','~> 0.3.0')
46
- s.add_runtime_dependency('faraday-net_http_persistent', '~> 2.0')
47
- s.add_runtime_dependency("net-http-persistent", '~> 4.0')
48
- s.add_runtime_dependency("nokogiri", "~> 1", ">= 1.10.8")
49
- s.add_development_dependency("dotenv", "~> 2.0")
50
- s.add_development_dependency("minitest", "~> 5")
51
- s.add_development_dependency("minitest-reporters", "~> 1")
52
- s.add_development_dependency("mocha", "~> 1.0")
53
- s.add_development_dependency("rake", "~> 13.0")
54
- s.add_development_dependency("timecop", "~> 0.7")
55
- s.add_development_dependency("yard", "~> 0.9", ">= 0.9.11")
56
- s.add_development_dependency('bundler', '~> 1.11')
57
- end