refactor!: setup file proxy for projects

This commit is contained in:
2026-01-20 19:10:01 -08:00
parent 5eccfe32da
commit a2afc3fa05
17 changed files with 279 additions and 103 deletions

View File

@@ -4,13 +4,19 @@ use crate::AppState;
use crate::error::{Error, Result};
use crate::user::RepositorySchema;
pub async fn validate_repo(app_state: web::Data<AppState>, repo: &RepositorySchema) -> Result<()> {
pub async fn validate_repo(
app_state: web::Data<AppState>,
repo: &RepositorySchema,
user_id: &str,
) -> Result<()> {
let token = app_state.user.get_access_token(&user_id).await?;
let response = app_state
.reqwest_client
.get(format!(
"https://raw.githubusercontent.com/{}/HEAD/dist/index.html",
repo.full_name
))
.bearer_auth(token)
.send()
.await?;