Last active
January 24, 2020 21:29
-
-
Save jen20/6f165bc1ec5997ee21e313b628902c68 to your computer and use it in GitHub Desktop.
Update Rusoto credentials helper for warp 0.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2b6318761ca99f26e5d25e5c9ed6cf2f606dcd12 Mon Sep 17 00:00:00 2001 | |
From: James Nugent <[email protected]> | |
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 <[email protected]>"] | |
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