-
Notifications
You must be signed in to change notification settings - Fork 5
AIML-189: Remove duplicate app_name/app_id tool variants to optimize AI context usage #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,11 @@ public class SCAService { | |
| private String httpProxyPort; | ||
|
|
||
|
|
||
| @Tool(name = "list_application_libraries_by_app_id", description = "Takes a application ID and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used") | ||
| @Tool(name = "list_application_libraries", description = "Takes an application ID and returns the libraries used in the application. Use list_applications_with_name first to get the application ID from a name. Note: if class usage count is 0 the library is unlikely to be used") | ||
| public List<LibraryExtended> getApplicationLibrariesByID(String appID) throws IOException { | ||
| if (appID == null || appID.isEmpty()) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for future downstream changes....
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its on my list. Sounds like a helpful library.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also for your other tech debt cleanup tickets, lets replace to
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to the list.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a story to use lombok everywhere. I only used it in a few places for that first pr. We need to adopt it full on now. |
||
| throw new IllegalArgumentException("Application ID cannot be null or empty"); | ||
| } | ||
| logger.info("Retrieving libraries for application id: {}", appID); | ||
| ContrastSDK contrastSDK = SDKHelper.getSDK(hostName, apiKey, serviceKey, userName,httpProxyHost, httpProxyPort); | ||
| logger.debug("ContrastSDK initialized with host: {}", hostName); | ||
|
|
@@ -73,25 +76,6 @@ public List<LibraryExtended> getApplicationLibrariesByID(String appID) throws IO | |
|
|
||
| } | ||
|
|
||
|
|
||
| @Tool(name = "list_application_libraries", description = "takes a application name and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used") | ||
| public List<LibraryExtended> getApplicationLibraries(String app_name) throws IOException { | ||
| logger.info("Retrieving libraries for application: {}", app_name); | ||
| ContrastSDK contrastSDK = SDKHelper.getSDK(hostName, apiKey, serviceKey, userName,httpProxyHost, httpProxyPort); | ||
| logger.debug("ContrastSDK initialized with host: {}", hostName); | ||
|
|
||
| SDKExtension extendedSDK = new SDKExtension(contrastSDK); | ||
| logger.debug("Searching for application ID matching name: {}", app_name); | ||
|
|
||
| Optional<Application> application = SDKHelper.getApplicationByName(app_name, orgID, contrastSDK); | ||
| if(application.isPresent()) { | ||
| return SDKHelper.getLibsForID(application.get().getAppId(),orgID, extendedSDK); | ||
| } else { | ||
| logger.error("Application not found: {}", app_name); | ||
| throw new IOException("Application not found"); | ||
| } | ||
| } | ||
|
|
||
| @Tool(name= "list_applications_vulnerable_to_cve", description = "takes a cve id and returns the applications and servers vulnerable to the cve. Please note if the application class usage is 0, its unlikely to be vulnerable") | ||
| public CveData listCVESForApplication(String cveid) throws IOException { | ||
| logger.info("Retrieving applications vulnerable to CVE: {}", cveid); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.