feat: enforce DDS token access through common grants
This commit is contained in:
@@ -72,6 +72,23 @@ public class DdsVectorKnowledgeController {
|
||||
return "fragments/dds-vector-search-result :: result";
|
||||
}
|
||||
|
||||
@PostMapping("/vector-knowledge/token-search")
|
||||
public String tokenSearch(
|
||||
@RequestParam String bearerToken,
|
||||
@RequestParam String query,
|
||||
@RequestParam(defaultValue = "10") int limit,
|
||||
@RequestParam(defaultValue = "DEMO") String embeddingMode,
|
||||
Model model
|
||||
) {
|
||||
try {
|
||||
model.addAttribute("searchResult",
|
||||
service.searchByToken(bearerToken, query, limit, embeddingMode));
|
||||
} catch (AppException | IllegalArgumentException exception) {
|
||||
model.addAttribute("errorMessage", exception.getMessage());
|
||||
}
|
||||
return "fragments/dds-vector-search-result :: result";
|
||||
}
|
||||
|
||||
private void populatePage(Model model) {
|
||||
try {
|
||||
model.addAttribute("summary", service.summary());
|
||||
|
||||
Reference in New Issue
Block a user