Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jen20/6f165bc1ec5997ee21e313b628902c68 to your computer and use it in GitHub Desktop.
Save jen20/6f165bc1ec5997ee21e313b628902c68 to your computer and use it in GitHub Desktop.
Update Rusoto credentials helper for warp 0.2
From 2b6318761ca99f26e5d25e5c9ed6cf2f606dcd12 Mon Sep 17 00:00:00 2001
From: James Nugent <james@jen20.com>
Date: Fri, 24 Jan 2020 21:15:53 +0000
Subject: [PATCH] Update mock credentials service for warp 0.2
---
rusoto/credential_service_mock/Cargo.toml | 1 +
rusoto/credential_service_mock/src/main.rs | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/rusoto/credential_service_mock/Cargo.toml b/rusoto/credential_service_mock/Cargo.toml
index 85a17402d..dacb02427 100644
--- a/rusoto/credential_service_mock/Cargo.toml
+++ b/rusoto/credential_service_mock/Cargo.toml
@@ -5,4 +5,5 @@ authors = ["Matthew Mayer <matthewkmayer@gmail.com>"]
edition = "2018"
[dependencies]
+tokio = { version = "0.2", features = ["macros"] }
warp = "0.2"
diff --git a/rusoto/credential_service_mock/src/main.rs b/rusoto/credential_service_mock/src/main.rs
index 4a535b8fe..fe84b83ae 100644
--- a/rusoto/credential_service_mock/src/main.rs
+++ b/rusoto/credential_service_mock/src/main.rs
@@ -1,6 +1,7 @@
use warp::{self, path, Filter};
-fn main() {
+#[tokio::main]
+async fn main() {
let instance_profile_role =
path!("latest" / "meta-data" / "iam" / "security-credentials").map(|| "testrole");
let instance_profile_creds =
@@ -20,5 +21,7 @@ fn main() {
.and(instance_profile_creds)
.or(instance_profile_role);
- warp::serve(routes).run(([127, 0, 0, 1], 8080));
+ warp::serve(routes)
+ .run(([127, 0, 0, 1], 8080))
+ .await;
}
--
2.25.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment