Spaces:
Paused
Paused
metadata
title: cursor-ai-proxy
emoji: 🔥
colorFrom: purple
colorTo: purple
sdk: docker
sdk_version: 3.0.0
app_file: app.py
pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Cursor AI Proxy with Checksum
This is a modified version of the Cursor AI proxy that includes a checksum mechanism for enhanced security.
Features:
- Proxies requests from Cursor to OpenAI API.
- Fetches the latest checksum from
https://cc.wisdgod.com/get-checksumevery 3 hours. - Verifies the checksum of incoming requests on the
/hf/v1/chat/completionsendpoint.
How to Use:
- Set the
CURSOR_CHECKSUMEnvironment Variable:- In your Hugging Face Space's Settings, go to "Repository secrets" and add a new secret:
- Name:
CURSOR_CHECKSUM - Value: You can set an initial checksum value here, or leave it blank to initially rely on the value fetched from
https://cc.wisdgod.com/get-checksum.
- Name:
- In your Hugging Face Space's Settings, go to "Repository secrets" and add a new secret:
- Deploy to Hugging Face Spaces:
- Commit and push the
hf.jsandDockerfileto your Hugging Face Space's Git repository. - Hugging Face will automatically build and deploy your application.
- Commit and push the
Checksum Verification:
- The application fetches the latest checksum from
https://cc.wisdgod.com/get-checksumon startup and every 3 hours. - Incoming requests to
/hf/v1/chat/completionsare checked against the currentchecksumValue. - If the checksum doesn't match, a
400 Invalid checksumerror is returned.
Important Notes:
- The
verifyChecksum()function inhf.jsis a placeholder. You need to implement the actual checksum verification logic based on your security requirements and how Cursor sends data. - The current example uses a simple string comparison for demonstration purposes. You should use a robust cryptographic algorithm like HMAC for production environments.
Disclaimer:
This modified proxy is provided as-is. Use it at your own risk. Always thoroughly test your code and security measures before deploying to production.