Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target/
redoc-static.html
doc/
openapi.yaml
30 changes: 25 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ resolver = "2"
edition = "2021"
version = "0.1.0"
rust-version = "1.81"
description = "Basalt competition server runtime"
license = "GPL-3.0-only"

[workspace.dependencies]
anyhow = "1.0.95"
Expand Down Expand Up @@ -48,4 +50,9 @@ tower-http = { version = "0.6.2", features = ["cors", "trace", "fs"] }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
tracing = { version = "0.1.41", features = ["release_max_level_debug"] }
utoipa-axum = { version = "0.2.0", features = ["debug"] }
utoipa = { version = "5.3.1", features = ["chrono", "debug", "yaml"] }
utoipa = { version = "5.4.0", features = [
"chrono",
"debug",
"yaml",
"axum_extras",
] }
4 changes: 2 additions & 2 deletions basalt-server-lib/src/services/announcements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ pub async fn new(
)]
pub async fn delete(
State(state): State<Arc<AppState>>,
Path(id): Path<AnnouncementId>,
HostUser(_): HostUser,
HostUser(_u): HostUser,
Path((id,)): Path<(AnnouncementId,)>,
) -> Result<Json<Announcement>, StatusCode> {
let sql = state.db.read().await;

Expand Down
2 changes: 1 addition & 1 deletion basalt-server-lib/src/services/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async fn patch_clock(
)
)]
async fn get_clock(
OptionalUser(_): OptionalUser,
OptionalUser(_u): OptionalUser,
State(state): State<Arc<AppState>>,
) -> Result<Json<ClockStatusResponse>, StatusCode> {
trace!("user getting clock");
Expand Down
7 changes: 4 additions & 3 deletions basalt-server-lib/src/services/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,24 @@ pub async fn get_submissions_state(
}

#[derive(Deserialize, IntoParams)]
pub struct SubmissionsParams {
#[into_params(parameter_in = Query)]
pub struct SubmissionsQueryParams {
user_id: Option<UserId>,
question_index: usize,
}

#[axum::debug_handler]
#[utoipa::path(
get, path = "/submissions", tag = "testing",
params(SubmissionsParams),
params(SubmissionsQueryParams),
responses(
(status = OK, body = Vec<SubmissionHistory>, content_type = "application/json"),
(status = 403, description = "User does not have permission to view the submissions for this user"),
)
)]
pub async fn get_submissions(
user: User,
params: Query<SubmissionsParams>,
params: Query<SubmissionsQueryParams>,
State(state): State<Arc<AppState>>,
) -> Result<Json<Vec<SubmissionHistory>>, StatusCode> {
let user_id = params.user_id.as_ref().unwrap_or(&user.id);
Expand Down
1 change: 1 addition & 0 deletions basalt-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "basalt-server"
edition.workspace = true
version.workspace = true
rust-version.workspace = true
description = "Basalt server competition runtime"

[features]
doc-gen = []
Expand Down
Loading
Loading