Skip to content

Commit c095b30

Browse files
committed
fix: resolve billing, opensearch, integrations, and soc-ai config issues
1 parent 977d4a8 commit c095b30

17 files changed

Lines changed: 58 additions & 54 deletions

File tree

backend/modules/billing/usecase/license.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ func (s *LicenseService) evaluate() domain.License {
105105
if err != nil {
106106
return domain.Community() // no license installed → community
107107
}
108+
if len(strings.TrimSpace(string(envelope))) == 0 {
109+
return domain.Community() // empty LICENSE file → community, not an error
110+
}
108111
lic, err := s.validateAndParse(envelope)
109112
if err != nil {
110113
// A dev build (no injected key/salt) can't verify a LICENSE that happens to

backend/modules/integrations/repository/schema_provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var moduleSchemas = map[string]map[string]string{
2323
"jsonKey": "file",
2424
"projectId": "text",
2525
"subscription": "text",
26-
"topic": "text",
2726
},
2827
"O365": {
2928
"office365_client_id": "text",

backend/modules/opensearch/repository/opensearch_gateway.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func ensureIndexPattern(ctx context.Context, pattern string) (string, error) {
181181

182182
body := map[string]any{
183183
"index_patterns": []string{sanitized},
184-
"priority": 0,
184+
"priority": constants.OS_TEMPLATE_PRIORITY_CUSTOM_PATTERN,
185185
"template": map[string]any{
186186
"settings": map[string]any{
187187
"index.mapping.total_fields.limit": constants.OS_INDEX_FIELD_LIMIT,

backend/modules/opensearch/repository/opensearch_ism.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (c *ISMClient) EnsureFieldLimitTemplate(ctx context.Context, patterns []str
8686
path := "_index_template/utmstack-field-limit"
8787
body := map[string]any{
8888
"index_patterns": patterns,
89-
"priority": 0,
89+
"priority": constants.OS_TEMPLATE_PRIORITY_FIELD_LIMIT,
9090
"template": map[string]any{
9191
"settings": map[string]any{
9292
"index.mapping.total_fields.limit": constants.OS_INDEX_FIELD_LIMIT,

backend/modules/socai/repository/config_store.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import (
99
"gopkg.in/yaml.v3"
1010
)
1111

12-
const configFileName = "system_plugins_soc_ai.yaml"
12+
const (
13+
configFileName = "system_plugins_soc_ai.yaml"
14+
pluginKey = "soc-ai"
15+
)
1316

1417
type FileConfig struct {
1518
Provider string `yaml:"provider"`
@@ -25,6 +28,13 @@ type FileConfig struct {
2528
Capabilities []string `yaml:"capabilities,omitempty"`
2629
}
2730

31+
// pluginsFile is the on-disk wrapper shared with the other system_plugins_*.yaml
32+
// files: plugins.<key>.* — keeps soc-ai's config file the same namespaced shape
33+
// as the datasource plugins instead of being the one bare/flat outlier.
34+
type pluginsFile struct {
35+
Plugins map[string]FileConfig `yaml:"plugins"`
36+
}
37+
2838
type ConfigStore struct {
2939
dir string
3040
mu sync.Mutex
@@ -49,10 +59,14 @@ func (s *ConfigStore) Load() (*FileConfig, error) {
4959
if err != nil {
5060
return nil, err
5161
}
52-
var fc FileConfig
53-
if err := yaml.Unmarshal(data, &fc); err != nil {
62+
var pf pluginsFile
63+
if err := yaml.Unmarshal(data, &pf); err != nil {
5464
return nil, err
5565
}
66+
fc, ok := pf.Plugins[pluginKey]
67+
if !ok {
68+
return nil, nil
69+
}
5670
return &fc, nil
5771
}
5872

@@ -63,7 +77,8 @@ func (s *ConfigStore) Save(fc *FileConfig) error {
6377
if err := os.MkdirAll(s.dir, 0o755); err != nil {
6478
return err
6579
}
66-
data, err := yaml.Marshal(fc)
80+
pf := pluginsFile{Plugins: map[string]FileConfig{pluginKey: *fc}}
81+
data, err := yaml.Marshal(pf)
6782
if err != nil {
6883
return err
6984
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package constants
22

33
const (
4-
OS_INDEX_FIELD_LIMIT = 50000
5-
OS_INDEX_NUMBER_OF_SHARDS = 3
6-
OS_INDEX_NUMBER_OF_REPLICAS = 0
4+
OS_INDEX_FIELD_LIMIT = 50000
5+
OS_INDEX_NUMBER_OF_SHARDS = 3
6+
OS_INDEX_NUMBER_OF_REPLICAS = 0
7+
OS_TEMPLATE_PRIORITY_FIELD_LIMIT = 1 // utmstack-field-limit (v11-log-*/v11-alert-*)
8+
OS_TEMPLATE_PRIORITY_CUSTOM_PATTERN = 2 // per-datasource custom index patterns (most specific)
79
)

frontend/src/features/integrations/components/setup/cloud/GcpGuide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const STEPS: GcpStep[] = [
3232
{ key: 'downloadKey', img: `${IMG}/downloadkey.png` },
3333
]
3434

35-
const MAPPING_KEYS = ['projectId', 'topicId', 'subscription', 'jsonKey'] as const
35+
const MAPPING_KEYS = ['projectId', 'subscription', 'jsonKey'] as const
3636

3737
export function GcpGuide({ integration }: { integration: Integration }) {
3838
const { t } = useTranslation()

frontend/src/features/integrations/components/setup/cloud/builders/google.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ export const GOOGLE_FIELDS: CloudConfigField[] = [
1414
labelKey: `${ROOT}.fields.projectId.label`,
1515
placeholder: 'my-gcp-project',
1616
},
17-
{
18-
key: 'topicId',
19-
labelKey: `${ROOT}.fields.topicId.label`,
20-
placeholder: 'utmstack-topic',
21-
},
2217
{
2318
key: 'subscription',
2419
labelKey: `${ROOT}.fields.subscription.label`,

frontend/src/shared/i18n/locales/de.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,9 +2923,6 @@
29232923
"projectId": {
29242924
"label": "Projekt-ID"
29252925
},
2926-
"topicId": {
2927-
"label": "Themenname"
2928-
},
29292926
"subscription": {
29302927
"label": "Abonnementname"
29312928
},
@@ -4942,8 +4939,8 @@
49424939
"hint": "Frameworks verwalten und Berichte erstellen."
49434940
},
49444941
"correlation": {
4945-
"label": "Korrelationsregeln verwalten",
4946-
"hint": "Korrelations- und Ereignisverarbeitungsregeln erstellen und bearbeiten."
4942+
"label": "Korrelationsregeln und Filter verwalten",
4943+
"hint": "Korrelationsregeln, Ereignisverarbeitungsfilter, Regex-Muster und mandantenspezifische Regeleinstellungen erstellen und bearbeiten."
49474944
},
49484945
"datasources": {
49494946
"label": "Datenquellen verwalten",

frontend/src/shared/i18n/locales/en.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,9 +3104,6 @@
31043104
"projectId": {
31053105
"label": "Project ID"
31063106
},
3107-
"topicId": {
3108-
"label": "Topic name"
3109-
},
31103107
"subscription": {
31113108
"label": "Subscription name"
31123109
},
@@ -4015,8 +4012,8 @@
40154012
"hint": "Manage frameworks and generate reports."
40164013
},
40174014
"correlation": {
4018-
"label": "Manage correlation rules",
4019-
"hint": "Create and edit correlation & event-processing rules."
4015+
"label": "Manage correlation rules & filters",
4016+
"hint": "Create and edit correlation rules, event-processing filters, regex patterns, and per-tenant rule settings."
40204017
},
40214018
"datasources": {
40224019
"label": "Manage data sources",

0 commit comments

Comments
 (0)