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
21 changes: 11 additions & 10 deletions internal/shared/types/app_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@ type OAuthConfig struct {
}

type AppSettings struct {
SocketModeEnabled *bool `json:"socket_mode_enabled,omitempty" yaml:"socket_mode_enabled,omitempty"`
OrgDeployEnabled *bool `json:"org_deploy_enabled,omitempty" yaml:"org_deploy_enabled,omitempty"`
Interactivity *ManifestInteractivity `json:"interactivity,omitempty" yaml:"interactivity,omitempty"`
IncomingWebhooks *IncomingWebhooks `json:"incoming_webhooks,omitempty" yaml:"incoming_webhooks,flow,omitempty"`
EventSubscriptions *ManifestEventSubscriptions `json:"event_subscriptions,omitempty" yaml:"event_subscriptions,flow,omitempty"`
AllowedIPAddressRanges []string `json:"allowed_ip_address_ranges,omitempty" yaml:"allowed_ip_address_ranges,flow,omitempty"`
FunctionRuntime FunctionRuntime `json:"function_runtime,omitempty" yaml:"function_runtime,flow,omitempty"`
TokenRotationEnabled *bool `json:"token_rotation_enabled,omitempty" yaml:"token_rotation_enabled,omitempty"`
SiwsLinks *SiwsLinks `json:"siws_links,omitempty" yaml:"siws_links,flow,omitempty"`
IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty" yaml:"is_mcp_enabled,omitempty"`
SocketModeEnabled *bool `json:"socket_mode_enabled,omitempty" yaml:"socket_mode_enabled,omitempty"`
OrgDeployEnabled *bool `json:"org_deploy_enabled,omitempty" yaml:"org_deploy_enabled,omitempty"`
Interactivity *ManifestInteractivity `json:"interactivity,omitempty" yaml:"interactivity,omitempty"`
IncomingWebhooks *IncomingWebhooks `json:"incoming_webhooks,omitempty" yaml:"incoming_webhooks,flow,omitempty"`
EventSubscriptions *ManifestEventSubscriptions `json:"event_subscriptions,omitempty" yaml:"event_subscriptions,flow,omitempty"`
AllowedIPAddressRanges []string `json:"allowed_ip_address_ranges,omitempty" yaml:"allowed_ip_address_ranges,flow,omitempty"`
FunctionRuntime FunctionRuntime `json:"function_runtime,omitempty" yaml:"function_runtime,flow,omitempty"`
TokenRotationEnabled *bool `json:"token_rotation_enabled,omitempty" yaml:"token_rotation_enabled,omitempty"`
AppLevelTokenRotationEnabled *bool `json:"app_level_token_rotation_enabled,omitempty" yaml:"app_level_token_rotation_enabled,omitempty"`
SiwsLinks *SiwsLinks `json:"siws_links,omitempty" yaml:"siws_links,flow,omitempty"`
IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty" yaml:"is_mcp_enabled,omitempty"`
}

type WorkflowStep struct {
Expand Down
35 changes: 35 additions & 0 deletions internal/shared/types/app_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,41 @@ func Test_AppManifest_AppSettings_IsMCPEnabled(t *testing.T) {
}
}

func Test_AppManifest_AppSettings_AppLevelTokenRotationEnabled(t *testing.T) {
truth := true
tests := map[string]struct {
settings *AppSettings
expectedRotationValue *bool
expectedJSON string
}{
"undefined setting has no value": {
settings: &AppSettings{},
expectedRotationValue: nil,
expectedJSON: `{}`,
},
"defined setting has a value": {
settings: &AppSettings{AppLevelTokenRotationEnabled: &truth},
expectedRotationValue: &truth,
expectedJSON: `{"app_level_token_rotation_enabled":true}`,
},
}
for name, tc := range tests {
t.Run(name, func(t *testing.T) {
manifest := AppManifest{
Settings: tc.settings,
}
if tc.settings != nil {
actualJSON, err := json.Marshal(tc.settings)
require.NoError(t, err)
assert.Equal(t, tc.expectedJSON, string(actualJSON))
assert.Equal(t, tc.expectedRotationValue, manifest.Settings.AppLevelTokenRotationEnabled)
} else {
assert.Nil(t, manifest.Settings)
}
})
}
}

func Test_AppManifest_AppSettings_IncomingWebhooks(t *testing.T) {
falsity := false
expectedIncomingWebhooks := IncomingWebhooks{
Expand Down
Loading