Skip to content

Commit

Permalink
Update user agent to include shell version
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbowes committed Apr 28, 2021
1 parent c742169 commit bdd3eca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [2.0.0-alpha6] - [Unreleased]
## [2.0.0-alpha6] - 2021-04-28

### Added

Expand All @@ -9,6 +9,10 @@
* ALT/SHIFT + ENTER forces a newline
- on Windows the sequence is SHIFT+ENTER
- otherwise, ALT+ENTER (which would maximize the window on Windows)

### Changed

* User agent now includes both the driver and shell versions

## [2.0.0-alpha5] - 2021-04-23

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions src/rusoto_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ use std::str::FromStr;
use tracing::warn;

pub async fn build_driver(env: &Environment) -> Result<QldbDriver<QldbSessionClient>> {
let provider = profile_provider(&env)?;
let region = rusoto_region(&env)?;
let creds = match provider {
Some(p) => CredentialProvider::Profile(p),
None => CredentialProvider::Chain(ChainProvider::new()),
};
let client = build_rusoto_client(env).await?;

// We disable transaction retries because they don't make sense. Users
// are entering statements, so if the tx fails they actually have to
Expand All @@ -26,10 +21,8 @@ pub async fn build_driver(env: &Environment) -> Result<QldbDriver<QldbSessionCli
// yet other statements.
QldbDriverBuilder::new()
.ledger_name(env.ledger().value)
.region(region)
.credentials_provider(creds)
.transaction_retry_policy(retry::never())
.build()
.build_with_client(client)
.await
}

Expand Down Expand Up @@ -59,7 +52,8 @@ async fn build_rusoto_client(env: &Environment) -> Result<QldbSessionClient> {

let mut hyper = HttpClient::new()?;
hyper.local_agent(format!(
"QLDB Driver for Rust v{}",
"QLDB Driver for Rust v{}/QLDB Shell for Rust v{}",
amazon_qldb_driver::version(),
env!("CARGO_PKG_VERSION")
));

Expand Down

0 comments on commit bdd3eca

Please sign in to comment.