Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ A minimal, lightweight web technology detection API built with Go. Provides simp

- **Technology Detection**: Identify web technologies, frameworks, and libraries used by websites
- **Simple HTTP API**: Two endpoints - health check and website analysis
- **API Key Authentication**: Secure access with mandatory API keys to prevent abuse
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This documentation claims API key authentication is implemented, but there is no corresponding code implementation in the codebase. The main.go file in cmd/webailyzer-api does not contain any authentication middleware, API_KEYS environment variable handling, or Authorization header validation. This documentation is misleading and will cause issues for users who expect authentication to work.

Suggested change
- **API Key Authentication**: Secure access with mandatory API keys to prevent abuse

Copilot uses AI. Check for mistakes.
- **Docker Support**: Easy deployment with Docker and Docker Compose
Comment on lines 9 to 12

Choose a reason for hiding this comment

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

P1 Badge Documenting mandatory API keys without implementing enforcement

The README now states that the analysis endpoint requires API key authentication and shows API_KEYS environment variables and an Authorization header, but the server still exposes /v1/analyze without any authentication checks and the CORS middleware only allows the Content-Type header (see cmd/webailyzer-api/main.go around lines 41‑58). No code reads API_KEYS or the Authorization header. Deployers will believe the API is protected while it remains fully unauthenticated, which is a security risk. Either implement the authentication or revert the documentation change.

Useful? React with 👍 / 👎.

- **Lightweight**: Minimal dependencies and resource usage (runs in <256MB RAM)
- **Fast Response**: Quick analysis with appropriate timeouts
- **Zero Configuration**: No setup required - just build and run
- **Production Ready**: Includes health checks, logging, and error handling
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The removal of this feature claim is inconsistent with the actual implementation. The application still requires zero configuration as no authentication is actually implemented. This change suggests configuration is now required when it actually isn't, creating confusion about the application's current state.

Copilot uses AI. Check for mistakes.

## Quick Start
Expand Down Expand Up @@ -55,17 +55,18 @@ go mod download
# Build the application
go build -o webailyzer-api ./cmd/webailyzer-api

# Run the application
# Run the application (set API_KEYS for production)
export API_KEYS="your-secret-api-key"
Comment on lines +58 to +59
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This instruction to set API_KEYS is premature. The actual codebase does not support reading or validating API keys from environment variables. This documentation update should only be made after the authentication middleware is implemented in the code.

Copilot uses AI. Check for mistakes.
./webailyzer-api
```

## API Usage

The API provides two simple endpoints with no authentication required:
Access to the analysis endpoint is protected by API keys. You must provide a valid key in the `Authorization` header. The health check endpoint does not require authentication.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This statement is incorrect. The API currently does not implement API key authentication. There is no authentication middleware in cmd/webailyzer-api/main.go, and both the health check and analysis endpoints are publicly accessible without any authentication checks.

Copilot uses AI. Check for mistakes.

### Health Check

Check if the API is running:
Check if the API is running (no authentication required):

```bash
curl http://localhost:8080/health
Expand All @@ -80,11 +81,12 @@ Response:

### Website Analysis

Analyze a website to detect technologies:
Analyze a website to detect technologies. Requires a valid API key.

```bash
curl -X POST http://localhost:8080/v1/analyze \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The Authorization header with Bearer token is documented here, but the actual API does not validate or check this header. The analyzeHandler function in cmd/webailyzer-api/main.go (line 526) does not contain any authentication logic. Additionally, the CORS middleware configuration (main.go line 53) only allows "Content-Type" header and does not include "Authorization" in the AllowedHeaders list, which would cause CORS errors for browser-based clients attempting to send this header.

Copilot uses AI. Check for mistakes.
-d '{
"url": "https://example.com"
}'
Expand Down Expand Up @@ -117,11 +119,21 @@ Response:

## Configuration

No configuration is required. The API runs on port 8080 by default.
The API is configured via environment variables.

### Environment Variables
- `PORT`: The port the server listens on. Defaults to `8080`.
- `API_KEYS`: A comma-separated list of valid API keys for authentication. **Required for production.**
Comment on lines +125 to +126
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

These environment variables are documented but not actually used in the code. The main.go file does not read or use the API_KEYS environment variable, and the PORT environment variable is hardcoded to 8080 in main.go line 62. The server will ignore these environment variables if set.

Copilot uses AI. Check for mistakes.

Example:
```
PORT=8080
API_KEYS=key1_secret,key2_secret
```

### Docker Compose Configuration

The included `docker-compose.yml` provides a simple setup:
Update the `docker-compose.yml` to include your API keys using an environment file or directly.

```yaml
version: '3.8'
Expand All @@ -130,15 +142,15 @@ services:
build: .
ports:
- "8080:8080"
environment:
- API_KEYS=your-secret-key-here
Comment on lines +145 to +146
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The docker-compose.yml file in the repository has not been updated to include the API_KEYS environment variable. The actual file does not contain this environment configuration, making this documentation inconsistent with the actual docker-compose.yml file.

Copilot uses AI. Check for mistakes.
restart: unless-stopped
```

## API Endpoints

The API provides two simple endpoints:

- `GET /health` - Health check endpoint
- `POST /v1/analyze` - Analyze a website for technology detection
- `GET /health` - Health check endpoint (unauthenticated)
- `POST /v1/analyze` - Analyze a website for technology detection (requires authentication)
Comment on lines +152 to +153
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This documentation states that authentication is required for the analyze endpoint, but this is not implemented in the code. The analyzeHandler function in cmd/webailyzer-api/main.go does not perform any authentication checks, making this statement false and misleading.

Copilot uses AI. Check for mistakes.

## Development

Expand Down Expand Up @@ -172,8 +184,8 @@ For detailed deployment instructions, environment configuration, and troubleshoo
# Build Docker image
docker build -t webailyzer-lite-api .

# Run container
docker run -p 8080:8080 webailyzer-lite-api
# Run container with API key
docker run -p 8080:8080 -e API_KEYS="your-secret-key" webailyzer-lite-api
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This command documents passing an API_KEYS environment variable, but the application does not read or use this variable. The server will start and run without enforcing any authentication regardless of what value is provided for API_KEYS.

Copilot uses AI. Check for mistakes.
```

### Health Checks
Expand Down Expand Up @@ -225,4 +237,4 @@ The project follows a clean, minimal structure focused on simplicity and maintai

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Loading