@@ -288,10 +288,6 @@ impl Default for Configuration {
288
288
}
289
289
290
290
impl Configuration {
291
- fn override_api_admin_token ( & mut self , api_admin_token : & str ) {
292
- self . http_api . override_admin_token ( api_admin_token) ;
293
- }
294
-
295
291
/// Returns the tracker public IP address id defined in the configuration,
296
292
/// and `None` otherwise.
297
293
#[ must_use]
@@ -331,11 +327,7 @@ impl Configuration {
331
327
. merge ( Env :: prefixed ( CONFIG_OVERRIDE_PREFIX ) . split ( CONFIG_OVERRIDE_SEPARATOR ) )
332
328
} ;
333
329
334
- let mut config: Configuration = figment. extract ( ) ?;
335
-
336
- if let Some ( ref token) = info. api_admin_token {
337
- config. override_api_admin_token ( token) ;
338
- } ;
330
+ let config: Configuration = figment. extract ( ) ?;
339
331
340
332
Ok ( config)
341
333
}
@@ -469,7 +461,6 @@ mod tests {
469
461
let info = Info {
470
462
config_toml : Some ( empty_configuration) ,
471
463
config_toml_path : "tracker.toml" . to_string ( ) ,
472
- api_admin_token : None ,
473
464
} ;
474
465
475
466
let configuration = Configuration :: load ( & info) . expect ( "Could not load configuration from file" ) ;
@@ -491,7 +482,6 @@ mod tests {
491
482
let info = Info {
492
483
config_toml : Some ( config_toml) ,
493
484
config_toml_path : String :: new ( ) ,
494
- api_admin_token : None ,
495
485
} ;
496
486
497
487
let configuration = Configuration :: load ( & info) . expect ( "Could not load configuration from file" ) ;
@@ -515,7 +505,6 @@ mod tests {
515
505
let info = Info {
516
506
config_toml : None ,
517
507
config_toml_path : "tracker.toml" . to_string ( ) ,
518
- api_admin_token : None ,
519
508
} ;
520
509
521
510
let configuration = Configuration :: load ( & info) . expect ( "Could not load configuration from file" ) ;
@@ -534,27 +523,6 @@ mod tests {
534
523
let info = Info {
535
524
config_toml : Some ( default_config_toml ( ) ) ,
536
525
config_toml_path : String :: new ( ) ,
537
- api_admin_token : None ,
538
- } ;
539
-
540
- let configuration = Configuration :: load ( & info) . expect ( "Could not load configuration from file" ) ;
541
-
542
- assert_eq ! (
543
- configuration. http_api. access_tokens. get( "admin" ) ,
544
- Some ( "NewToken" . to_owned( ) ) . as_ref( )
545
- ) ;
546
-
547
- Ok ( ( ) )
548
- } ) ;
549
- }
550
-
551
- #[ test]
552
- fn configuration_should_allow_to_overwrite_the_default_tracker_api_token_for_admin_with_the_deprecated_env_var_name ( ) {
553
- figment:: Jail :: expect_with ( |_jail| {
554
- let info = Info {
555
- config_toml : Some ( default_config_toml ( ) ) ,
556
- config_toml_path : String :: new ( ) ,
557
- api_admin_token : Some ( "NewToken" . to_owned ( ) ) ,
558
526
} ;
559
527
560
528
let configuration = Configuration :: load ( & info) . expect ( "Could not load configuration from file" ) ;
0 commit comments