Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS support for REST endpoints [Calhacks] #563

Open
2 tasks done
divikshrivastava opened this issue Oct 20, 2024 · 2 comments
Open
2 tasks done

CORS support for REST endpoints [Calhacks] #563

divikshrivastava opened this issue Oct 20, 2024 · 2 comments
Assignees
Labels
c-feature Category: New feature or request

Comments

@divikshrivastava
Copy link

Prerequisites

  • I checked the documentation and made sure this feature does not already exist
  • I checked the existing issues to make sure this feature has not already been requested

Feature

CORS is a concept for whitelisting the use of APIs from cross-origin resources, and is generally facilitated by flask-cors or CORS middleware in Python and Node js respectively. However, in the agentic deployment of Fetch AI, there is no direct support of this option and requires to be an essential parameter when creating an Agent.

Additional Information (Optional)

No response

@divikshrivastava
Copy link
Author

Also I would love to take a stab at it myself @lrahmani @jrriehl

@jrriehl jrriehl added the c-feature Category: New feature or request label Oct 21, 2024
@Archento
Copy link
Member

Thank you for the feedback!

The current implementation works on the assumption that the used uvicorn (and in respect starlette) server is capable of accepting and properly implementing the necessary CORS handshake. During testing this seemed to have worked for certain domains but it was no reliable or satisfactory solution so we are aware of the need to update this in the future.
As you can see in the reference code for the asgi server we do already try to set the necessary headers during initialisation of the server so the next step if that doesn't work as expected is to actually add this middleware logic ourselves.

We are currently working on a major update to the server and it makes sense to add these acknowledgment messages from the agent there but feel free to take a stab at it!
And if it possible we'll take this over to the new server :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-feature Category: New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants