fix: use investigate/v2 API path for domain tools#13
Open
ymeloch wants to merge 1 commit into
Open
Conversation
investigate_domain and get_domain_categorization called the
non-existent security/v1/domains/{domain}/{risk-score,categorization}
routes, which the Cisco Secure Access API gateway rejects with
404 "no Route matched".
Per the Secure Access Investigate API, these live under the
investigate/v2 scope with the resource before the domain:
GET investigate/v2/domains/risk-score/{domain}
GET investigate/v2/domains/categorization/{domain}
Also URL-encode the domain before interpolating it into the path,
and drop the now-unused SECURITY_SCOPE constant.
Co-authored-by: Cursor <cursoragent@cursor.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
get_domain_categorizationandinvestigate_domaintools, which called non-existentsecurity/v1/domains/{domain}/...routes and always failed with404 "no Route matched".investigate/v2) and path order (resource before domain).domainargument before interpolating it into the request path, and removes the now-unusedSECURITY_SCOPEconstant.Closes #12
Details
Before:
After:
Endpoints now match the documented Investigate API:
GET https://api.sse.cisco.com/investigate/v2/domains/categorization/{domain}GET https://api.sse.cisco.com/investigate/v2/domains/risk-score/{domain}See the Cisco DevNet Investigate API overview and API changelog.
Test plan
get_domain_categorization("example.com")returns{"example.com": {"status": 0, "content_categories": ["54", "188"]}}against a live tenant (previously404).investigate_domainreturns a risk-score payload for a domain (same scope/path-order fix; requires Investigate access tier that exposes risk-score).Made with Cursor