fluent-plugin-azure-storage-append-blob-lts 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 335e03eeafd0648547d44b98ce7bbbc3dd8a780dc03d3e39a17005a8305c0ba1
4
- data.tar.gz: e1361ff0a6cc0d95eec72e2b330861de638afd17601a3ba2d6f81d0a18d7ee9a
3
+ metadata.gz: 8f0868aba2220e9c160b9e8bec8854921864b580c1b7cb1d05845ca9e73c4606
4
+ data.tar.gz: 4d73dcf3a57b45018de76a862407062049735da53e96aa664db6304bc65b8718
5
5
  SHA512:
6
- metadata.gz: b2c40956a6eb51ea8a0d19058527fe8c470d48dbf59130671322c99c073353ffb4b9a0f931afcf7707dbc3deda7d44974174214e3045f7d566da876b7f434e93
7
- data.tar.gz: 31258dfaf599e2bcfdda8c268aef6295b9720407c93a8b8997376ef192b7024fe15639da751be765c43e562738ad7f50daf479055f9668ef3cd7748e41173dd2
6
+ metadata.gz: d72f2ccdfb8c92f13694c05f4fc9a349144dd4016b0c1eebee613d8ef536a5072a8635028a097cf21a546220cd11f870eddd4675b1e3241194b39d2a0ddf2d46
7
+ data.tar.gz: a7dfd1c386ed529d9ead3978fe436c7f69a653bd4ce206b5755c8af78142464c4779ab3d781fc14c035f650e5e8940c97a8a4dca240a933ffb5d733b924d9ae3
data/README.md CHANGED
@@ -31,6 +31,7 @@ And then execute:
31
31
  azure_imds_api_version <Azure Instance Metadata Service API Version> # only used for MSI
32
32
  azure_token_refresh_interval <refresh interval in min> # only used for MSI
33
33
  azure_container <your azure storage container>
34
+ azure_msi_client_id <Azure Managed Identity Client ID> # only used for MSI
34
35
  auto_create_container true
35
36
  path logs/
36
37
  azure_object_key_format %{path}%{time_slice}_%{index}.log
@@ -75,6 +76,10 @@ When using MSI, the initial access token needs to be refreshed periodically.
75
76
 
76
77
  Azure Storage Container name
77
78
 
79
+ ### `azure_msi_client_id` (Optional, only for MSI)
80
+
81
+ Azure Identity Client ID to use for accessing Azure Blob service.
82
+
78
83
  ### `auto_create_container`
79
84
 
80
85
  This plugin creates the Azure container if it does not already exist exist when you set 'auto_create_container' to true.
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'fluent-plugin-azure-storage-append-blob-lts'
6
- spec.version = '0.3.0'
6
+ spec.version = '0.4.0'
7
7
  spec.authors = ['Jonas-Taha El Sesiy']
8
8
  spec.email = ['']
9
9
 
@@ -24,6 +24,7 @@ module Fluent
24
24
  config_param :azure_storage_access_key, :string, default: nil, secret: true
25
25
  config_param :azure_storage_sas_token, :string, default: nil, secret: true
26
26
  config_param :azure_storage_connection_string, :string, default: nil, secret: true
27
+ config_param :azure_msi_client_id, :string, default: nil
27
28
  config_param :azure_container, :string, default: nil
28
29
  config_param :azure_imds_api_version, :string, default: '2019-08-15'
29
30
  config_param :azure_token_refresh_interval, :integer, default: 60
@@ -79,11 +80,15 @@ module Fluent
79
80
  def get_access_token
80
81
  access_key_request = Faraday.new('http://169.254.169.254/metadata/identity/oauth2/token?' \
81
82
  "api-version=#{@azure_imds_api_version}" \
82
- '&resource=https://storage.azure.com/',
83
- headers: { 'Metadata' => 'true' })
84
- .get
85
- .body
86
- JSON.parse(access_key_request)['access_token']
83
+ '&resource=https://storage.azure.com/' \
84
+ "#{! azure_msi_client_id.nil? ? "&client_id=#{azure_msi_client_id}" : ''}",
85
+ headers: { 'Metadata' => 'true' }).get
86
+
87
+ if access_key_request.status == 200
88
+ JSON.parse(access_key_request.body)['access_token']
89
+ else
90
+ raise "Access token request was not sucssessful. Possibly due to missing azure_msi_client_id config parameter."
91
+ end
87
92
  end
88
93
 
89
94
  def start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azure-storage-append-blob-lts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas-Taha El Sesiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler