Skip to content

Refactor: axum based API migration - #2339

Merged
tsurai merged 1 commit into
mainfrom
axum-migration
Oct 6, 2026
Merged

tsurai merged 1 commit into
mainfrom
axum-migration

Conversation

@tsurai

@tsurai tsurai commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the old HTTP API with one based on axum for better maintainability. While this does require rather major refactoring within openvasd the changes are kept minimal to keep the PR scope reviewable. This leads to some awkward code that will be refactored in follow up PRs.

Behavioral changes

  • Routes that accept a JSON encoded payload MUST set Content-Type: application/json.
  • HEAD routes are now RFC compliant, meaning they do the same as their GET counterpart but with the result body removed.
  • Routes with a trailing / are considered a separate route now, resulting in 404s.
  • The enable-get-scans option under [endpoints] was previously ignored, defaulting to true. It's working properly now and defaults to false as documented.

Jira: SC-1610

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 7ec89c4.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
cargo/arc-swap 1.9.2 🟢 3
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Code-Review⚠️ 2Found 5/18 approved changesets -- score normalized to 2
Maintained⚠️ 00 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/axum 0.8.9 🟢 5.5
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/axum-core 0.5.6 🟢 5.5
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/axum-macros 0.5.1 🟢 5.5
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/axum-server 0.8.0 🟢 3.2
Details
CheckScoreReason
Code-Review🟢 4Found 6/15 approved changesets -- score normalized to 4
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/fs-err 3.3.1 🟢 3.9
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 4Found 13/30 approved changesets -- score normalized to 4
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/matchit 0.8.4 🟢 4.9
Details
CheckScoreReason
Code-Review🟢 4Found 13/29 approved changesets -- score normalized to 4
Binary-Artifacts🟢 10no binaries found in the repo
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing🟢 10project is fuzzed
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/serde_path_to_error 0.1.20 🟢 4
Details
CheckScoreReason
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review⚠️ 0Found 0/26 approved changesets -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy🟢 3security policy file detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/tower >= 0.5.3, < 0.6.0 UnknownUnknown
cargo/tower-service >= 0.3.3, < 0.4.0 UnknownUnknown

Scanned Files

  • rust/Cargo.lock
  • rust/Cargo.toml

@tsurai
tsurai force-pushed the axum-migration branch 7 times, most recently from a65a12a to 0b3fff9 Compare August 13, 2026 13:35
@tsurai
tsurai force-pushed the axum-migration branch 11 times, most recently from 569d882 to a923185 Compare August 24, 2026 10:58
@tsurai
tsurai force-pushed the axum-migration branch 2 times, most recently from 1969d60 to 3cd2f6c Compare August 26, 2026 06:34
@tsurai
tsurai marked this pull request as ready for review August 26, 2026 07:27
@tsurai
tsurai requested a review from a team as a code owner August 26, 2026 07:27
@tsurai
tsurai force-pushed the axum-migration branch 2 times, most recently from 415005e to 3871be7 Compare August 31, 2026 13:57

@tehforsch tehforsch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

I have some initial comments just from looking at the code. I'll also look at the larger structure a little bit now, but if anything comes up I'll do it in a second review

Comment thread rust/src/openvasd/api/response/mod.rs Outdated
Comment thread rust/src/openvasd/api/response/mod.rs Outdated
Comment thread rust/src/openvasd/api/response/mod.rs Outdated
Comment thread rust/src/openvasd/api/response/mod.rs Outdated
Comment thread rust/src/openvasd/api/routes/notus.rs Outdated
Comment thread rust/src/openvasd/api_tests/mod.rs
Comment thread rust/src/openvasd/config/mod.rs
Comment thread rust/src/openvasd/container_image_scanner/mod.rs
Comment thread rust/src/openvasd/scans/mod.rs
Comment thread rust/src/openvasd/scans/mod.rs
Comment thread rust/src/openvasd/api/mod.rs
Comment thread rust/src/openvasd/api/routes/vts.rs Outdated
Comment thread rust/src/openvasd/api/routes/container_image_scanner.rs
Comment thread rust/src/openvasd/api/routes/scans.rs Outdated
Comment thread rust/src/openvasd/api/error.rs
Comment thread rust/src/openvasd/api/routes/notus.rs Outdated
Comment thread rust/src/openvasd/api/auth.rs Outdated
@tsurai
tsurai force-pushed the axum-migration branch 2 times, most recently from 46e2a6d to be7cb3e Compare September 15, 2026 11:31
@tsurai
tsurai force-pushed the axum-migration branch 2 times, most recently from 7af7250 to 139742e Compare September 25, 2026 08:10
@jjnicola jjnicola mentioned this pull request Sep 28, 2026
@tehforsch tehforsch added the waiting_upstream Waiting on a feature or fix in dependencies before this can be merged label Sep 29, 2026
@github-actions github-actions Bot added waiting_upstream Waiting on a feature or fix in dependencies before this can be merged and removed waiting_upstream Waiting on a feature or fix in dependencies before this can be merged labels Oct 2, 2026
@tsurai
tsurai added this pull request to stack #2386 October 2, 2026 12:11
@ArnoStiefvater
ArnoStiefvater self-requested a review October 6, 2026 12:21
@ArnoStiefvater
ArnoStiefvater dismissed their stale review October 6, 2026 12:22

Dismissed review because it was just a blocker review.

tehforsch
tehforsch previously approved these changes Oct 6, 2026
@github-actions github-actions Bot added waiting_upstream Waiting on a feature or fix in dependencies before this can be merged and removed waiting_upstream Waiting on a feature or fix in dependencies before this can be merged labels Oct 6, 2026
@github-actions github-actions Bot added waiting_upstream Waiting on a feature or fix in dependencies before this can be merged and removed waiting_upstream Waiting on a feature or fix in dependencies before this can be merged labels Oct 6, 2026
@github-actions github-actions Bot added waiting_upstream Waiting on a feature or fix in dependencies before this can be merged and removed waiting_upstream Waiting on a feature or fix in dependencies before this can be merged labels Oct 6, 2026
@tsurai
tsurai added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit d78b9bf Oct 6, 2026
19 checks passed
@tsurai
tsurai deleted the axum-migration branch October 6, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting_upstream Waiting on a feature or fix in dependencies before this can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants