Skip to content

Commit 783ac1a

Browse files
authored
feat: add is_mcp_enabled setting to app manifest (#513)
1 parent 9448dfe commit 783ac1a

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

internal/shared/types/app_manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ type AppSettings struct {
110110
FunctionRuntime FunctionRuntime `json:"function_runtime,omitempty" yaml:"function_runtime,flow,omitempty"`
111111
TokenRotationEnabled *bool `json:"token_rotation_enabled,omitempty" yaml:"token_rotation_enabled,omitempty"`
112112
SiwsLinks *SiwsLinks `json:"siws_links,omitempty" yaml:"siws_links,flow,omitempty"`
113+
IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty" yaml:"is_mcp_enabled,omitempty"`
113114
}
114115

115116
type WorkflowStep struct {

internal/shared/types/app_manifest_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,41 @@ func Test_AppManifest_AppSettings_SiwsLinks(t *testing.T) {
263263
}
264264
}
265265

266+
func Test_AppManifest_AppSettings_IsMCPEnabled(t *testing.T) {
267+
truth := true
268+
tests := map[string]struct {
269+
settings *AppSettings
270+
expectedMCPValue *bool
271+
expectedJSON string
272+
}{
273+
"undefined setting has no value": {
274+
settings: &AppSettings{},
275+
expectedMCPValue: nil,
276+
expectedJSON: `{}`,
277+
},
278+
"defined setting has a value": {
279+
settings: &AppSettings{IsMCPEnabled: &truth},
280+
expectedMCPValue: &truth,
281+
expectedJSON: `{"is_mcp_enabled":true}`,
282+
},
283+
}
284+
for name, tc := range tests {
285+
t.Run(name, func(t *testing.T) {
286+
manifest := AppManifest{
287+
Settings: tc.settings,
288+
}
289+
if tc.settings != nil {
290+
actualJSON, err := json.Marshal(tc.settings)
291+
require.NoError(t, err)
292+
assert.Equal(t, tc.expectedJSON, string(actualJSON))
293+
assert.Equal(t, tc.expectedMCPValue, manifest.Settings.IsMCPEnabled)
294+
} else {
295+
assert.Nil(t, manifest.Settings)
296+
}
297+
})
298+
}
299+
}
300+
266301
func Test_AppManifest_AppSettings_IncomingWebhooks(t *testing.T) {
267302
falsity := false
268303
expectedIncomingWebhooks := IncomingWebhooks{

0 commit comments

Comments
 (0)