Skip to content

Commit c2ee879

Browse files
committed
feat: update api-framework
1 parent 8685bd1 commit c2ee879

File tree

3 files changed

+15
-52
lines changed

3 files changed

+15
-52
lines changed

Cargo.lock

Lines changed: 5 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/env.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,36 @@ pub mod info {
1919
}
2020

2121
static_lazy_lock! {
22+
/// The port to listen to.
2223
pub PORT: u16 = parse_env!("PORT" => |s| s.parse::<u16>(); anyhow).expect("PORT not set in environment");
23-
"The port to listen to."
2424
}
2525

2626
static_lazy_lock! {
27+
/// The username of the API key.
2728
pub KTT_API_USERNAME: String = env::var("KTT_API_USERNAME").expect("KTT_API_USERNAME not set in environment");
28-
"The username of the API key."
2929
}
3030

3131
static_lazy_lock! {
32+
/// The password of the API key.
3233
pub KTT_API_PASSWORD: String = env::var("KTT_API_PASSWORD").expect("KTT_API_PASSWORD not set in environment");
33-
"The password of the API key."
3434
}
3535

3636
static_lazy_lock! {
37+
/// The maximum file count to use for tracing.
3738
pub TRACING_MAX_FILES: usize = parse_env!("TRACING_MAX_FILES" => |s| s.parse::<usize>(); anyhow).unwrap_or(5);
38-
"The maximum file count to use for tracing."
3939
}
4040

4141
static_lazy_lock! {
42+
/// The directory for tracing files. Defaults to `/tmp/tracing/main` if not specified.
4243
pub TRACING_DIR: PathBuf = parse_env!("TRACING_DIR" => |s| Ok(PathBuf::from(s))).unwrap_or(PathBuf::from("/tmp/tracing")).join(clap::crate_name!());
43-
"The directory for tracing files. Defaults to `/tmp/tracing/main` if not specified."
4444
}
4545

4646
static_lazy_lock! {
47+
/// The name of the Docker container that runs this service.
4748
pub DOCKER_CONTAINER_NAME: String = env::var("DOCKER_CONTAINER_NAME").unwrap_or_else(|_| format!("api-{}", clap::crate_name!()));
48-
"The name of the Docker container that runs this service."
4949
}
5050

5151
static_lazy_lock! {
52+
/// The path to the Docker Compose file.
5253
pub DOCKER_COMPOSE_FILE: PathBuf = parse_env!("DOCKER_COMPOSE_FILE" => |s| Ok(PathBuf::from(s))).unwrap();
53-
"The path to the Docker Compose file."
5454
}

src/middleware/auth.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ pub mod layers {
88
use tower_http::auth::AddAuthorizationLayer;
99

1010
static_lazy_lock! {
11+
/// The layer that authorizes requests with the KessokuTeaTime private CI key in Base 64 format.
12+
///
13+
/// See: [`KTT_API_USERNAME`], [`KTT_API_PASSWORD`], [`AddAuthorizationLayer`]
1114
pub KESSOKU_PRIVATE_CI_AUTHORIZATION: AddAuthorizationLayer = AddAuthorizationLayer::basic(&KTT_API_USERNAME, &KTT_API_PASSWORD);
12-
r#"
13-
The layer that authorizes requests with the KessokuTeaTime private CI key in Base 64 format.
14-
15-
See: [`KTT_API_USERNAME`], [`KTT_API_PASSWORD`], [`AddAuthorizationLayer`]
16-
"#
1715
}
1816
}

0 commit comments

Comments
 (0)