Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/smart-clocks-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-api": patch
---

Now localhost origins are only allowed when ENVIRONMENT is development or test. In production/pentest, CORS will require either INKEEP_AGENTS_MANAGE_UI_URL to be set or the origin to share the same base
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Minor: Changeset message truncated

Issue: The changeset description ends mid-sentence: "...or the origin to share the same base" — missing the completion.

Why: Incomplete changelog messages can confuse package consumers trying to understand the release behavior.

Fix: (1-click apply)

Suggested change
Now localhost origins are only allowed when ENVIRONMENT is development or test. In production/pentest, CORS will require either INKEEP_AGENTS_MANAGE_UI_URL to be set or the origin to share the same base
Now localhost origins are only allowed when ENVIRONMENT is development or test. In production/pentest, CORS will require either INKEEP_AGENTS_MANAGE_UI_URL to be set or the origin to share the same base domain as the API.

Refs:

5 changes: 4 additions & 1 deletion agents-api/src/middleware/cors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export function isOriginAllowed(origin: string | undefined): origin is string {
const apiUrl = new URL(env.INKEEP_AGENTS_API_URL || 'http://localhost:3002');
const uiUrl = env.INKEEP_AGENTS_MANAGE_UI_URL ? new URL(env.INKEEP_AGENTS_MANAGE_UI_URL) : null;

if (requestUrl.hostname === 'localhost' || requestUrl.hostname === '127.0.0.1') {
if (
(requestUrl.hostname === 'localhost' || requestUrl.hostname === '127.0.0.1') &&
(env.ENVIRONMENT === 'development' || env.ENVIRONMENT === 'test')
) {
return true;
}

Expand Down
Loading