@@ -75,7 +75,14 @@ async def reload_repo(
75
75
76
76
77
77
@router .post ("/knowledge/list" , dependencies = [Depends (verify_rate_limit )])
78
- async def get_knowledge_list (params : PageParams [Knowledge ]):
78
+ async def get_knowledge_list (
79
+ params : PageParams [Knowledge ],
80
+ user : Annotated [User | None , Depends (get_user )] = None ,
81
+ ):
82
+ if user is None :
83
+ raise HTTPException (
84
+ status_code = status .HTTP_401_UNAUTHORIZED , detail = "Github Login needed"
85
+ )
79
86
try :
80
87
api_client = APIClient (
81
88
base_url = get_env_variable ("WHISKER_API_URL" ),
@@ -101,7 +108,14 @@ async def get_chunk_list(params: PageParams[Chunk]):
101
108
102
109
103
110
@router .post ("/task/list" , dependencies = [Depends (verify_rate_limit )])
104
- async def get_rag_task (params : PageParams [Task ]):
111
+ async def get_rag_task (
112
+ params : PageParams [Task ],
113
+ user : Annotated [User | None , Depends (get_user )] = None ,
114
+ ):
115
+ if user is None :
116
+ raise HTTPException (
117
+ status_code = status .HTTP_401_UNAUTHORIZED , detail = "Github Login needed"
118
+ )
105
119
try :
106
120
api_client = APIClient (
107
121
base_url = get_env_variable ("WHISKER_API_URL" ),
@@ -114,7 +128,14 @@ async def get_rag_task(params: PageParams[Task]):
114
128
115
129
116
130
@router .post ("/task/restart" , dependencies = [Depends (verify_rate_limit )])
117
- async def restart_rag_task (params : RestartTaskRequest ):
131
+ async def restart_rag_task (
132
+ params : RestartTaskRequest ,
133
+ user : Annotated [User | None , Depends (get_user )] = None ,
134
+ ):
135
+ if user is None :
136
+ raise HTTPException (
137
+ status_code = status .HTTP_401_UNAUTHORIZED , detail = "Github Login needed"
138
+ )
118
139
try :
119
140
api_client = APIClient (
120
141
base_url = get_env_variable ("WHISKER_API_URL" ),
0 commit comments