Skip to content

Commit d75db5f

Browse files
Merge pull request #51 from CodeMonkeyCybersecurity/claude/fix-missing-zap-otelzap-011CUzJZAToeAqXJJPg3iB24
style(moni): apply gofmt formatting
2 parents ffae776 + 8119dac commit d75db5f

5 files changed

Lines changed: 64 additions & 64 deletions

File tree

pkg/moni/constants.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import "time"
44

55
// Container names
66
const (
7-
PostgresContainer = "bionicgpt-postgres"
8-
LiteLLMContainer = "bionicgpt-litellm"
9-
LiteLLMDBContainer = "bionicgpt-litellm-db"
10-
LangfuseDBContainer = "bionicgpt-langfuse-db"
11-
AppContainer = "bionicgpt-app"
7+
PostgresContainer = "bionicgpt-postgres"
8+
LiteLLMContainer = "bionicgpt-litellm"
9+
LiteLLMDBContainer = "bionicgpt-litellm-db"
10+
LangfuseDBContainer = "bionicgpt-langfuse-db"
11+
AppContainer = "bionicgpt-app"
1212
)
1313

1414
// Service URLs
@@ -50,12 +50,12 @@ const (
5050

5151
// SSL Certificate ownership (Alpine PostgreSQL containers)
5252
const (
53-
CertOwnerUID = 0 // root
54-
CertOwnerGID = 70 // postgres group in Alpine
55-
CertKeyPerms = 0640
56-
CertCrtPerms = 0644
57-
StandardUID = 999 // Standard PostgreSQL UID
58-
TempKeyPerms = 0600
53+
CertOwnerUID = 0 // root
54+
CertOwnerGID = 70 // postgres group in Alpine
55+
CertKeyPerms = 0640
56+
CertCrtPerms = 0644
57+
StandardUID = 999 // Standard PostgreSQL UID
58+
TempKeyPerms = 0600
5959
)
6060

6161
// Certificate strategies
@@ -70,14 +70,14 @@ const (
7070
// max completion tokens. This prevents API errors when BionicGPT reads this
7171
// value and sends it as max_tokens in requests.
7272
const (
73-
ModelContextSize = 16384
74-
EmbeddingsContextSize = 8192
75-
ModelTPMLimit = 50000
76-
ModelRPMLimit = 1000
77-
ModelFallbackTPMLimit = 30000
78-
ModelFallbackRPMLimit = 500
79-
EmbeddingsTPMLimit = 10000
80-
EmbeddingsRPMLimit = 10000
73+
ModelContextSize = 16384
74+
EmbeddingsContextSize = 8192
75+
ModelTPMLimit = 50000
76+
ModelRPMLimit = 1000
77+
ModelFallbackTPMLimit = 30000
78+
ModelFallbackRPMLimit = 500
79+
EmbeddingsTPMLimit = 10000
80+
EmbeddingsRPMLimit = 10000
8181
)
8282

8383
// RLS table counts

pkg/moni/database.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ WHERE schemaname = 'public' AND rowsecurity = true;
377377
" • bionic_application user does not exist\n"+
378378
"Fix: Ensure PostgreSQL is running and bionic_application user exists", err)
379379
} else if isSuperuser == "t" || isSuperuser == "true" {
380-
return fmt.Errorf("CRITICAL SECURITY FAILURE: bionic_application is a superuser and will BYPASS all RLS policies\n"+
381-
"RLS is completely ineffective when the user is a superuser.\n"+
380+
return fmt.Errorf("CRITICAL SECURITY FAILURE: bionic_application is a superuser and will BYPASS all RLS policies\n" +
381+
"RLS is completely ineffective when the user is a superuser.\n" +
382382
"Fix: Revoke superuser: ALTER USER bionic_application NOSUPERUSER;")
383383
} else {
384384
logger.Info("Verified: bionic_application is NOT a superuser (RLS will work correctly)")

pkg/moni/types.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ type WorkerConfig struct {
1111
SkipVerification bool
1212

1313
// Validation only
14-
ValidateCertsOnly bool
15-
FixCertsOnly bool
16-
VerifyDBOnly bool
17-
VerifyRLSOnly bool
18-
VerifyCSPOnly bool
14+
ValidateCertsOnly bool
15+
FixCertsOnly bool
16+
VerifyDBOnly bool
17+
VerifyRLSOnly bool
18+
VerifyCSPOnly bool
1919
VerifySecurityOnly bool
2020

2121
// Cleanup
@@ -61,13 +61,13 @@ type HealthCheckResult struct {
6161

6262
// RLSVerificationResult contains RLS verification results
6363
type RLSVerificationResult struct {
64-
RLSEnabled bool
65-
TablesWithRLS []string
66-
TablesWithoutRLS []string
67-
PoliciesFound []RLSPolicy
68-
CriticalTablesProtected bool
69-
Warnings []string
70-
Errors []string
64+
RLSEnabled bool
65+
TablesWithRLS []string
66+
TablesWithoutRLS []string
67+
PoliciesFound []RLSPolicy
68+
CriticalTablesProtected bool
69+
Warnings []string
70+
Errors []string
7171
}
7272

7373
// RLSPolicy represents a Row Level Security policy
@@ -91,12 +91,12 @@ type CSPVerificationResult struct {
9191

9292
// DBVerificationResult contains database verification results
9393
type DBVerificationResult struct {
94-
ModelCount int
95-
MoniExists bool
96-
Models []DBModel
97-
Prompts []DBPrompt
98-
Errors []string
99-
Warnings []string
94+
ModelCount int
95+
MoniExists bool
96+
Models []DBModel
97+
Prompts []DBPrompt
98+
Errors []string
99+
Warnings []string
100100
}
101101

102102
// DBModel represents a database model record
@@ -129,13 +129,13 @@ type EnvCheckResult struct {
129129

130130
// SetupResult contains the overall setup result
131131
type SetupResult struct {
132-
Success bool
133-
Phases []SetupPhase
134-
HealthCheck *HealthCheckResult
135-
RLSVerification *RLSVerificationResult
136-
CSPVerification *CSPVerificationResult
137-
DBVerification *DBVerificationResult
138-
StartTime time.Time
139-
EndTime time.Time
140-
CriticalIssues []string
132+
Success bool
133+
Phases []SetupPhase
134+
HealthCheck *HealthCheckResult
135+
RLSVerification *RLSVerificationResult
136+
CSPVerification *CSPVerificationResult
137+
DBVerification *DBVerificationResult
138+
StartTime time.Time
139+
EndTime time.Time
140+
CriticalIssues []string
141141
}

pkg/moni/verification.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -382,22 +382,22 @@ func VerifyContentSecurityPolicy(rc *eos_io.RuntimeContext) (*CSPVerificationRes
382382

383383
// Expected secure CSP directives
384384
recommendedDirectives := map[string]string{
385-
"default-src": "'self'",
386-
"script-src": "'self'",
387-
"style-src": "'self' 'unsafe-inline'",
388-
"img-src": "'self' data:",
389-
"font-src": "'self'",
390-
"connect-src": "'self'",
385+
"default-src": "'self'",
386+
"script-src": "'self'",
387+
"style-src": "'self' 'unsafe-inline'",
388+
"img-src": "'self' data:",
389+
"font-src": "'self'",
390+
"connect-src": "'self'",
391391
"frame-ancestors": "'none'",
392-
"base-uri": "'self'",
393-
"form-action": "'self'",
392+
"base-uri": "'self'",
393+
"form-action": "'self'",
394394
}
395395

396396
// Dangerous patterns
397397
dangerousPatterns := map[string]string{
398-
"'unsafe-eval'": "Allows eval() - major XSS risk",
399-
"* 'unsafe-inline' 'unsafe-eval'": "Extremely permissive - defeats CSP purpose",
400-
"*": "Wildcard allows any source - too permissive",
398+
"'unsafe-eval'": "Allows eval() - major XSS risk",
399+
"* 'unsafe-inline' 'unsafe-eval'": "Extremely permissive - defeats CSP purpose",
400+
"*": "Wildcard allows any source - too permissive",
401401
}
402402

403403
// Step 1: Check if app is responding

pkg/moni/worker.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ func runPhase(rc *eos_io.RuntimeContext, number int, name string, fn func() erro
290290
logger.Info("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
291291

292292
phase := SetupPhase{
293-
Number: number,
294-
Name: name,
295-
StartTime: time.Now(),
296-
Errors: []string{},
297-
Warnings: []string{},
293+
Number: number,
294+
Name: name,
295+
StartTime: time.Now(),
296+
Errors: []string{},
297+
Warnings: []string{},
298298
}
299299

300300
err := fn()

0 commit comments

Comments
 (0)