@@ -30,11 +30,11 @@ use tokio::{
30
30
runtime:: Runtime ,
31
31
signal:: unix:: { signal, SignalKind } ,
32
32
} ;
33
+ use unftp_sbe_gcs:: options:: AuthMethod ;
33
34
use user:: LookupAuthenticator ;
34
35
35
36
#[ cfg( feature = "pam_auth" ) ]
36
- use libunftp:: auth:: pam;
37
- use libunftp:: storage:: cloud_storage:: options:: AuthMethod ;
37
+ use unftp_auth_pam as pam;
38
38
39
39
fn make_auth ( m : & clap:: ArgMatches ) -> Result < Arc < dyn auth:: Authenticator < user:: User > + Send + Sync > , String > {
40
40
match m. value_of ( args:: AUTH_TYPE ) {
@@ -60,7 +60,7 @@ fn make_pam_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<use
60
60
#[ cfg( feature = "pam_auth" ) ]
61
61
{
62
62
if let Some ( service) = m. value_of ( args:: AUTH_PAM_SERVICE ) {
63
- let pam_auth = pam:: PAMAuthenticator :: new ( service) ;
63
+ let pam_auth = pam:: PamAuthenticator :: new ( service) ;
64
64
return Ok ( Arc :: new ( LookupAuthenticator :: new ( pam_auth) ) ) ;
65
65
}
66
66
Err ( format ! ( "--{} is required when using pam auth" , args:: AUTH_PAM_SERVICE ) )
@@ -88,7 +88,7 @@ fn make_rest_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<us
88
88
return Err ( "REST authenticator error: no body provided for rest request" . to_string ( ) ) ;
89
89
}
90
90
91
- let authenticator: auth :: rest :: RestAuthenticator = match auth :: rest :: Builder :: new ( )
91
+ let authenticator: unftp_auth_rest :: RestAuthenticator = match unftp_auth_rest :: Builder :: new ( )
92
92
. with_username_placeholder ( "{USER}" . to_string ( ) )
93
93
. with_password_placeholder ( "{PASS}" . to_string ( ) )
94
94
. with_url ( String :: from ( url) )
@@ -124,17 +124,17 @@ fn make_json_auth(m: &clap::ArgMatches) -> Result<Arc<dyn auth::Authenticator<us
124
124
. value_of ( args:: AUTH_JSON_PATH )
125
125
. ok_or_else ( || "please provide the json credentials file by specifying auth-json-path" . to_string ( ) ) ?;
126
126
127
- let authenticator = auth :: jsonfile :: JsonFileAuthenticator :: new ( path) . map_err ( |e| e. to_string ( ) ) ?;
127
+ let authenticator = unftp_auth_jsonfile :: JsonFileAuthenticator :: new ( path) . map_err ( |e| e. to_string ( ) ) ?;
128
128
Ok ( Arc :: new ( LookupAuthenticator :: new ( authenticator) ) )
129
129
}
130
130
}
131
131
132
132
// Creates the filesystem storage back-end
133
- fn fs_storage_backend ( log : & Logger , m : & clap:: ArgMatches ) -> Box < dyn ( Fn ( ) -> storage:: StorageBE ) + Send + Sync > {
133
+ fn fs_storage_backend ( log : & Logger , m : & clap:: ArgMatches ) -> Box < dyn ( Fn ( ) -> storage:: StorageBe ) + Send + Sync > {
134
134
let p: PathBuf = m. value_of ( args:: ROOT_DIR ) . unwrap ( ) . into ( ) ;
135
135
let sub_log = Arc :: new ( log. new ( o ! ( "module" => "storage" ) ) ) ;
136
- Box :: new ( move || storage:: StorageBE {
137
- inner : storage:: InnerStorage :: File ( libunftp :: storage :: filesystem :: Filesystem :: new ( p. clone ( ) ) ) ,
136
+ Box :: new ( move || storage:: StorageBe {
137
+ inner : storage:: InnerStorage :: File ( unftp_sbe_fs :: Filesystem :: new ( p. clone ( ) ) ) ,
138
138
log : sub_log. clone ( ) ,
139
139
} )
140
140
}
@@ -143,7 +143,7 @@ fn fs_storage_backend(log: &Logger, m: &clap::ArgMatches) -> Box<dyn (Fn() -> st
143
143
fn gcs_storage_backend (
144
144
log : & Logger ,
145
145
m : & clap:: ArgMatches ,
146
- ) -> Result < Box < dyn ( Fn ( ) -> storage:: StorageBE ) + Send + Sync > , String > {
146
+ ) -> Result < Box < dyn ( Fn ( ) -> storage:: StorageBe ) + Send + Sync > , String > {
147
147
let bucket: String = m
148
148
. value_of ( args:: GCS_BUCKET )
149
149
. ok_or_else ( || format ! ( "--{} is required when using storage type gcs" , args:: GCS_BUCKET ) ) ?
@@ -177,8 +177,8 @@ fn gcs_storage_backend(
177
177
slog:: info!( log, "GCS back-end auth method: {}" , auth_method) ;
178
178
179
179
let sub_log = Arc :: new ( log. new ( o ! ( "module" => "storage" ) ) ) ;
180
- Ok ( Box :: new ( move || storage:: StorageBE {
181
- inner : storage:: InnerStorage :: Cloud ( libunftp :: storage :: cloud_storage :: CloudStorage :: with_api_base (
180
+ Ok ( Box :: new ( move || storage:: StorageBe {
181
+ inner : storage:: InnerStorage :: Cloud ( unftp_sbe_gcs :: CloudStorage :: with_api_base (
182
182
base_url. clone ( ) ,
183
183
bucket. clone ( ) ,
184
184
root_dir. clone ( ) ,
@@ -220,12 +220,12 @@ fn get_passive_host_option(log: &Logger, arg_matches: &ArgMatches) -> Result<opt
220
220
match passive_host_str {
221
221
None | Some ( "from-connection" ) => Ok ( options:: PassiveHost :: FromConnection ) ,
222
222
Some ( ip_or_dns) => match ip_or_dns. parse ( ) {
223
- Ok ( IpAddr :: V4 ( ip) ) => Ok ( options:: PassiveHost :: IP ( ip) ) ,
223
+ Ok ( IpAddr :: V4 ( ip) ) => Ok ( options:: PassiveHost :: Ip ( ip) ) ,
224
224
Ok ( IpAddr :: V6 ( _) ) => Err ( format ! (
225
225
"an IP is valid for the '--{}' argument, but it needs to be an IP v4 address" ,
226
226
args:: PASSIVE_HOST
227
227
) ) ,
228
- Err ( _) => resolve_dns ( log, ip_or_dns) . map ( options:: PassiveHost :: IP ) ,
228
+ Err ( _) => resolve_dns ( log, ip_or_dns) . map ( options:: PassiveHost :: Ip ) ,
229
229
} ,
230
230
}
231
231
}
0 commit comments