This commit is contained in:
AsafMah 2022-08-07 11:50:06 +03:00
Родитель 5d95efa811
Коммит b5845b39eb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: AD0D1680EEE7A4FF
15 изменённых файлов: 162 добавлений и 141 удалений

Просмотреть файл

@ -89,7 +89,7 @@ impl KustoClient {
/// use azure_kusto_data::prelude::*;
///
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default());
///
/// assert!(client.is_ok());
@ -129,11 +129,11 @@ impl KustoClient {
/// # #[tokio::main] async fn main() -> Result<(), Error> {
///
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default())?;
///
/// // Once the [IntoFuture] trait is stabilized, we can drop the call the `into_future()` here
/// let result = client.execute_with_options("some_database".into(), ".show version".into(), QueryKind::Management, None).into_future().await?;
/// let result = client.execute_with_options("some_database", ".show version", QueryKind::Management, None).into_future().await?;
///
/// assert!(matches!(result, KustoResponse::V1(..)));
/// # Ok(())}
@ -141,10 +141,10 @@ impl KustoClient {
#[must_use]
pub fn execute_with_options(
&self,
database: String,
query: String,
database: impl Into<String>,
query: impl Into<String>,
kind: QueryKind,
options: Option<RequestOptions>,
options: impl Into<Option<RequestOptions>>,
) -> QueryRunner {
QueryRunnerBuilder::default()
.with_kind(kind)
@ -168,13 +168,13 @@ impl KustoClient {
/// use azure_kusto_data::request_options::RequestOptionsBuilder;
///
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default())?;
/// // Once the [IntoFuture] trait is stabilized, we can drop the call the `into_future()` here
/// let result = client.execute_query_with_options(
/// "some_database".into(),
/// "MyTable | take 10".into(),
/// Some(RequestOptionsBuilder::default().with_request_app_name("app name".to_string()).build().unwrap()))
/// "some_database",
/// "MyTable | take 10",
/// Some(RequestOptionsBuilder::default().with_request_app_name("app name").build().unwrap()))
/// .into_future().await?;
///
/// for table in result.into_primary_results() {
@ -186,9 +186,9 @@ impl KustoClient {
#[must_use]
pub fn execute_query_with_options(
&self,
database: String,
query: String,
options: Option<RequestOptions>,
database: impl Into<String>,
query: impl Into<String>,
options: impl Into<Option<RequestOptions>>,
) -> V2QueryRunner {
V2QueryRunner(self.execute_with_options(database, query, QueryKind::Query, options))
}
@ -202,11 +202,11 @@ impl KustoClient {
///
/// # #[tokio::main] async fn main() -> Result<(), Error> {
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default())?;
///
/// // Once the [IntoFuture] trait is stabilized, we can drop the call the `into_future()` here
/// let result = client.execute_query("some_database".into(), "MyTable | take 10".into()).into_future().await?;
/// let result = client.execute_query("some_database", "MyTable | take 10").into_future().await?;
///
/// for table in result.into_primary_results() {
/// println!("{}", table.table_name);
@ -214,7 +214,11 @@ impl KustoClient {
/// # Ok(())}
/// ```
#[must_use]
pub fn execute_query(&self, database: String, query: String) -> V2QueryRunner {
pub fn execute_query(
&self,
database: impl Into<String>,
query: impl Into<String>,
) -> V2QueryRunner {
V2QueryRunner(self.execute_with_options(database, query, QueryKind::Query, None))
}
@ -226,12 +230,12 @@ impl KustoClient {
/// use azure_kusto_data::prelude::*;
/// # #[tokio::main] async fn main() -> Result<(), Error> {
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default())?;
///
/// // Once the [IntoFuture] trait is stabilized, we can drop the call the `into_future()` here
/// let result = client.execute_command_with_options("some_database".into(), ".show version".into(),
/// Some(RequestOptionsBuilder::default().with_request_app_name("app name".to_string()).build().unwrap()))
/// let result = client.execute_command_with_options("some_database", ".show version",
/// Some(RequestOptionsBuilder::default().with_request_app_name("app name").build().unwrap()))
/// .into_future().await?;
///
/// for table in result.tables {
@ -242,9 +246,9 @@ impl KustoClient {
#[must_use]
pub fn execute_command_with_options(
&self,
database: String,
query: String,
options: Option<RequestOptions>,
database: impl Into<String>,
query: impl Into<String>,
options: impl Into<Option<RequestOptions>>,
) -> V1QueryRunner {
V1QueryRunner(self.execute_with_options(database, query, QueryKind::Management, options))
}
@ -259,11 +263,11 @@ impl KustoClient {
/// # #[tokio::main] async fn main() -> Result<(), Error> {
///
/// let client = KustoClient::new(
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/".to_string()),
/// ConnectionString::with_default_auth("https://mycluster.region.kusto.windows.net/"),
/// KustoClientOptions::default())?;
///
/// // Once the [IntoFuture] trait is stabilized, we can drop the call the `into_future()` here
/// let result = client.execute_command("some_database".into(), ".show version".into()).into_future().await?;
/// let result = client.execute_command("some_database", ".show version").into_future().await?;
///
/// for table in result.tables {
/// println!("{}", table.table_name);
@ -271,7 +275,11 @@ impl KustoClient {
/// # Ok(())}
/// ```
#[must_use]
pub fn execute_command(&self, database: String, query: String) -> V1QueryRunner {
pub fn execute_command(
&self,
database: impl Into<String>,
query: impl Into<String>,
) -> V1QueryRunner {
V1QueryRunner(self.execute_with_options(database, query, QueryKind::Management, None))
}
}

Просмотреть файл

@ -472,7 +472,7 @@ impl ConnectionString {
let mut kv = kv_pair_str.trim().split('=');
let k = match kv.next().filter(|k| !k.chars().all(char::is_whitespace)) {
None => {
return Err(ConnectionStringError::ParsingError {
return Err(ConnectionStringError::Parsing {
msg: "No key found".to_string(),
});
}
@ -486,7 +486,7 @@ impl ConnectionString {
if let Some(&key) = ALIAS_MAP.get(k.to_ascii_lowercase().trim()) {
result_map.insert(key, v.trim());
} else {
return Err(ConnectionStringError::UnexpectedKey { key: k.to_string() });
return Err(ConnectionStringError::from_unexpected_key(k));
}
}
@ -502,11 +502,9 @@ impl ConnectionString {
.map_or(Ok(false), |s| parse_boolean(s, "federated_security"))?;
if let Some(user_id) = result_map.get(&ConnectionStringKey::UserId) {
let password = result_map.get(&ConnectionStringKey::Password).ok_or(
ConnectionStringError::MissingValue {
key: "password".to_string(),
},
)?;
let password = result_map
.get(&ConnectionStringKey::Password)
.ok_or(ConnectionStringError::from_missing_value("password"))?;
Ok(Self {
data_source,
@ -533,16 +531,12 @@ impl ConnectionString {
},
})
} else if let Some(client_id) = result_map.get(&ConnectionStringKey::ApplicationClientId) {
let client_secret = result_map.get(&ConnectionStringKey::ApplicationKey).ok_or(
ConnectionStringError::MissingValue {
key: "application_key".to_string(),
},
)?;
let client_authority = result_map.get(&ConnectionStringKey::AuthorityId).ok_or(
ConnectionStringError::MissingValue {
key: "authority_id".to_string(),
},
)?;
let client_secret = result_map
.get(&ConnectionStringKey::ApplicationKey)
.ok_or(ConnectionStringError::from_missing_value("application_key"))?;
let client_authority = result_map
.get(&ConnectionStringKey::AuthorityId)
.ok_or(ConnectionStringError::from_missing_value("authority_id"))?;
Ok(Self {
data_source,
federated_security,
@ -556,19 +550,17 @@ impl ConnectionString {
{
let private_certificate_path = result_map
.get(&ConnectionStringKey::ApplicationCertificate)
.ok_or(ConnectionStringError::MissingValue {
key: "application_certificate_thumbprint".to_string(),
})?;
.ok_or(ConnectionStringError::from_missing_value(
"application_certificate_thumbprint",
))?;
let thumbprint = result_map
.get(&ConnectionStringKey::ApplicationCertificateThumbprint)
.ok_or(ConnectionStringError::MissingValue {
key: "application_certificate_thumbprint".to_string(),
})?;
let client_authority = result_map.get(&ConnectionStringKey::AuthorityId).ok_or(
ConnectionStringError::MissingValue {
key: "authority_id".to_string(),
},
)?;
.ok_or(ConnectionStringError::from_missing_value(
"application_certificate_thumbprint",
))?;
let client_authority = result_map
.get(&ConnectionStringKey::AuthorityId)
.ok_or(ConnectionStringError::from_missing_value("authority_id"))?;
Ok(Self {
data_source,
federated_security,
@ -632,7 +624,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_default_auth("https://mycluster.kusto.windows.net".into());
/// let conn = ConnectionString::with_default_auth("https://mycluster.kusto.windows.net");
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert_eq!(conn.auth, ConnectionStringAuth::Default);
@ -640,9 +632,9 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;".to_string()))
/// ```
#[must_use]
pub const fn with_default_auth(data_source: String) -> Self {
pub fn with_default_auth(data_source: impl Into<String>) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::Default,
}
@ -653,7 +645,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net".into(), "user".into(), "password".into());
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net", "user", "password");
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert!(matches!(conn.auth, ConnectionStringAuth::UserAndPassword { .. }));
@ -661,15 +653,18 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;AAD User ID=user;Password=******".to_string()))
/// ```
#[must_use]
pub const fn with_user_password_auth(
data_source: String,
user_id: String,
password: String,
pub fn with_user_password_auth(
data_source: impl Into<String>,
user_id: impl Into<String>,
password: impl Into<String>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::UserAndPassword { user_id, password },
auth: ConnectionStringAuth::UserAndPassword {
user_id: user_id.into(),
password: password.into(),
},
}
}
@ -678,7 +673,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_token_auth("https://mycluster.kusto.windows.net".into(), "token".into());
/// let conn = ConnectionString::with_token_auth("https://mycluster.kusto.windows.net", "token");
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert!(matches!(conn.auth, ConnectionStringAuth::Token { .. }));
@ -686,11 +681,13 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;ApplicationToken=******".to_string()))
/// ```
#[must_use]
pub const fn with_token_auth(data_source: String, token: String) -> Self {
pub fn with_token_auth(data_source: impl Into<String>, token: impl Into<String>) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::Token { token },
auth: ConnectionStringAuth::Token {
token: token.into(),
},
}
}
@ -700,7 +697,7 @@ impl ConnectionString {
/// use std::sync::Arc;
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_token_callback_auth("https://mycluster.kusto.windows.net".into(), Arc::new(|resource_uri| resource_uri.to_string()));
/// let conn = ConnectionString::with_token_callback_auth("https://mycluster.kusto.windows.net", Arc::new(|resource_uri| resource_uri.to_string()));
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert!(matches!(conn.auth, ConnectionStringAuth::TokenCallback { .. }));
@ -710,11 +707,11 @@ impl ConnectionString {
/// ```
#[must_use]
pub fn with_token_callback_auth(
data_source: String,
data_source: impl Into<String>,
token_callback: Arc<dyn Fn(&str) -> String + Send + Sync>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::TokenCallback { token_callback },
}
@ -725,29 +722,29 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_application_auth("https://mycluster.kusto.windows.net".into(),
/// "029067d2-220e-4467-99be-b74f4751270b".into(),
/// "client_secret".into(),
/// "e7f86dff-7a05-4b87-8c48-ed1ea5b5b814".into());
/// let conn = ConnectionString::with_application_auth("https://mycluster.kusto.windows.net",
/// "029067d2-220e-4467-99be-b74f4751270b",
/// "client_secret",
/// "e7f86dff-7a05-4b87-8c48-ed1ea5b5b814");
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
///
/// assert!(matches!(conn.auth, ConnectionStringAuth::Application { .. }));
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;Application Client Id=029067d2-220e-4467-99be-b74f4751270b;Application Key=******;Authority Id=e7f86dff-7a05-4b87-8c48-ed1ea5b5b814".to_string()))
/// ```
#[must_use]
pub const fn with_application_auth(
data_source: String,
client_id: String,
client_secret: String,
client_authority: String,
pub fn with_application_auth(
data_source: impl Into<String>,
client_id: impl Into<String>,
client_secret: impl Into<String>,
client_authority: impl Into<String>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::Application {
client_id,
client_secret,
client_authority,
client_id: client_id.into(),
client_secret: client_secret.into(),
client_authority: client_authority.into(),
},
}
}
@ -756,32 +753,32 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_application_certificate_auth("https://mycluster.kusto.windows.net".into(),
/// "029067d2-220e-4467-99be-b74f4751270b".into(),
/// "e7f86dff-7a05-4b87-8c48-ed1ea5b5b814".into(),
/// "certificate.pem".into(),
/// "thumbprint".into());
/// let conn = ConnectionString::with_application_certificate_auth("https://mycluster.kusto.windows.net",
/// "029067d2-220e-4467-99be-b74f4751270b",
/// "e7f86dff-7a05-4b87-8c48-ed1ea5b5b814",
/// "certificate.pem",
/// "thumbprint");
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
///
/// assert!(matches!(conn.auth, ConnectionStringAuth::ApplicationCertificate { .. }));
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;Application Client Id=029067d2-220e-4467-99be-b74f4751270b;ApplicationCertificate=certificate.pem;Application Certificate Thumbprint=******;Authority Id=e7f86dff-7a05-4b87-8c48-ed1ea5b5b814".to_string()))
/// ```
#[must_use]
pub const fn with_application_certificate_auth(
data_source: String,
client_id: String,
client_authority: String,
private_certificate_path: PathBuf,
thumbprint: String,
pub fn with_application_certificate_auth(
data_source: impl Into<String>,
client_id: impl Into<String>,
client_authority: impl Into<String>,
private_certificate_path: impl Into<PathBuf>,
thumbprint: impl Into<String>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::ApplicationCertificate {
client_id,
private_certificate_path,
thumbprint,
client_authority,
client_id: client_id.into(),
private_certificate_path: private_certificate_path.into(),
thumbprint: thumbprint.into(),
client_authority: client_authority.into(),
},
}
}
@ -792,7 +789,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_managed_identity_auth("https://mycluster.kusto.windows.net".into(), None);
/// let conn = ConnectionString::with_managed_identity_auth("https://mycluster.kusto.windows.net", None);
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert_eq!(conn.auth, ConnectionStringAuth::ManagedIdentity { user_id: None });
@ -800,11 +797,16 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;MSI Authentication=True".to_string()))
/// ```
#[must_use]
pub const fn with_managed_identity_auth(data_source: String, user_id: Option<String>) -> Self {
pub fn with_managed_identity_auth(
data_source: impl Into<String>,
user_id: impl Into<Option<String>>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::ManagedIdentity { user_id },
auth: ConnectionStringAuth::ManagedIdentity {
user_id: user_id.into(),
},
}
}
@ -814,7 +816,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_azure_cli_auth("https://mycluster.kusto.windows.net".into());
/// let conn = ConnectionString::with_azure_cli_auth("https://mycluster.kusto.windows.net");
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert_eq!(conn.auth, ConnectionStringAuth::AzureCli);
@ -822,9 +824,9 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;AZ CLI=True".to_string()))
/// ```
#[must_use]
pub const fn with_azure_cli_auth(data_source: String) -> Self {
pub fn with_azure_cli_auth(data_source: impl Into<String>) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::AzureCli,
}
@ -837,7 +839,7 @@ impl ConnectionString {
/// use std::sync::Arc;
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_device_code_auth("https://mycluster.kusto.windows.net".into(), Some(Arc::new(|code| code.to_string())));
/// let conn = ConnectionString::with_device_code_auth("https://mycluster.kusto.windows.net", Some(Arc::new(|code| code.to_string())));
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert!(matches!(conn.auth, ConnectionStringAuth::DeviceCode { .. }));
@ -847,11 +849,11 @@ impl ConnectionString {
/// ```
#[must_use]
pub fn with_device_code_auth(
data_source: String,
data_source: impl Into<String>,
callback: Option<Arc<dyn Fn(&str) -> String + Send + Sync>>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::DeviceCode { callback },
}
@ -862,7 +864,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_interactive_login_auth("https://mycluster.kusto.windows.net".into());
/// let conn = ConnectionString::with_interactive_login_auth("https://mycluster.kusto.windows.net");
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert_eq!(conn.auth, ConnectionStringAuth::InteractiveLogin);
@ -870,9 +872,9 @@ impl ConnectionString {
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;Interactive Login=True".to_string()))
/// ```
#[must_use]
pub const fn with_interactive_login_auth(data_source: String) -> Self {
pub fn with_interactive_login_auth(data_source: impl Into<String>) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::InteractiveLogin,
}
@ -886,7 +888,7 @@ impl ConnectionString {
/// use azure_identity::DefaultAzureCredential;
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_token_credential("https://mycluster.kusto.windows.net".into(), Arc::new(DefaultAzureCredential::default()));
/// let conn = ConnectionString::with_token_credential("https://mycluster.kusto.windows.net", Arc::new(DefaultAzureCredential::default()));
///
/// assert_eq!(conn.data_source, "https://mycluster.kusto.windows.net".to_string());
/// assert!(matches!(conn.auth, ConnectionStringAuth::TokenCredential { .. }));
@ -896,11 +898,11 @@ impl ConnectionString {
/// ```
#[must_use]
pub fn with_token_credential(
data_source: String,
data_source: impl Into<String>,
token_credential: Arc<dyn TokenCredential>,
) -> Self {
Self {
data_source,
data_source: data_source.into(),
federated_security: true,
auth: ConnectionStringAuth::TokenCredential {
credential: token_credential,
@ -915,7 +917,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net".into(), "user".into(), "password".into());
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net", "user", "password");
///
/// assert_eq!(conn.build(), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;AAD User ID=user;Password=******".to_string()));
#[must_use]
@ -929,7 +931,7 @@ impl ConnectionString {
/// ```rust
/// use azure_kusto_data::prelude::{ConnectionString, ConnectionStringAuth};
///
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net".into(), "user".into(), "password".into());
/// let conn = ConnectionString::with_user_password_auth("https://mycluster.kusto.windows.net", "user", "password");
///
/// assert_eq!(conn.build_with_options(false, false), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True;AAD User ID=user;Password=password".to_string()));
/// assert_eq!(conn.build_with_options(false, true), Some("Data Source=https://mycluster.kusto.windows.net;AAD Federated Security=True".to_string()));
@ -960,7 +962,7 @@ impl ConnectionString {
pub(crate) fn into_data_source_and_credentials(self) -> (String, Arc<dyn TokenCredential>) {
(
self.data_source,
self.data_source.into(),
match self.auth {
ConnectionStringAuth::Default => Arc::new(DefaultAzureCredential::default()),
ConnectionStringAuth::UserAndPassword { .. } => unimplemented!(),
@ -997,12 +999,10 @@ fn parse_boolean(term: &str, name: &str) -> Result<bool, ConnectionStringError>
match term.to_lowercase().trim() {
"true" => Ok(true),
"false" => Ok(false),
_ => Err(ConnectionStringError::ParsingError {
msg: format!(
"Unexpected value for {}: {}. Please specify either 'true' or 'false'.",
name, term
),
}),
_ => Err(ConnectionStringError::from_parsing_error(format!(
"Unexpected value for {}: {}. Please specify either 'true' or 'false'.",
name, term
))),
}
}
@ -1019,7 +1019,7 @@ mod tests {
));
assert!(matches!(
ConnectionString::from_raw_connection_string("="),
Err(ConnectionStringError::ParsingError { msg: _ })
Err(ConnectionStringError::Parsing { msg: _ })
));
assert!(matches!(
ConnectionString::from_raw_connection_string("x=123;"),

Просмотреть файл

@ -1,6 +1,7 @@
//! Defines [Error] for representing failures in various operations.
use std::fmt::Debug;
use std::num::TryFromIntError;
use thiserror;
/// Error type for kusto operations.
@ -67,11 +68,23 @@ pub enum ConnectionStringError {
},
/// Raised when a connection string has an invalid value.
#[error("Parsing error: {}", msg)]
ParsingError {
Parsing {
/// The error message.
msg: String,
},
}
impl ConnectionStringError {
pub(crate) fn from_missing_value(key: impl Into<String>) -> Self {
Self::MissingValue { key: key.into() }
}
pub(crate) fn from_unexpected_key(key: impl Into<String>) -> Self {
Self::UnexpectedKey { key: key.into() }
}
pub(crate) fn from_parsing_error(msg: impl Into<String>) -> Self {
Self::Parsing { msg: msg.into() }
}
}
/// Result type for kusto operations.
pub type Result<T> = std::result::Result<T, Error>;

Просмотреть файл

@ -43,7 +43,7 @@ async fn arrow_roundtrip() {
]
";
let response = client
.execute_query(database, query.into())
.execute_query(database, query)
.into_future()
.await
.expect("Failed to run query");

Просмотреть файл

@ -7,7 +7,7 @@ async fn create_query_delete_table() {
let query = ".set KustoRsTest <| let text=\"Hello, World!\"; print str=text";
let response = client
.execute_command(database.clone(), query.into())
.execute_command(database.clone(), query)
.into_future()
.await
.expect("Failed to run query");
@ -16,7 +16,7 @@ async fn create_query_delete_table() {
let query = ".show tables | where TableName == \"KustoRsTest\"";
let response = client
.execute_command(database.clone(), query.into())
.execute_command(database.clone(), query)
.into_future()
.await
.expect("Failed to run query");
@ -25,7 +25,7 @@ async fn create_query_delete_table() {
let query = "KustoRsTest | take 1";
let response = client
.execute_query(database.clone(), query.into())
.execute_query(database.clone(), query)
.into_future()
.await
.expect("Failed to run query");
@ -35,7 +35,7 @@ async fn create_query_delete_table() {
let query = ".drop table KustoRsTest | where TableName == \"KustoRsTest\"";
let response = client
.execute_command(database.clone(), query.into())
.execute_command(database.clone(), query)
.into_future()
.await
.expect("Failed to run query");

Просмотреть файл

@ -1 +1 @@
{"uri":"/v2/rest/query","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","content-length":"531","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiJcbiAgICAgICAgZGF0YXRhYmxlKFxuICAgICAgICAgICAgaWQ6aW50LFxuICAgICAgICAgICAgc3RyaW5nX2NvbDpzdHJpbmcsXG4gICAgICAgICAgICBib29sX2NvbDpib29sLFxuICAgICAgICAgICAgaW50X2NvbDppbnQsXG4gICAgICAgICAgICBiaWdpbnRfY29sOmxvbmcsXG4gICAgICAgICAgICBmbG9hdF9jb2w6cmVhbCxcbiAgICAgICAgICAgIHRpbWVzdGFtcF9jb2w6ZGF0ZXRpbWUsXG4gICAgICAgICAgICBkdXJhdGlvbl9jb2w6dGltZXNwYW5cbiAgICAgICAgKSBbXG4gICAgICAgICAgICA2LCAnSGVsbG8nLCB0cnVlLCAwLCAwLCAwLCBkYXRldGltZSgyMDA5LTA0LTAxIDAwOjAwOjAwKSwgdGltZXNwYW4oMS4wMDowMDowMC4wMDAwMDAxKSxcbiAgICAgICAgICAgIDcsICdXb3JsZCcsIGZhbHNlLCAxLCAxMCwgMS4xLCBkYXRldGltZSgyMDA5LTA0LTAxIDAwOjAxOjAwKSwgdGltZXNwYW4oLTAwOjAxOjAwLjAwMDEwMDEpLFxuICAgICAgICBdXG4gICAgIiwicHJvcGVydGllcyI6e319"}
{"uri":"/v2/rest/query","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","connection":"Keep-Alive","content-length":"531","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiJcbiAgICAgICAgZGF0YXRhYmxlKFxuICAgICAgICAgICAgaWQ6aW50LFxuICAgICAgICAgICAgc3RyaW5nX2NvbDpzdHJpbmcsXG4gICAgICAgICAgICBib29sX2NvbDpib29sLFxuICAgICAgICAgICAgaW50X2NvbDppbnQsXG4gICAgICAgICAgICBiaWdpbnRfY29sOmxvbmcsXG4gICAgICAgICAgICBmbG9hdF9jb2w6cmVhbCxcbiAgICAgICAgICAgIHRpbWVzdGFtcF9jb2w6ZGF0ZXRpbWUsXG4gICAgICAgICAgICBkdXJhdGlvbl9jb2w6dGltZXNwYW5cbiAgICAgICAgKSBbXG4gICAgICAgICAgICA2LCAnSGVsbG8nLCB0cnVlLCAwLCAwLCAwLCBkYXRldGltZSgyMDA5LTA0LTAxIDAwOjAwOjAwKSwgdGltZXNwYW4oMS4wMDowMDowMC4wMDAwMDAxKSxcbiAgICAgICAgICAgIDcsICdXb3JsZCcsIGZhbHNlLCAxLCAxMCwgMS4xLCBkYXRldGltZSgyMDA5LTA0LTAxIDAwOjAxOjAwKSwgdGltZXNwYW4oLTAwOjAxOjAwLjAwMDEwMDEpLFxuICAgICAgICBdXG4gICAgIiwicHJvcGVydGllcyI6e319"}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","content-length":"100","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuc2V0IEt1c3RvUnNUZXN0IDx8IGxldCB0ZXh0PVwiSGVsbG8sIFdvcmxkIVwiOyBwcmludCBzdHI9dGV4dCIsInByb3BlcnRpZXMiOnt9fQ=="}
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","connection":"Keep-Alive","content-length":"100","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuc2V0IEt1c3RvUnNUZXN0IDx8IGxldCB0ZXh0PVwiSGVsbG8sIFdvcmxkIVwiOyBwcmludCBzdHI9dGV4dCIsInByb3BlcnRpZXMiOnt9fQ=="}

Просмотреть файл

@ -1 +1 @@
{"status":200,"headers":{"content-type":"application/json","date":"Thu, 30 Jun 2022 12:12:50 GMT","server":"Kestrel","strict-transport-security":"max-age=2592000; includeSubDomains","transfer-encoding":"chunked","vary":"Accept-Encoding","x-ms-activity-id":"83ed1a5d-aef0-4769-a774-ff8c06d23ee7","x-ms-client-request-id":"unspecified;993c86dc-049f-4725-8d33-4fe97d18519e"},"body":"eyJUYWJsZXMiOlt7IlRhYmxlTmFtZSI6IlRhYmxlXzAiLCJDb2x1bW5zIjpbeyJDb2x1bW5OYW1lIjoiRXh0ZW50SWQiLCJEYXRhVHlwZSI6Ikd1aWQiLCJDb2x1bW5UeXBlIjoiZ3VpZCJ9LHsiQ29sdW1uTmFtZSI6Ik9yaWdpbmFsU2l6ZSIsIkRhdGFUeXBlIjoiRG91YmxlIiwiQ29sdW1uVHlwZSI6InJlYWwifSx7IkNvbHVtbk5hbWUiOiJFeHRlbnRTaXplIiwiRGF0YVR5cGUiOiJEb3VibGUiLCJDb2x1bW5UeXBlIjoicmVhbCJ9LHsiQ29sdW1uTmFtZSI6IkNvbXByZXNzZWRTaXplIiwiRGF0YVR5cGUiOiJEb3VibGUiLCJDb2x1bW5UeXBlIjoicmVhbCJ9LHsiQ29sdW1uTmFtZSI6IkluZGV4U2l6ZSIsIkRhdGFUeXBlIjoiRG91YmxlIiwiQ29sdW1uVHlwZSI6InJlYWwifSx7IkNvbHVtbk5hbWUiOiJSb3dDb3VudCIsIkRhdGFUeXBlIjoiSW50NjQiLCJDb2x1bW5UeXBlIjoibG9uZyJ9XSwiUm93cyI6W1siNDYyNjk1MjQtZDQ4Ny00OTcwLTkwY2QtZDFjMThmMWIxOGRhIiwyMS4wLDgwMC4wLDI0Ni4wLDU1NC4wLDFdXX1dfQ=="}
{"status":200,"headers":{"content-type":"application/json","date":"Sun, 07 Aug 2022 08:33:15 GMT","server":"Kestrel","strict-transport-security":"max-age=2592000; includeSubDomains","transfer-encoding":"chunked","vary":"Accept-Encoding","x-ms-activity-id":"b6b3b320-588d-4885-bf16-74351ce8d81f","x-ms-client-request-id":"unspecified;d8b893c7-1cd5-4e65-b9a5-1b8feba21080"},"body":"eyJUYWJsZXMiOlt7IlRhYmxlTmFtZSI6IlRhYmxlXzAiLCJDb2x1bW5zIjpbeyJDb2x1bW5OYW1lIjoiRXh0ZW50SWQiLCJEYXRhVHlwZSI6Ikd1aWQiLCJDb2x1bW5UeXBlIjoiZ3VpZCJ9LHsiQ29sdW1uTmFtZSI6Ik9yaWdpbmFsU2l6ZSIsIkRhdGFUeXBlIjoiRG91YmxlIiwiQ29sdW1uVHlwZSI6InJlYWwifSx7IkNvbHVtbk5hbWUiOiJFeHRlbnRTaXplIiwiRGF0YVR5cGUiOiJEb3VibGUiLCJDb2x1bW5UeXBlIjoicmVhbCJ9LHsiQ29sdW1uTmFtZSI6IkNvbXByZXNzZWRTaXplIiwiRGF0YVR5cGUiOiJEb3VibGUiLCJDb2x1bW5UeXBlIjoicmVhbCJ9LHsiQ29sdW1uTmFtZSI6IkluZGV4U2l6ZSIsIkRhdGFUeXBlIjoiRG91YmxlIiwiQ29sdW1uVHlwZSI6InJlYWwifSx7IkNvbHVtbk5hbWUiOiJSb3dDb3VudCIsIkRhdGFUeXBlIjoiSW50NjQiLCJDb2x1bW5UeXBlIjoibG9uZyJ9XSwiUm93cyI6W1siYjliZGEyNjMtOGIwYi00M2NhLWI4N2QtMzIwNjA1MTcyMzkzIiwyMS4wLDgwMC4wLDI0Ni4wLDU1NC4wLDFdXX1dfQ=="}

Просмотреть файл

@ -1 +1 @@
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","content-length":"87","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuc2hvdyB0YWJsZXMgfCB3aGVyZSBUYWJsZU5hbWUgPT0gXCJLdXN0b1JzVGVzdFwiIiwicHJvcGVydGllcyI6e319"}
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","connection":"Keep-Alive","content-length":"87","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuc2hvdyB0YWJsZXMgfCB3aGVyZSBUYWJsZU5hbWUgPT0gXCJLdXN0b1JzVGVzdFwiIiwicHJvcGVydGllcyI6e319"}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
{"uri":"/v2/rest/query","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","content-length":"58","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiJLdXN0b1JzVGVzdCB8IHRha2UgMSIsInByb3BlcnRpZXMiOnt9fQ=="}
{"uri":"/v2/rest/query","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","connection":"Keep-Alive","content-length":"58","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiJLdXN0b1JzVGVzdCB8IHRha2UgMSIsInByb3BlcnRpZXMiOnt9fQ=="}

Просмотреть файл

@ -1 +1 @@
{"status":200,"headers":{"content-type":"application/json","date":"Thu, 30 Jun 2022 12:12:51 GMT","server":"Kestrel","strict-transport-security":"max-age=2592000; includeSubDomains","transfer-encoding":"chunked","vary":"Accept-Encoding","x-ms-activity-id":"8468a089-3bff-44fa-8fd9-690b64b12510","x-ms-client-request-id":"unspecified;2fa0ae26-2ce6-45d3-af82-1941f383a80c"},"body":"W3siRnJhbWVUeXBlIjoiRGF0YVNldEhlYWRlciIsIklzUHJvZ3Jlc3NpdmUiOmZhbHNlLCJWZXJzaW9uIjoidjIuMCJ9LHsiRnJhbWVUeXBlIjoiRGF0YVRhYmxlIiwiVGFibGVJZCI6MCwiVGFibGVLaW5kIjoiUXVlcnlQcm9wZXJ0aWVzIiwiVGFibGVOYW1lIjoiQEV4dGVuZGVkUHJvcGVydGllcyIsIkNvbHVtbnMiOlt7IkNvbHVtbk5hbWUiOiJUYWJsZUlkIiwiQ29sdW1uVHlwZSI6ImludCJ9LHsiQ29sdW1uTmFtZSI6IktleSIsIkNvbHVtblR5cGUiOiJzdHJpbmcifSx7IkNvbHVtbk5hbWUiOiJWYWx1ZSIsIkNvbHVtblR5cGUiOiJkeW5hbWljIn1dLCJSb3dzIjpbWzEsIlZpc3VhbGl6YXRpb24iLCJ7XCJWaXN1YWxpemF0aW9uXCI6bnVsbCxcIlRpdGxlXCI6bnVsbCxcIlhDb2x1bW5cIjpudWxsLFwiU2VyaWVzXCI6bnVsbCxcIllDb2x1bW5zXCI6bnVsbCxcIkFub21hbHlDb2x1bW5zXCI6bnVsbCxcIlhUaXRsZVwiOm51bGwsXCJZVGl0bGVcIjpudWxsLFwiWEF4aXNcIjpudWxsLFwiWUF4aXNcIjpudWxsLFwiTGVnZW5kXCI6bnVsbCxcIllTcGxpdFwiOm51bGwsXCJBY2N1bXVsYXRlXCI6ZmFsc2UsXCJJc1F1ZXJ5U29ydGVkXCI6ZmFsc2UsXCJLaW5kXCI6bnVsbCxcIlltaW5cIjpcIk5hTlwiLFwiWW1heFwiOlwiTmFOXCIsXC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widGFibGVfcm93X2NvdW50XCI6MSxcInRhYmxlX3NpemVcIjoxM31dfSJdXX0seyJGcmFtZVR5cGUiOiJEYXRhU2V0Q29tcGxldGlvbiIsIkhhc0Vycm9ycyI6ZmFsc2UsIkNhbmNlbGxlZCI6ZmFsc2V9XQ=="}
{"status":200,"headers":{"content-type":"application/json","date":"Sun, 07 Aug 2022 08:33:17 GMT","server":"Kestrel","strict-transport-security":"max-age=2592000; includeSubDomains","transfer-encoding":"chunked","vary":"Accept-Encoding","x-ms-activity-id":"da675129-661f-4301-b25d-4e8d5d6fdfe1","x-ms-client-request-id":"unspecified;ccd2c38b-ebd8-4fcf-ac20-71cd0b12f7ea"},"body":"W3siRnJhbWVUeXBlIjoiRGF0YVNldEhlYWRlciIsIklzUHJvZ3Jlc3NpdmUiOmZhbHNlLCJWZXJzaW9uIjoidjIuMCJ9LHsiRnJhbWVUeXBlIjoiRGF0YVRhYmxlIiwiVGFibGVJZCI6MCwiVGFibGVLaW5kIjoiUXVlcnlQcm9wZXJ0aWVzIiwiVGFibGVOYW1lIjoiQEV4dGVuZGVkUHJvcGVydGllcyIsIkNvbHVtbnMiOlt7IkNvbHVtbk5hbWUiOiJUYWJsZUlkIiwiQ29sdW1uVHlwZSI6ImludCJ9LHsiQ29sdW1uTmFtZSI6IktleSIsIkNvbHVtblR5cGUiOiJzdHJpbmcifSx7IkNvbHVtbk5hbWUiOiJWYWx1ZSIsIkNvbHVtblR5cGUiOiJkeW5hbWljIn1dLCJSb3dzIjpbWzEsIlZpc3VhbGl6YXRpb24iLCJ7XCJWaXN1YWxpemF0aW9uXCI6bnVsbCxcIlRpdGxlXCI6bnVsbCxcIlhDb2x1bW5cIjpudWxsLFwiU2VyaWVzXCI6bnVsbCxcIllDb2x1bW5zXCI6bnVsbCxcIkFub21hbHlDb2x1bW5zXCI6bnVsbCxcIlhUaXRsZVwiOm51bGwsXCJZVGl0bGVcIjpudWxsLFwiWEF4aXNcIjpudWxsLFwiWUF4aXNcIjpudWx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X2NsdXN0ZXJfdG90YWxfYnl0ZXNcIjoyMjMxLFwiY3Jvc3NfY2x1c3Rlcl90b3RhbF9ieXRlc1wiOjB9fSxcImlucHV0X2RhdGFzZXRfc3RhdGlzdGljc1wiOntcImV4dGVudHNcIjp7XCJ0b3RhbFwiOjEsXCJzY2FubmVkXCI6MSxcInNjYW5uZWRfbWluX2RhdGV0aW1lXCI6XCIyMDIyLTA4LTA3VDA4OjMzOjE1LjkwMzAzODBaXCIsXCJzY2FubmVkX21heF9kYXRldGltZVwiOlwiMjAyMi0wOC0wN1QwODozMzoxNS45MDMwMzgwWlwifSxcInJvd3NcIjp7XCJ0b3RhbFwiOjEsXCJzY2FubmVkXCI6MX0sXCJyb3dzdG9yZXNcIjp7XCJzY2FubmVkX3Jvd3NcIjowLFwic2Nhbm5lZF92YWx1ZXNfc2l6ZVwiOjB9LFwic2hhcmRzXCI6e1wicXVlcmllc19nZW5lcmljXCI6MSxcInF1ZXJpZXNfc3BlY2lhbGl6ZWRcIjowfX0sXCJkYXRhc2V0X3N0YXRpc3RpY3NcIjpbe1widGFibGVfcm93X2NvdW50XCI6MSxcInRhYmxlX3NpemVcIjoxM31dLFwiY3Jvc3NfY2x1c3Rlcl9yZXNvdXJjZV91c2FnZVwiOnt9fSJdXX0seyJGcmFtZVR5cGUiOiJEYXRhU2V0Q29tcGxldGlvbiIsIkhhc0Vycm9ycyI6ZmFsc2UsIkNhbmNlbGxlZCI6ZmFsc2V9XQ=="}

Просмотреть файл

@ -1 +1 @@
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","content-length":"98","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuZHJvcCB0YWJsZSBLdXN0b1JzVGVzdCB8IHdoZXJlIFRhYmxlTmFtZSA9PSBcIkt1c3RvUnNUZXN0XCIiLCJwcm9wZXJ0aWVzIjp7fX0="}
{"uri":"/v1/rest/mgmt","method":"POST","headers":{"accept":"application/json","accept-encoding":"gzip","authorization":"<<STRIPPED>>","connection":"Keep-Alive","content-length":"98","content-type":"application/json; charset=utf-8","user-agent":"azsdk-rust-azure-kusto-data/0.1.0 (1.58.1; windows; x86_64)","x-ms-client-version":"Kusto.Rust.Client:0.1.0","x-ms-version":"2019-02-13"},"body":"eyJkYiI6IkRhdGEiLCJjc2wiOiIuZHJvcCB0YWJsZSBLdXN0b1JzVGVzdCB8IHdoZXJlIFRhYmxlTmFtZSA9PSBcIkt1c3RvUnNUZXN0XCIiLCJwcm9wZXJ0aWVzIjp7fX0="}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны