Skip to content

Commit dad2f3d

Browse files
committed
fix issues with jira controller
1 parent f4a4116 commit dad2f3d

File tree

6 files changed

+25
-35
lines changed

6 files changed

+25
-35
lines changed

.local.env

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
SENTRIUS_VERSION=1.1.320
2-
SENTRIUS_SSH_VERSION=1.1.40
3-
SENTRIUS_KEYCLOAK_VERSION=1.1.52
4-
SENTRIUS_AGENT_VERSION=1.1.41
5-
SENTRIUS_AI_AGENT_VERSION=1.1.255
6-
LLMPROXY_VERSION=1.0.74
7-
LAUNCHER_VERSION=1.0.81
8-
AGENTPROXY_VERSION=1.0.74
1+
SENTRIUS_VERSION=1.1.323
2+
SENTRIUS_SSH_VERSION=1.1.41
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.53
4+
SENTRIUS_AGENT_VERSION=1.1.42
5+
SENTRIUS_AI_AGENT_VERSION=1.1.258
6+
LLMPROXY_VERSION=1.0.76
7+
LAUNCHER_VERSION=1.0.82
8+
AGENTPROXY_VERSION=1.0.75

.local.env.bak

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
SENTRIUS_VERSION=1.1.319
2-
SENTRIUS_SSH_VERSION=1.1.40
3-
SENTRIUS_KEYCLOAK_VERSION=1.1.52
4-
SENTRIUS_AGENT_VERSION=1.1.41
5-
SENTRIUS_AI_AGENT_VERSION=1.1.254
6-
LLMPROXY_VERSION=1.0.73
7-
LAUNCHER_VERSION=1.0.81
8-
AGENTPROXY_VERSION=1.0.74
1+
SENTRIUS_VERSION=1.1.323
2+
SENTRIUS_SSH_VERSION=1.1.41
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.53
4+
SENTRIUS_AGENT_VERSION=1.1.42
5+
SENTRIUS_AI_AGENT_VERSION=1.1.258
6+
LLMPROXY_VERSION=1.0.76
7+
LAUNCHER_VERSION=1.0.82
8+
AGENTPROXY_VERSION=1.0.75

ai-agent/src/main/java/io/sentrius/agent/analysis/agents/agents/VerbRegistry.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io.sentrius.sso.core.services.agents.ZeroTrustClientService;
1818
import io.sentrius.sso.core.services.capabilities.EndpointScanningService;
1919
import io.sentrius.sso.core.utils.JsonUtil;
20+
import io.sentrius.sso.genai.Message;
2021
import lombok.RequiredArgsConstructor;
2122
import lombok.extern.slf4j.Slf4j;
2223
import org.springframework.context.ApplicationContext;
@@ -236,6 +237,7 @@ public VerbResponse execute(AgentExecution agentExecution,
236237
} catch (Exception e) {
237238
log.info(method.getName() + " failed", e);
238239
e.printStackTrace();
240+
contextDTO.addMessages(Message.builder().role("system").content("Previous request failed: " + e.getMessage()).build());
239241
throw new RuntimeException("Failed to execute verb: " + verb, e);
240242
}
241243
}

ai-agent/src/main/java/io/sentrius/agent/analysis/agents/verbs/TerminalVerbs.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public TerminalVerbs(ZeroTrustClientService zeroTrustClientService, LLMService l
5050
/**
5151
* Retrieves a list of currently open terminals.
5252
*
53-
* @param args A map of arguments for the operation (currently unused).
53+
5454
* @return An `ArrayNode` containing the list of open terminals.
5555
* @throws ZtatException If there is an error during the operation.
5656
*/
5757
@Verb(name = "list_open_terminals", description = "Retrieves a list of currently open terminals.",
5858
requiresTokenManagement = true)
59-
public ArrayNode listTerminals(TokenDTO token, Map<String, Object> args) throws ZtatException {
59+
public ArrayNode listTerminals(TokenDTO token, AgentExecutionContextDTO execution) throws ZtatException {
6060
try {
6161
String response = zeroTrustClientService.callGetOnApi(token, "/ssh/terminal/list/all");
6262
if (response == null) {
@@ -72,13 +72,12 @@ public ArrayNode listTerminals(TokenDTO token, Map<String, Object> args) throws
7272
/**
7373
* Retrieves a list of currently open terminals.
7474
*
75-
* @param args A map of arguments for the operation (currently unused).
7675
* @return An `ArrayNode` containing the list of open terminals.
7776
* @throws ZtatException If there is an error during the operation.
7877
*/
7978
@Verb(name = "list_systems", description = "Retrieves a list of available systems. These are not connected " +
80-
"sessions.", requiresTokenManagement = true)
81-
public List<HostSystemDTO> listSystem(AgentExecution execution, Map<String, Object> args) throws ZtatException {
79+
"sessions.", returnName = "systems", requiresTokenManagement = true)
80+
public List<HostSystemDTO> listSystem(AgentExecution execution, AgentExecutionContextDTO dto) throws ZtatException {
8281
try {
8382
List<HostSystemDTO> response = zeroTrustClientService.callGetOnApi(execution, "/api/v1/enclaves/hosts/list/all");
8483

ai-agent/src/test/java/io/sentrius/sentrius/analysis/agents/verbs/TerminalVerbsTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.fasterxml.jackson.databind.node.ObjectNode;
1616
import io.sentrius.agent.analysis.agents.verbs.TerminalVerbs;
1717
import io.sentrius.sso.core.dto.HostSystemDTO;
18+
import io.sentrius.sso.core.dto.agents.AgentExecutionContextDTO;
1819
import io.sentrius.sso.core.exceptions.ZtatException;
1920
import io.sentrius.sso.core.services.agents.LLMService;
2021
import io.sentrius.sso.core.services.agents.ZeroTrustClientService;
@@ -42,7 +43,7 @@ void listTerminalsReturnsArrayNodeWhenApiCallSucceeds() throws Exception, ZtatEx
4243
String mockResponse = "[{\"id\":1,\"name\":\"Terminal1\"},{\"id\":2,\"name\":\"Terminal2\"}]";
4344

4445
when(zeroTrustClientService.callGetOnApi(isNull(), "/ssh/terminal/list/all")).thenReturn(mockResponse);
45-
ArrayNode result = terminalVerbs.listTerminals(null, new HashMap<>());
46+
ArrayNode result = terminalVerbs.listTerminals(null, AgentExecutionContextDTO.builder().build());
4647

4748
assertNotNull(result);
4849
assertEquals(2, result.size());
@@ -53,7 +54,7 @@ void listTerminalsReturnsArrayNodeWhenApiCallSucceeds() throws Exception, ZtatEx
5354
void listTerminalsThrowsRuntimeExceptionWhenApiCallFails() throws ZtatException {
5455
when(zeroTrustClientService.callGetOnApi(isNull(), "/ssh/terminal/list/all")).thenThrow(new RuntimeException("API error"));
5556

56-
assertThrows(RuntimeException.class, () -> terminalVerbs.listTerminals(null, new HashMap<>()));
57+
assertThrows(RuntimeException.class, () -> terminalVerbs.listTerminals(null, AgentExecutionContextDTO.builder().build()));
5758
}
5859

5960
// @Test

integration-proxy/src/main/java/io/sentrius/sso/controllers/api/JiraProxyController.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import io.sentrius.sso.core.integrations.ticketing.JiraService;
1717
import io.sentrius.sso.core.model.security.IntegrationSecurityToken;
1818
import io.sentrius.sso.core.model.security.enums.ApplicationAccessEnum;
19-
import io.sentrius.sso.core.model.verbs.Verb;
2019
import io.sentrius.sso.core.services.ErrorOutputService;
2120
import io.sentrius.sso.core.services.UserService;
2221
import io.sentrius.sso.core.services.security.IntegrationSecurityTokenService;
@@ -61,12 +60,6 @@ protected JiraProxyController(
6160

6261
@GetMapping("/rest/api/3/search")
6362
@LimitAccess(applicationAccess = {ApplicationAccessEnum.CAN_LOG_IN})
64-
@Verb( name="search_jira",
65-
description="Search for JIRA tickets using JQL or query parameters",
66-
paramDescriptions = {
67-
"jql - JIRA Query Language string to search for tickets",
68-
"query - Alternative search query string",
69-
}, requiresTokenManagement = true)
7063
public ResponseEntity<?> searchForJiraIssue(
7164
@RequestHeader("Authorization") String token,
7265
@RequestParam(value = "jql", required = false) String jql,
@@ -123,11 +116,6 @@ public ResponseEntity<?> searchForJiraIssue(
123116
}
124117

125118
@GetMapping("/rest/api/3/issue")
126-
@Verb( name="retrieve_jira_issue",
127-
description="Retrieves jira issue by key",
128-
paramDescriptions = {
129-
"issueKey - issue key to retrieve",
130-
}, requiresTokenManagement = true)
131119
@LimitAccess(applicationAccess = {ApplicationAccessEnum.CAN_LOG_IN})
132120
public ResponseEntity<?> getJiraIssue(
133121
@RequestHeader("Authorization") String token,

0 commit comments

Comments
 (0)