Skip to content

Bug/fix worker ai bindings#16

Merged
devnomadic merged 23 commits into
mainfrom
bug/fix-worker-ai-bindings
Dec 28, 2025
Merged

Bug/fix worker ai bindings#16
devnomadic merged 23 commits into
mainfrom
bug/fix-worker-ai-bindings

Conversation

@devnomadic

Copy link
Copy Markdown
Owner

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:

  • Adds a new cloudprovider parameter to the backend API (CheckIPAsync in AbuseIPDBService.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 the cloudMatches field. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Implements robust CIDR matching for both IPv4 and IPv6 addresses to support accurate manifest searches.

API Authentication and Usability Improvements:

  • Updates the Cloudflare Worker to bypass browser-origin and HMAC/timestamp validation for requests made to dedicated API hostnames (albatross-api.devnomadic.com and preview), enabling easier access for API clients (e.g., curl, Postman). [1] [2] [3]
  • Updates deployment scripts and configuration to support the preview environment and dedicated API routes for both production and preview. [1] [2]

Frontend and Documentation Updates:

  • Updates the homepage to display a seasonal logo in December and adds a new section highlighting API access, including a link to interactive documentation and OpenAPI spec. [1] [2]

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.

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown

🚀 PR Status Dashboard

📊 Workflow Status

CI: pending
Deploy: success (view)

🌐 Preview Environments

SPA Preview: https://bug-fix-worker-ai-bindings.albatross-5kt.pages.dev
Worker Preview: https://abuseipdb-preview.devnomadic.workers.dev

📝 PR Details

Branch: bug/fix-worker-ai-bindings
Commit: 0dda3469
Author: @devnomadic
Target: main
Last Updated: 2025-12-28T10:45:58.707Z


This comment is automatically updated by the PR Update workflow

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 28, 2025

Copy link
Copy Markdown

Deploying albatross with  Cloudflare Pages  Cloudflare Pages

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

View logs

@devnomadic devnomadic requested a review from Copilot December 28, 2025 08:27
@devnomadic devnomadic added the enhancement New feature or request label Dec 28, 2025
This was linked to issues Dec 28, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 cloudprovider API parameter supporting AWS, Azure, GCP, Oracle, and "all" options
  • API Authentication Enhancement: Introduces dedicated API hostnames (albatross-api.devnomadic.com and preview variant) that bypass HMAC/timestamp validation to support non-browser clients like curl and Postman
  • Interactive Documentation: Adds a new /api endpoint 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.

Comment thread Pages/Api.razor
Comment on lines +960 to +965
const prefix = parseInt(parts[1], 10);

if (isNaN(prefix)) {
console.error('Invalid prefix length:', parts[1], 'in', cidrRange);
return false;
}

Copilot AI Dec 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make this change to the current branch this feedback

Comment thread wwwroot/js/json-highlight.js Outdated
Comment thread wwwroot/openapi.json Outdated
Comment thread cloudflare-worker.template.js Outdated
Comment thread cloudflare-worker.template.js Outdated
Comment thread cloudflare-worker.template.js Outdated
Comment thread cloudflare-worker.template.js Outdated
Comment thread Pages/Api.razor
Comment thread Pages/Api.razor
devnomadic and others added 7 commits December 28, 2025 20:00
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>

Copilot AI commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@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>
@devnomadic devnomadic merged commit 843dafe into main Dec 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API Support Automate Cloudflare Worker Bindings

3 participants