add session credential handling

This commit is contained in:
jfmonty2 committed 2026-11-24 13:49:55 -05:00
1 parent 009eec764e
commit 179e853dc6
7 files changed
+952 -43

No files matched your search

+7 -3
View File
@@ -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))))
}