-
Notifications
You must be signed in to change notification settings - Fork 2
Add Field descriptions #6
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -340,7 +340,9 @@ def process_repo(owner, repo): | |||||
| return f"{owner}/{repo}".lower() | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_component(owner: str, repo: str, location: str = Field(description="The directory of the component"), | ||||||
| def store_new_component(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component"), | ||||||
| is_app: bool = Field(description="Is this an application", default=None), | ||||||
| is_library: bool = Field(description="Is this a library", default=None), | ||||||
| notes: str = Field(description="The notes taken for this component", default="")): | ||||||
|
|
@@ -350,7 +352,9 @@ def store_new_component(owner: str, repo: str, location: str = Field(description | |||||
| return backend.store_new_application(process_repo(owner, repo), location, is_app, is_library, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def add_component_notes(owner: str, repo: str, location: str = Field(description="The directory of the component", default=None), | ||||||
| def add_component_notes(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component", default=None), | ||||||
| notes: str = Field(description="New notes taken for this component", default="")): | ||||||
| """ | ||||||
| Add new notes to a component | ||||||
|
|
@@ -362,7 +366,9 @@ def add_component_notes(owner: str, repo: str, location: str = Field(description | |||||
| return backend.store_new_application(repo, location, None, None, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_entry_point(owner: str, repo: str, location: str = Field(description="The directory of the component where the entry point belonged to"), | ||||||
| def store_new_entry_point(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component where the entry point belonged to"), | ||||||
| file: str = Field(description="The file that contains the entry point"), | ||||||
| line: int = Field(description="The file line that contains the entry point"), | ||||||
| user_input: str = Field(description="The variables that are considered as user input"), | ||||||
|
|
@@ -377,16 +383,23 @@ def store_new_entry_point(owner: str, repo: str, location: str = Field(descripti | |||||
| return backend.store_new_entry_point(repo, app.id, file, user_input, line, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_component_issue(owner: str, repo: str, component_id: int, | ||||||
| issue_type: str, notes: str): | ||||||
| def store_new_component_issue(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component"), | ||||||
| issue_type: str = Field(description="The type of issue identified for the component"), | ||||||
| notes: str = Field(description="Notes describing the issue")): | ||||||
| """ | ||||||
| Stores a type of common issue for a component. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return backend.store_new_component_issue(repo, component_id, issue_type, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_audit_result(owner: str, repo: str, component_id: int, issue_type: str, issue_id: int, | ||||||
| def store_new_audit_result(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component"), | ||||||
| issue_type: str = Field(description="The type of issue being audited"), | ||||||
| issue_id: int = Field(description="The unique identifier for the issue"), | ||||||
| has_non_security_error: bool = Field(description="Set to true if there are security issues or logic error but may not be exploitable"), | ||||||
| has_vulnerability: bool = Field(description="Set to true if a security vulnerability is identified"), | ||||||
| notes: str = Field(description="The notes for the audit of this issue")): | ||||||
|
|
@@ -397,7 +410,8 @@ def store_new_audit_result(owner: str, repo: str, component_id: int, issue_type: | |||||
| return backend.store_new_audit_result(repo, component_id, issue_type, issue_id, has_non_security_error, has_vulnerability, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_web_entry_point(owner: str, repo: str, | ||||||
| def store_new_web_entry_point(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| entry_point_id: int = Field(description="The ID of the entry point this web entry point refers to"), | ||||||
| location: str = Field(description="The directory of the component where the web entry point belongs to"), | ||||||
| method: str = Field(description="HTTP method (GET, POST, etc)", default=""), | ||||||
|
|
@@ -414,7 +428,8 @@ def store_new_web_entry_point(owner: str, repo: str, | |||||
| return backend.store_new_web_entry_point(process_repo(owner, repo), entry_point_id, method, path, component, auth, middleware, roles_scopes, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def add_entry_point_notes(owner: str, repo: str, | ||||||
| def add_entry_point_notes(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component where the entry point belonged to"), | ||||||
| file: str = Field(description="The file that contains the entry point"), | ||||||
| line: int = Field(description="The file line that contains the entry point"), | ||||||
|
|
@@ -430,7 +445,9 @@ def add_entry_point_notes(owner: str, repo: str, | |||||
|
|
||||||
|
|
||||||
| @mcp.tool() | ||||||
| def store_new_user_action(owner: str, repo: str, location: str = Field(description="The directory of the component where the user action belonged to"), | ||||||
| def store_new_user_action(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component where the user action belonged to"), | ||||||
| file: str = Field(description="The file that contains the user action"), | ||||||
| line: int = Field(description="The file line that contains the user action"), | ||||||
| notes: str = Field(description="New notes for this user action", default = "")): | ||||||
|
|
@@ -444,7 +461,9 @@ def store_new_user_action(owner: str, repo: str, location: str = Field(descripti | |||||
| return backend.store_new_user_action(repo, app.id, file, line, notes) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def add_user_action_notes(owner: str, repo: str, location: str = Field(description="The directory of the component where the user action belonged to"), | ||||||
| def add_user_action_notes(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component where the user action belonged to"), | ||||||
| file: str = Field(description="The file that contains the user action"), | ||||||
| line: str = Field(description="The file line that contains the user action"), | ||||||
| notes: str = Field(description="The notes for user action", default = "")): | ||||||
|
|
@@ -455,7 +474,9 @@ def add_user_action_notes(owner: str, repo: str, location: str = Field(descripti | |||||
| return backend.store_new_user_action(repo, app.id, file, line, notes, True) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_component(owner: str, repo: str, location: str = Field(description="The directory of the component")): | ||||||
| def get_component(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component")): | ||||||
| """ | ||||||
| The a component from the database | ||||||
| """ | ||||||
|
|
@@ -466,127 +487,148 @@ def get_component(owner: str, repo: str, location: str = Field(description="The | |||||
| return json.dumps(app_to_dict(app)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_components(owner: str, repo: str): | ||||||
| def get_components(owner: str = Field(description="The owner of the GitHub repository"), repo: str = Field(description="The name of the GitHub repository")): | ||||||
| """ | ||||||
| Get components from the repo | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_apps(repo)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_entry_points(owner: str, repo: str, location: str = Field(description="The directory of the component")): | ||||||
| def get_entry_points(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), location: str = Field(description="The directory of the component")): | ||||||
| """ | ||||||
| Get all the entry points of a component. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_app_entries(repo, location)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_entry_points_for_repo(owner: str, repo: str): | ||||||
| def get_entry_points_for_repo(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository")): | ||||||
| """ | ||||||
| Get all entry points of an repo | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_app_entries_for_repo(repo)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_web_entry_points_component(owner: str, repo: str, component_id: int): | ||||||
| def get_web_entry_points_component(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component")): | ||||||
| """ | ||||||
| Get all web entry points for a component | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_web_entries(repo, component_id)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_web_entry_points_for_repo(owner: str, repo: str): | ||||||
| def get_web_entry_points_for_repo(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository")): | ||||||
| """ | ||||||
| Get all web entry points of an repo | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_web_entries_for_repo(repo)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_user_actions(owner: str, repo: str, location: str = Field(description="The directory of the component")): | ||||||
| def get_user_actions(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| location: str = Field(description="The directory of the component")): | ||||||
| """ | ||||||
| Get all the user actions in a component. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_user_actions(repo, location)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_user_actions_for_repo(owner: str, repo: str): | ||||||
| def get_user_actions_for_repo(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository")): | ||||||
| """ | ||||||
| Get all the user actions in a repo. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_user_actions_for_repo(repo)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_component_issues(owner: str, repo: str, component_id: int): | ||||||
| def get_component_issues(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component")): | ||||||
| """ | ||||||
| Get issues for the component. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_app_issues(repo, component_id)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_component_results(owner: str, repo: str, component_id: int): | ||||||
| def get_component_results(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component")): | ||||||
| """ | ||||||
| Get audit results for the component. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_app_audit_results(repo, component_id, None, None)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_component_vulnerable_results(owner: str, repo: str, component_id: int): | ||||||
| def get_component_vulnerable_results(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
| repo: str = Field(description="The name of the GitHub repository"), | ||||||
| component_id: int = Field(description="The id of a given component")): | ||||||
| """ | ||||||
| Get audit results for the component that are audited as vulnerable. | ||||||
| """ | ||||||
| repo = process_repo(owner, repo) | ||||||
| return json.dumps(backend.get_app_audit_results(repo, component_id, has_non_security_error = None, has_vulnerability = True)) | ||||||
|
|
||||||
| @mcp.tool() | ||||||
| def get_component_potential_results(owner: str, repo: str, component_id: int): | ||||||
| def get_component_potential_results(owner: str = Field(description="The owner of the GitHub repository"), | ||||||
|
||||||
| def get_component_potential_results(owner: str = Field(description="The owner of the GitHub repository"), | |
| def get_component_potential_results(owner: str = Field(description="The owner of the GitHub repository"), |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
locationparameter should be on a new line for consistency with the formatting pattern used throughout the rest of the file. Each parameter should be on its own line when a function signature spans multiple lines.