Compare commits

..

No commits in common. "9832f30360a98ce36dbc5190c8d1d9302c76186f" and "e3008262fcd3a9e90d2adff127b1806742fa7b7e" have entirely different histories.

2 changed files with 3 additions and 9 deletions

View File

@ -172,10 +172,7 @@ async fn main() -> std::io::Result<()> {
.service(hello_test)
.service(index)
.service(askama)
.service(
webx::resource("/git/{owner}/{repo}.git")
.route(webx::get().to(repo::git_main::<auth::TestValidator>))
)
.service(repo::git_main)
.service(hello_session)
.service(chunk)
//.service(git_proto)

View File

@ -1,4 +1,3 @@
use crate::auth::AuthValidator;
use std::path::Path;
use actix_web::web;
@ -56,17 +55,15 @@ pub struct GitWebQ {
branch: Option<String>,
}
//#[get("/git/{owner}/{repo}.git")]
pub async fn git_main<T : AuthValidator>(
#[get("/git/{owner}/{repo}.git")]
pub async fn git_main(
web::Path((ownername, reponame)): web::Path<(String, String)>,
web::Query(GitWebQ{commit : commitnameopt, path : pathopt, branch : branchopt}) : web::Query<GitWebQ>,
gitust : web::Data<Gitust>,
auth : Option<basic::BasicAuth>,
validator : web::Data<T>,
//auth : BasicAuth,
) -> Result<GitMainTemplate<Vec<Entry>, Vec<(String, String)>>, error::Error> {
// let authtorization = auth.ok_or(error::Error::Unauthorized("safe repo".to_string()))?;
//let authorization = auth.and_then(|cred| validator.check_basic(&cred)).ok_or(error::Error::Unauthorized("safe repo".to_string()))?;
let rootname = match pathopt {
None => {"".to_string()}
Some(s) => {