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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch
---

Expose the dedicated `orchestrator.rjsf-widgets` configuration namespace to form widget templates. Values in this namespace are public to the frontend and must not contain secrets.
10 changes: 10 additions & 0 deletions workspaces/orchestrator/docs/orchestratorFormWidgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,16 @@ The widgets manage waiting for asynchronous promises and chains of functions to
When exposing additional keys in the future, we will consider not only the [frontend-visibility](https://backstage.io/docs/conf/defining/#visibility) but security as well, since a malicious workflow can retrieve configuration of plugins or Backstage, eventually with their secrets.
That’s the reason for listing the exposed keys explicitly.

Values referenced through `rjsfConfig` are configured under `orchestrator.rjsf-widgets`:

```yaml
orchestrator:
rjsf-widgets:
defaultEnvironment: production
```

All values in this namespace are exposed to the frontend and must not contain secrets.

| Key Family | Key | Value of at runtime\<br\>(skipping promises for simplicity) |
| :-------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| current | \[whatever property name\] | Value of other field/property of the form. The properties build hierarchy separated by `.` (dots) matching the structure of fields/objects defined by the data input schema. Arrays or branches of a complex object structure can be passed as well, data are encoded into JSON in that case. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export interface Config {
*/
url: string;
};
/**
* Public string values available to form widget templates through `rjsfConfig.<key>`.
* Do not store secrets in this configuration because workflow authors can access every value.
* @deepVisibility frontend
*/
'rjsf-widgets'?: {
[key: string]: string;
};
/**
* Kafka configuration for event-triggered workflows (KafkaJS-style).
* When present, the UI can show actions such as "Run as Event".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ describe('useTemplateUnitEvaluator', () => {
);
});

it('evaluates rjsfConfig.* units from public widget configuration', async () => {
const { result } = renderHook(() => useTemplateUnitEvaluator());

await expect(
result.current('rjsfConfig.defaultEnvironment', {} as any),
).resolves.toBe('from-config');
expect(configApi.getOptionalString).toHaveBeenCalledWith(
'orchestrator.rjsf-widgets.defaultEnvironment',
);
});

it('evaluates fetch response selector units', async () => {
mockedApplySelectorString.mockResolvedValue('resolved-value');
const { result } = renderHook(() => useTemplateUnitEvaluator());
Expand Down
Loading