Interface IElasticsearchAuthenticationProvider
- Namespace
- Excalibur.Data.ElasticSearch.Security
- Assembly
- Excalibur.Data.ElasticSearch.dll
Defines the contract for Elasticsearch authentication providers that handle secure credential management and authentication token provisioning with enterprise security features.
public interface IElasticsearchAuthenticationProvider
Properties
AuthenticationType
Gets the authentication type supported by this provider for security auditing and monitoring.
ElasticsearchAuthenticationType AuthenticationType { get; }
Property Value
- ElasticsearchAuthenticationType
The authentication method type implemented by this provider.
SupportsRefresh
Gets a value indicating whether this authentication provider supports token refresh.
bool SupportsRefresh { get; }
Property Value
- bool
True if the provider supports authentication token refresh, false otherwise.
SupportsRotation
Gets a value indicating whether this authentication provider supports credential rotation.
bool SupportsRotation { get; }
Property Value
- bool
True if the provider supports automatic credential rotation, false otherwise.
Methods
GetAuthenticationAsync(CancellationToken)
Retrieves the current authentication configuration for Elasticsearch client setup.
Task<AuthenticationHeaderValue?> GetAuthenticationAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token to monitor for cancellation requests.
Returns
- Task<AuthenticationHeaderValue>
A task that represents the asynchronous operation. The task result contains the authentication configuration or null if authentication is not configured.
Exceptions
- SecurityException
Thrown when authentication credentials cannot be retrieved securely.
RefreshAuthenticationAsync(CancellationToken)
Refreshes expired or expiring authentication tokens to maintain continuous secure access.
Task<bool> RefreshAuthenticationAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token to monitor for cancellation requests.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains true if the authentication was successfully refreshed, false if refresh is not supported or failed.
Exceptions
- SecurityException
Thrown when authentication refresh fails due to security constraints.
RotateCredentialsAsync(CancellationToken)
Rotates authentication credentials according to security policies and compliance requirements.
Task<AuthenticationRotationResult> RotateCredentialsAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token to monitor for cancellation requests.
Returns
- Task<AuthenticationRotationResult>
A task that represents the asynchronous operation. The task result contains the rotation result indicating success, failure, or if rotation is not applicable.
Exceptions
- SecurityException
Thrown when credential rotation fails due to security constraints.
ValidateAuthenticationAsync(CancellationToken)
Validates that the current authentication credentials are valid and have not expired.
Task<bool> ValidateAuthenticationAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token to monitor for cancellation requests.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains true if authentication is valid and active, false otherwise.
Exceptions
- SecurityException
Thrown when authentication validation fails due to security constraints.
Events
AuthenticationFailed
Occurs when authentication validation fails, enabling security monitoring and alerting.
event EventHandler<AuthenticationFailedEventArgs>? AuthenticationFailed
Event Type
CredentialsRotated
Occurs when authentication credentials are rotated successfully.
event EventHandler<AuthenticationRotatedEventArgs>? CredentialsRotated