Skip to content

Commit 4ff2295

Browse files
committed
Rename trigger_rebuild_token to cratesio_token
1 parent 8c0bd18 commit 4ff2295

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/config.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ pub struct Config {
4141
// Gitlab authentication
4242
pub(crate) gitlab_accesstoken: Option<String>,
4343

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>,
4746

4847
// amount of retries for external API calls, mostly crates.io
4948
pub crates_io_api_call_retries: u32,
@@ -180,7 +179,7 @@ impl Config {
180179

181180
gitlab_accesstoken: maybe_env("DOCSRS_GITLAB_ACCESSTOKEN")?,
182181

183-
trigger_rebuild_token: maybe_env("DOCSRS_TRIGGER_REBUILD_TOKEN")?,
182+
cratesio_token: maybe_env("DOCSRS_CRATESIO_TOKEN")?,
184183

185184
max_file_size: env("DOCSRS_MAX_FILE_SIZE", 50 * 1024 * 1024)?,
186185
max_file_size_html: env("DOCSRS_MAX_FILE_SIZE_HTML", 50 * 1024 * 1024)?,

src/web/builds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub(crate) async fn build_trigger_rebuild_handler(
162162
) -> JsonAxumResult<impl IntoResponse> {
163163
let expected_token =
164164
config
165-
.trigger_rebuild_token
165+
.cratesio_token
166166
.as_ref()
167167
.ok_or(JsonAxumNope(AxumNope::Unauthorized(
168168
"Endpoint is not configured",
@@ -398,7 +398,7 @@ mod tests {
398398
fn build_trigger_rebuild_with_config() {
399399
wrapper(|env| {
400400
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()));
402402

403403
env.fake_release().name("foo").version("0.1.0").create()?;
404404

0 commit comments

Comments
 (0)