Skip to content
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(sources): add custom auth strategy for components with HTTP server #22236

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
8 changes: 8 additions & 0 deletions changelog.d/22236_custom_server_auth_strategy.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Custom authorization strategy is now supported for sources running
HTTP servers (`http_server` source, `prometheus` source, `datadog_agent`, etc.).

Since there are now multiple authorization strategies, if you are using `auth` in any
of these supported components, you now also need to add `strategy: "basic"`, together with
`user` and `password`.

authors: esensar
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(missing_docs)]
esensar marked this conversation as resolved.
Show resolved Hide resolved
use std::{error::Error, fmt};

use serde::Serialize;
Expand Down
12 changes: 12 additions & 0 deletions src/common/http/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Common module between modules that use HTTP
#[cfg(all(
feature = "sources-utils-http-auth",
feature = "sources-utils-http-error"
))]
pub mod server_auth;

#[cfg(feature = "sources-utils-http-error")]
mod error;

#[cfg(feature = "sources-utils-http-error")]
pub use error::ErrorMessage;
Loading