Bug/fix worker ai bindings#16
Conversation
… binding is set correctly
…e logo for December
…port; remove legacy API results page
…g; fix cloud provider parameter casing
…DR format and prefix length
… function and invoking it after rendering
…s, improve error handling, and update styles
🚀 PR Status Dashboard📊 Workflow Status⏳ CI: pending 🌐 Preview EnvironmentsSPA Preview: https://bug-fix-worker-ai-bindings.albatross-5kt.pages.dev 📝 PR DetailsBranch: This comment is automatically updated by the PR Update workflow |
Deploying albatross with
|
| Latest commit: |
0dda346
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://158ee26f.albatross-5kt.pages.dev |
| Branch Preview URL: | https://bug-fix-worker-ai-bindings.albatross-5kt.pages.dev |
There was a problem hiding this comment.
Pull request overview
This pull request adds cloud provider IP manifest search functionality and improves API accessibility for programmatic clients. The changes enable users to query whether an IP belongs to AWS, Azure, GCP, or Oracle infrastructure, and make the API more accessible by introducing dedicated API hostnames that bypass browser-origin authentication requirements.
Key Changes
- Cloud Provider Detection: Implements CIDR-based IP range matching against cloud provider manifests with a new
cloudproviderAPI parameter supporting AWS, Azure, GCP, Oracle, and "all" options - API Authentication Enhancement: Introduces dedicated API hostnames (
albatross-api.devnomadic.comand preview variant) that bypass HMAC/timestamp validation to support non-browser clients like curl and Postman - Interactive Documentation: Adds a new
/apiendpoint with Swagger-style interactive documentation, OpenAPI specification, and example usage
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| wwwroot/openapi.json | Adds OpenAPI 3.0 specification defining the API endpoint, parameters including the new cloudprovider parameter, and response schemas |
| wwwroot/js/json-highlight.js | Adds content sanitization before applying JSON syntax highlighting |
| wwwroot/images/ascii-text-art-christmas.png | Adds seasonal December logo image |
| wwwroot/css/api-swagger.css | Adds styling for interactive API documentation page with dark theme |
| wwwroot/css/api-json.css | Adds minimal styling for JSON-only API response rendering |
| wrangler.toml | Configures production and preview environments with dedicated API hostname routes |
| cloudflare-worker.template.js | Implements cloud manifest search, CIDR matching (IPv4/IPv6), and API hostname-based authentication bypass |
| Services/AbuseIPDBService.cs | Adds cloudProvider parameter to CheckIPAsync method and builds request URL with optional cloud provider filtering |
| Pages/Home.razor | Adds seasonal logo logic (displays Christmas logo in December) and API access documentation section |
| Pages/Api.razor | Implements interactive API documentation page with parameter inputs, live testing, and OpenAPI spec download link |
| .github/workflows/deploy-dev.yml | Updates deployment script to use preview environment configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const prefix = parseInt(parts[1], 10); | ||
|
|
||
| if (isNaN(prefix)) { | ||
| console.error('Invalid prefix length:', parts[1], 'in', cidrRange); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
The prefix length validation is incomplete. While the code checks if the prefix is NaN, it doesn't validate that the prefix is within valid ranges (0-32 for IPv4, 0-128 for IPv6). Invalid prefix lengths could lead to incorrect subnet mask calculations or unexpected behavior. For example, a negative prefix or a prefix greater than 32 for IPv4 could cause issues with the bitwise operations.
There was a problem hiding this comment.
@copilot make this change to the current branch this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@devnomadic I've opened a new pull request, #17, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Add prefix length validation for IPv4 (0-32) and IPv6 (0-128) CIDR ranges Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com> * Fix whitespace formatting in AbuseIPDBService.cs --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com> Co-authored-by: Drew Kennedy <drewkenn@gmail.com>
This pull request introduces a new feature for cloud provider IP manifest searching and enhances API usability, including improved support for programmatic access. It adds the ability to search AWS, Azure, GCP, and Oracle IP ranges for a given IP address, exposes this via the API, and updates both backend and frontend to support and document the new capability. It also refines API authentication logic to better support dedicated API hostnames and updates deployment configuration for preview environments.
Cloud Provider IP Manifest Search:
cloudproviderparameter to the backend API (CheckIPAsyncinAbuseIPDBService.cs) and the Cloudflare Worker, allowing users to search whether an IP belongs to AWS, Azure, GCP, Oracle, or all supported providers. The worker fetches and searches provider manifests, returning detailed match results in thecloudMatchesfield. [1] [2] [3] [4] [5] [6] [7] [8] [9]API Authentication and Usability Improvements:
albatross-api.devnomadic.comand preview), enabling easier access for API clients (e.g., curl, Postman). [1] [2] [3]Frontend and Documentation Updates:
These changes collectively add valuable new functionality for users who need to determine cloud provider ownership of IPs and improve the developer experience for API consumers.