aboutsummaryrefslogblamecommitdiff
path: root/src/garage/tests/common/client.rs
blob: ef4daa5d64760a5a564b38e8648b8cf49f09cd48 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                    
 

                                        
 
                                          
                                                                                                  

                                      
                                                                           

                                                  



                                 
use aws_sdk_s3::config::Credentials;
use aws_sdk_s3::{Client, Config};

use super::garage::Key;
use crate::common::garage::DEFAULT_PORT;

pub fn build_client(key: &Key) -> Client {
	let credentials = Credentials::new(&key.id, &key.secret, None, None, "garage-integ-test");

	let config = Config::builder()
		.endpoint_url(format!("http://127.0.0.1:{}", DEFAULT_PORT))
		.region(super::REGION)
		.credentials_provider(credentials)
		.build();

	Client::from_conf(config)
}