theopenconversationkit / tock

Tock, the open source conversational AI toolkit.
https://doc.tock.ai
Apache License 2.0
505 stars 134 forks source link

fix #1598 web_connector: add configuration option for CORS #1599

Closed Fabilin closed 6 months ago

Fabilin commented 7 months ago

Fixes #1598 by adding a regular expression pattern property for the web connector.

I also noticed the auth cookie's Path was kept to the default value. This made me consider the following possibilities:

  1. change the Path to / - this ensures consistent access, but prevents having different user identifiers per connector
  2. Change the Path to the connector path configured in TOCK Studio - this ensures the user identifier is scoped to a single connector, but it becomes incompatible with reverse proxies and other route-rewriting middleware
  3. Keep the current behaviour, but add a configuration option for a fixed path - this allows per-connector scoped user identifiers (although requiring sufficiently distinct connector paths), while allowing sharing when appropriate

I figured 3. was the most useful behaviour, but this could be a miscalculation. Feedback appreciated.