add session credential handling
This commit is contained in:
1 parent
009eec764e
commit
179e853dc6
7 files changed
+952
-43
No files matched your search
@@ -1,4 +1,4 @@
|
||||
use crate::credentials::{AwsCredential, AwsSessionCredential};
|
||||
use crate::credentials::{AwsCredential, AwsSessionCache, AwsSessionCredential};
|
||||
use crate::error::CreddyError;
|
||||
use crate::session::AppSession;
|
||||
use futures::channel::oneshot::{self, Sender};
|
||||
@@ -169,9 +169,13 @@ async fn handle_aws_get(uri: Uri, app: AsyncApp) -> Result<Response<Full<Bytes>>
|
||||
db.load_aws_credential(&name.unwrap_or_else(|| "default".into()))
|
||||
})?;
|
||||
|
||||
// todo: session credential handling
|
||||
let body = if session {
|
||||
let session_creds = AwsSessionCache::get_session(&creds, &app).await?;
|
||||
serde_json::to_vec(&session_creds).unwrap()
|
||||
} else {
|
||||
serde_json::to_vec(&creds).unwrap()
|
||||
};
|
||||
|
||||
let body = serde_json::to_vec(&creds).unwrap();
|
||||
Ok(Response::new(Full::new(Bytes::from(body))))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user