New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(elasticsearch sink): Add HTTP Basic authorization #749
Conversation
Signed-off-by: Bruce Guenter <bruce@untroubled.org>
Signed-off-by: Bruce Guenter <bruce@untroubled.org>
|
||
let policy = FixedRetryPolicy::new( | ||
retry_attempts, | ||
Duration::from_secs(retry_backoff_secs), | ||
HttpRetryLogic, | ||
); | ||
|
||
let authorization = config.basic_auth.clone().map(|auth| { | ||
let token = format!("{}:{}", auth.user, auth.password); | ||
format!("Basic {}", base64::encode(token.as_bytes())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is correct, but wanted to make sure base64url
is not required here instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so, since it's not going into the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK the authorization token uses the standard base64 character set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
|
||
let policy = FixedRetryPolicy::new( | ||
retry_attempts, | ||
Duration::from_secs(retry_backoff_secs), | ||
HttpRetryLogic, | ||
); | ||
|
||
let authorization = config.basic_auth.clone().map(|auth| { | ||
let token = format!("{}:{}", auth.user, auth.password); | ||
format!("Basic {}", base64::encode(token.as_bytes())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so, since it's not going into the url.
This adds support for HTTP Basic authorization to the elasticsearch sink.
Closes #472