1
0
Fork 0

Adding upstream version 0.0.22.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-08 18:41:54 +02:00
parent 2f814b513a
commit b06d3acde8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
190 changed files with 61565 additions and 0 deletions

View file

@ -0,0 +1,24 @@
use axum::{
extract::{Path, State},
response::Response,
};
use crate::{error::RdapServerError, rdap::response::ResponseUtil, server::DynServiceState};
use super::ToBootStrap;
/// Gets an autnum object by the number path.
#[axum_macros::debug_handler]
#[tracing::instrument(level = "debug")]
pub(crate) async fn autnum_by_num(
Path(as_num): Path<u32>,
state: State<DynServiceState>,
) -> Result<Response, RdapServerError> {
let storage = state.get_storage().await?;
let autnum = storage.get_autnum_by_num(as_num).await?;
Ok(if state.get_bootstrap() {
autnum.to_autnum_bootstrap(as_num).response()
} else {
autnum.response()
})
}