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 workspaces/orchestrator/.changeset/purple-eagles-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator-backend': patch
---

fix: add configurable bodyParser limit
5 changes: 5 additions & 0 deletions workspaces/orchestrator/.changeset/strong-pillows-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch
---

chore: add new config value for contentLengthLimit
2 changes: 2 additions & 0 deletions workspaces/orchestrator/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ catalog:
dynamicPlugins:
frontend: {}
orchestrator:
# Uncomment to set the content length limit for the requests. Defaults to 102400 bytes (100kb)
# contentLengthLimit: 10mb
sonataFlowService:
# uncomment the next line to use podman instead of docker
# runtime: podman
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,18 @@ export async function createBackendRouter(
const permissionsIntegrationRouter = createPermissionIntegrationRouter({
permissions: orchestratorPermissions,
});
router.use(express.json());
const contentLengthLimit = config.getOptionalString(
'orchestrator.contentLengthLimit',
);
/**
* Set the content length limit for the requests.
* Defaults to 102400 bytes (100kb)
*
* There is a possiblity that some workflows will have a very large payload, which could cause a 413 error.
* Increasing this value will allow larger payloads to be processed.
*
*/
router.use(express.json({ limit: contentLengthLimit }));
router.use(permissionsIntegrationRouter);
router.use('/workflows', express.text());
router.get('/health', (_, response) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 The Backstage Authors
* Copyright Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,11 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export interface Config {
/**
* Configuration for the Orchestrator plugin.
*/
orchestrator?: {
/**
* Set the content length limit for the requests.
* Defaults to 102400 bytes (100kb)
*/
contentLengthLimit?: string;
sonataFlowService: {
/**
* Base URL of the Sonata Flow service.
Expand Down
Loading