File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,8 @@ pub struct Config {
41
41
// Gitlab authentication
42
42
pub ( crate ) gitlab_accesstoken : Option < String > ,
43
43
44
- // Access token for rebuild trigger at path
45
- // "/crate/:name/:version/rebuild"
46
- pub ( crate ) trigger_rebuild_token : Option < String > ,
44
+ // Access token for APIs for crates.io
45
+ pub ( crate ) cratesio_token : Option < String > ,
47
46
48
47
// amount of retries for external API calls, mostly crates.io
49
48
pub crates_io_api_call_retries : u32 ,
@@ -180,7 +179,7 @@ impl Config {
180
179
181
180
gitlab_accesstoken : maybe_env ( "DOCSRS_GITLAB_ACCESSTOKEN" ) ?,
182
181
183
- trigger_rebuild_token : maybe_env ( "DOCSRS_TRIGGER_REBUILD_TOKEN " ) ?,
182
+ cratesio_token : maybe_env ( "DOCSRS_CRATESIO_TOKEN " ) ?,
184
183
185
184
max_file_size : env ( "DOCSRS_MAX_FILE_SIZE" , 50 * 1024 * 1024 ) ?,
186
185
max_file_size_html : env ( "DOCSRS_MAX_FILE_SIZE_HTML" , 50 * 1024 * 1024 ) ?,
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ pub(crate) async fn build_trigger_rebuild_handler(
162
162
) -> JsonAxumResult < impl IntoResponse > {
163
163
let expected_token =
164
164
config
165
- . trigger_rebuild_token
165
+ . cratesio_token
166
166
. as_ref ( )
167
167
. ok_or ( JsonAxumNope ( AxumNope :: Unauthorized (
168
168
"Endpoint is not configured" ,
@@ -398,7 +398,7 @@ mod tests {
398
398
fn build_trigger_rebuild_with_config ( ) {
399
399
wrapper ( |env| {
400
400
let correct_token = "foo137" ;
401
- env. override_config ( |config| config. trigger_rebuild_token = Some ( correct_token. into ( ) ) ) ;
401
+ env. override_config ( |config| config. cratesio_token = Some ( correct_token. into ( ) ) ) ;
402
402
403
403
env. fake_release ( ) . name ( "foo" ) . version ( "0.1.0" ) . create ( ) ?;
404
404
You can’t perform that action at this time.
0 commit comments