mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 06:27:40 +00:00
Required the API token for every runtime API route (#1045)
This commit is contained in:
1 parent
4f966eed86
commit
8badadb35f
24 files changed
+231
-79
No files matched your search
@@ -2,7 +2,6 @@ use axum::Json;
|
||||
use log::{error, info};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use crate::api_token::APIToken;
|
||||
|
||||
/// The directory the app creates its shareable plugin archives in. Keep in sync with
|
||||
/// PluginShareService.TEMPORARY_ARCHIVE_DIRECTORY on the .NET side.
|
||||
@@ -23,7 +22,7 @@ pub struct ShareFileResponse {
|
||||
issue: String,
|
||||
}
|
||||
|
||||
pub async fn share_file(_token: APIToken, Json(request): Json<ShareFileRequest>) -> Json<ShareFileResponse> {
|
||||
pub async fn share_file(Json(request): Json<ShareFileRequest>) -> Json<ShareFileResponse> {
|
||||
let path = PathBuf::from(request.file_path.trim());
|
||||
if path.as_os_str().is_empty() {
|
||||
return failure("The file path is empty.");
|
||||
|
||||
Reference in new issue
Block a user