fluent-plugin-azurestorage-gen2 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bff097a151b5af0d596f82ab181d3e141abf0de
4
- data.tar.gz: f453dabd8d7719502820e51ae870803d3845a80f
3
+ metadata.gz: b42f7d710c0d096c722704a8737dc9ef17acc34c
4
+ data.tar.gz: 820a5d16c3523f721fe4c9b60dcd04f4e7369a03
5
5
  SHA512:
6
- metadata.gz: 361a92e5ab216018f95a1f0f0e331d0401bf894da0b65ea3a2bcd1ecfb62e3ce3fd599b8633e77ae385537e9590d2cffa51ec4df38917e5f42660932edc87350
7
- data.tar.gz: da8cec0e4867005f2e794c1733c58bfcb33c5ef7e2a6f071f93436506e2d70c3b9a8ecd755ad305973af16bbc9ee163d62d50e632a7d7d26a80964de4d844cc0
6
+ metadata.gz: 9dd02068916c98e40bd0cd59524ce4a6fed211c0d4b912dd4057ff3e7012f7f423c5c00f9fdc72ce5398911ef0a9990a307b2091315adca95ef7ac28a5ae35ab
7
+ data.tar.gz: a7bff81b96aea91b67d3cca7cec85fa27edc5e701dd47db993e8ae9dd6d6d1ff980f62c4b6755959935acbe0d5ea52d8908eee4ed682001e0ef65af7013f05f6
data/README.md CHANGED
@@ -140,6 +140,10 @@ If that setting is disabled, the worker won't fail on initialization (getting fi
140
140
 
141
141
  The defaultt `url_domain_suffix` is `.dfs.core.windows.net`, you can override this in case of private endpoints.
142
142
 
143
+ ### url_storage_resource
144
+
145
+ The url that is used during accessing a resource. Default value: `https://storage.azure.com/`
146
+
143
147
  ### azure_object_key_format
144
148
 
145
149
  The format of Azure Storage object keys. You can use several built-in variables:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.9
1
+ 0.2.10
@@ -39,6 +39,7 @@ module Fluent::Plugin
39
39
  config_param :enable_retry, :bool, :default => false
40
40
  config_param :startup_fail_on_error, :bool, :default => true
41
41
  config_param :url_domain_suffix, :string, :default => '.dfs.core.windows.net'
42
+ config_param :url_storage_resource, :string, :default => 'https://storage.azure.com/'
42
43
  config_param :format, :string, :default => "out_file"
43
44
  config_param :time_slice_format, :string, :default => '%Y%m%d'
44
45
  config_param :hex_random_length, :integer, default: 4
@@ -250,7 +251,7 @@ module Fluent::Plugin
250
251
  # 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
251
252
  private
252
253
  def acquire_access_token_msi
253
- params = { :"api-version" => ACCESS_TOKEN_API_VERSION, :resource => "https://storage.azure.com/" }
254
+ params = { :"api-version" => ACCESS_TOKEN_API_VERSION, :resource => "#{@url_storage_resource}" }
254
255
  unless @azure_instance_msi.nil?
255
256
  params[:msi_res_id] = @azure_instance_msi
256
257
  end
@@ -269,9 +270,9 @@ module Fluent::Plugin
269
270
 
270
271
  private
271
272
  def acquire_access_token_oauth_app
272
- params = { :"api-version" => ACCESS_TOKEN_API_VERSION, :resource => "https://storage.azure.com/"}
273
+ params = { :"api-version" => ACCESS_TOKEN_API_VERSION, :resource => "#{@url_storage_resource}"}
273
274
  headers = {:"Content-Type" => "application/x-www-form-urlencoded"}
274
- content = "grant_type=client_credentials&client_id=#{@azure_oauth_app_id}&client_secret=#{@azure_oauth_secret}&resource=https://storage.azure.com/"
275
+ content = "grant_type=client_credentials&client_id=#{@azure_oauth_app_id}&client_secret=#{@azure_oauth_secret}&resource=#{@url_storage_resource}"
275
276
  request = Typhoeus::Request.new("https://login.microsoftonline.com/#{@azure_oauth_tenant_id}/oauth2/token", :body => content, :headers => headers)
276
277
  request.on_complete do |response|
277
278
  if response.success?
@@ -287,7 +288,7 @@ module Fluent::Plugin
287
288
 
288
289
  private
289
290
  def acquire_access_token_by_az
290
- access_token=`az account get-access-token --resource https://storage.azure.com/ --query accessToken -o tsv`
291
+ access_token=`az account get-access-token --resource #{@url_storage_resource} --query accessToken -o tsv`
291
292
  log.debug "azurestorage_gen2: Token response: #{access_token}"
292
293
  @azure_access_token = access_token.chomp
293
294
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azurestorage-gen2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Szabo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd