awstranscriber: use all available credentials mechanisms

AWS specifies a few mechanisms besides environment variables
to provide credentials, ChainProvider implements all of those
in order of priority.
This commit is contained in:
Mathieu Duponchelle 2021-04-22 19:42:44 +02:00
parent 8f74314e96
commit e9a08214bb

View file

@ -26,7 +26,7 @@ use gst::{
use std::default::Default;
use rusoto_core::Region;
use rusoto_credential::{EnvironmentProvider, ProvideAwsCredentials};
use rusoto_credential::{ChainProvider, ProvideAwsCredentials};
use rusoto_signature::signature::SignedRequest;
@ -830,15 +830,13 @@ impl Transcriber {
let creds = {
let _enter = RUNTIME.enter();
futures::executor::block_on(EnvironmentProvider::default().credentials()).map_err(
|err| {
gst_error!(CAT, obj: element, "Failed to generate credentials: {}", err);
error_msg!(
gst::CoreError::Failed,
["Failed to generate credentials: {}", err]
)
},
)?
futures::executor::block_on(ChainProvider::new().credentials()).map_err(|err| {
gst_error!(CAT, obj: element, "Failed to generate credentials: {}", err);
error_msg!(
gst::CoreError::Failed,
["Failed to generate credentials: {}", err]
)
})?
};
let language_code = settings