Skip to content
This repository was archived by the owner on Jun 1, 2024. It is now read-only.

Commit 628b613

Browse files
committed
Prepare for release
1 parent 0763a17 commit 628b613

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

CHANGES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [9.0.2]
8+
9+
- Add support for API Keys by @qgbo in #545
10+
711
## [9.0.1]
812

913
- fixes: v9.0.0 fails template creation with ES v7 with ElasticsearchCl… by @nenadvicentic in #533
1014

11-
## [Unreleased]
12-
1315
## [9.0.0] - 2023-01-23
1416

1517
### Added

src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticsearchSinkOptions.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,17 @@ public int QueueSizeLimit
282282
public RollingInterval BufferFileRollingInterval { get; set; }
283283

284284
/// <summary>
285-
/// Apikey to access elasticsearch, the value is encoded
286-
/// If your elasticsearch can be accessed using user and password, you access via url like this: http://user:password@localhost
287-
/// For another choice, you can using a apiKey, which can be created in kibana: POST /security/api_key { "name": "aaa-apikeys", "role_descriptors": { "abc-shared-application": { "cluster": [ "all" ], "index": [ { "names": [ "abc_share*" ], "privileges": [ "all" ] } ] } } }
288-
/// then you can get the apikey coded by base64 it like this: aFlBbDVvY0JOblduWHdpZnNLOUk6cEt2Y01tYVlRQ3FsWlF0MVVjRkN034==
289-
/// For more detail about apiKey, see: https://www.elastic.co/guide/en/apm/server/7.15/api-key.html
285+
/// Specify the Api key used to access elasticsearch, the value needs to be encoded.
286+
/// If your elasticsearch instance can be accessed using a username and password,
287+
/// you access it via url like this: http://user:password@localhost
288+
///
289+
/// Alternatively, you can using API key, which can be created in kibana:
290+
/// POST /security/api_key { "name": "aaa-apikeys", "role_descriptors": { "abc-shared-application": { "cluster": [ "all" ], "index": [ { "names": [ "abc_share*" ], "privileges": [ "all" ] } ] } } }
291+
///
292+
/// Afterwards, you can get the apikey and code it using base64 like this: aFlBbDVvY0JOblduWHdpZnNLOUk6cEt2Y01tYVlRQ3FsWlF0MVVjRkN034==
293+
/// For more details about using the apiKey, see: https://www.elastic.co/guide/en/apm/server/7.15/api-key.html
290294
/// </summary>
291-
public string Apikey { get; set; }
295+
public string ApiKey { get; set; }
292296

293297
/// <summary>
294298
/// Configures the elasticsearch sink defaults

src/Serilog.Sinks.Elasticsearch/Sinks/ElasticSearch/ElasticsearchSinkState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ private ElasticsearchSinkState(ElasticsearchSinkOptions options)
8686
if (options.ModifyConnectionSettings != null)
8787
configuration = options.ModifyConnectionSettings(configuration);
8888

89-
if (!string.IsNullOrEmpty(options.Apikey))
90-
configuration = configuration.ApiKeyAuthentication(new ApiKeyAuthenticationCredentials(options.Apikey));
89+
if (!string.IsNullOrEmpty(options.ApiKey))
90+
configuration = configuration.ApiKeyAuthentication(new ApiKeyAuthenticationCredentials(options.ApiKey));
9191

9292
configuration.ThrowExceptions();
9393

0 commit comments

Comments
 (0)