route permission change

This commit is contained in:
Paul Zinselmeyer 2023-12-19 12:13:48 +01:00
parent 29c0fdc1ee
commit 2cc33cc3e8
1 changed files with 6 additions and 8 deletions

View File

@ -7,7 +7,7 @@ use duration_str::{deserialize_option_duration, parse_std};
use jwt::JwtApplication;
use prometheus_client::{
encoding::EncodeLabelSet,
metrics::{counter::Counter, family::Family, gauge::Gauge, histogram::Histogram},
metrics::{counter::Counter, family::Family, gauge::Gauge},
registry::{Registry, Unit},
};
use sailfish::TemplateOnce;
@ -15,7 +15,7 @@ use std::{
borrow::Borrow,
env,
str::FromStr,
sync::{atomic::AtomicU64, Arc},
sync::Arc,
time::{Duration, SystemTime, UNIX_EPOCH},
};
use tower_http::services::ServeDir;
@ -25,8 +25,7 @@ use tower_sessions::{cookie::SameSite, MemoryStore, SessionManagerLayer};
use axum::{
async_trait,
body::{Body, HttpBody},
debug_handler,
body::Body,
error_handling::HandleErrorLayer,
extract::{FromRef, FromRequest, Multipart, Path, Query, State},
http::{
@ -34,11 +33,10 @@ use axum::{
HeaderMap, HeaderValue, Request, StatusCode, Uri,
},
response::{Html, IntoResponse, Redirect, Response},
routing::{get, post},
routing::{delete, get, post},
BoxError, Router,
};
use bytes::Bytes;
use chacha20::{
cipher::{KeyIvInit, StreamCipher},
ChaCha20,
@ -210,10 +208,10 @@ async fn main() {
let app = Router::new()
.route("/", get(get_index))
.route("/:id", post(upload_bin).put(upload_bin).delete(delete_bin))
.route("/:id", delete(delete_bin))
.route("/:id/delete", get(delete_bin_interactive).post(delete_bin))
.layer(oidc_login_service)
.route("/:id", get(get_item))
.route("/:id", get(get_item).post(upload_bin).put(upload_bin))
.route("/metrics", get(metrics))
.nest_service("/static", ServeDir::new("static"))
.with_state(state)