Skip to content

Commit 38d3a49

Browse files
committed
Typo in osctrl-admin error message
1 parent aaa14e0 commit 38d3a49

File tree

10 files changed

+50
-50
lines changed

10 files changed

+50
-50
lines changed

cmd/admin/handlers/get.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (h *HandlersAdmin) PermissionsGETHandler(w http.ResponseWriter, r *http.Req
6767
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
6868
// Check permissions
6969
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
70-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
70+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
7171
return
7272
}
7373
// Get permissions
@@ -100,7 +100,7 @@ func (h *HandlersAdmin) CarvesDownloadHandler(w http.ResponseWriter, r *http.Req
100100
}
101101
// Check permissions
102102
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.CarveLevel, env.UUID) {
103-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
103+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
104104
return
105105
}
106106
// Extract id to download

cmd/admin/handlers/json-carves.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (h *HandlersAdmin) JSONCarvesHandler(w http.ResponseWriter, r *http.Request
7070
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
7171
// Check permissions
7272
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.CarveLevel, env.UUID) {
73-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
73+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
7474
return
7575
}
7676
// Extract target

cmd/admin/handlers/json-logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (h *HandlersAdmin) JSONLogsHandler(w http.ResponseWriter, r *http.Request)
8989
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
9090
// Check permissions
9191
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.UserLevel, env.UUID) {
92-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
92+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
9393
return
9494
}
9595
// Extract UUID
@@ -192,7 +192,7 @@ func (h *HandlersAdmin) JSONQueryLogsHandler(w http.ResponseWriter, r *http.Requ
192192
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
193193
// Check permissions
194194
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.QueryLevel, env.UUID) {
195-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
195+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
196196
return
197197
}
198198
// Extract query name

cmd/admin/handlers/json-nodes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (h *HandlersAdmin) JSONEnvironmentHandler(w http.ResponseWriter, r *http.Re
6464
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
6565
// Check permissions
6666
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.UserLevel, env.UUID) {
67-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
67+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
6868
return
6969
}
7070
// Extract target
@@ -121,7 +121,7 @@ func (h *HandlersAdmin) JSONPlatformHandler(w http.ResponseWriter, r *http.Reque
121121
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
122122
// Check permissions
123123
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
124-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
124+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
125125
return
126126
}
127127
// Extract platform

cmd/admin/handlers/json-queries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (h *HandlersAdmin) JSONQueryHandler(w http.ResponseWriter, r *http.Request)
142142
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
143143
// Check permissions
144144
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.QueryLevel, env.UUID) {
145-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
145+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
146146
return
147147
}
148148
// Extract target

cmd/admin/handlers/json-stats.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (h *HandlersAdmin) JSONStatsHandler(w http.ResponseWriter, r *http.Request)
5555
}
5656
// Check permissions
5757
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.UserLevel, env.UUID) {
58-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
58+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
5959
return
6060
}
6161
stats, err = h.Nodes.GetStatsByEnv(env.Name, h.Settings.InactiveHours(settings.NoEnvironmentID))
@@ -66,7 +66,7 @@ func (h *HandlersAdmin) JSONStatsHandler(w http.ResponseWriter, r *http.Request)
6666
} else if target == "platform" {
6767
// Check permissions
6868
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
69-
log.Info().Msgf("%s has insuficient permissions", ctx[sessions.CtxUser])
69+
log.Info().Msgf("%s has insufficient permissions", ctx[sessions.CtxUser])
7070
return
7171
}
7272
stats, err = h.Nodes.GetStatsByPlatform(identifier, h.Settings.InactiveHours(settings.NoEnvironmentID))

cmd/admin/handlers/json-tags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (h *HandlersAdmin) JSONTagsHandler(w http.ResponseWriter, r *http.Request)
1919
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
2020
// Check permissions
2121
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
22-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
22+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
2323
return
2424
}
2525
// Get tags

cmd/admin/handlers/post.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (h *HandlersAdmin) QueryRunPOSTHandler(w http.ResponseWriter, r *http.Reque
9898
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
9999
// Check permissions for query
100100
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.QueryLevel, env.UUID) {
101-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
101+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
102102
return
103103
}
104104
// Parse request JSON body
@@ -252,7 +252,7 @@ func (h *HandlersAdmin) CarvesRunPOSTHandler(w http.ResponseWriter, r *http.Requ
252252
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
253253
// Check permissions
254254
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.CarveLevel, env.UUID) {
255-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
255+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
256256
return
257257
}
258258
// Parse request JSON body
@@ -397,7 +397,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
397397
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
398398
// Check permissions for query
399399
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.QueryLevel, env.UUID) {
400-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
400+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
401401
return
402402
}
403403
// Parse request JSON body
@@ -416,7 +416,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
416416
case "delete":
417417
// Deleting queries only allowed to full admin users
418418
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
419-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions to delete queries", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
419+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions to delete queries", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
420420
return
421421
}
422422
for _, n := range q.Names {
@@ -444,7 +444,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
444444
adminOKResponse(w, "queries activated successfully")
445445
case "saved_delete":
446446
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
447-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions to delete saved queries", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
447+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions to delete saved queries", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
448448
return
449449
}
450450
for _, n := range q.Names {
@@ -481,7 +481,7 @@ func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.
481481
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
482482
// Check permissions
483483
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.CarveLevel, env.UUID) {
484-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
484+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
485485
return
486486
}
487487
// Parse request JSON body
@@ -498,7 +498,7 @@ func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.
498498
switch q.Action {
499499
case "delete":
500500
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
501-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions to delete carves", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
501+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions to delete carves", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
502502
return
503503
}
504504
for _, n := range q.IDs {
@@ -538,7 +538,7 @@ func (h *HandlersAdmin) ConfPOSTHandler(w http.ResponseWriter, r *http.Request)
538538
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
539539
// Check permissions
540540
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, env.UUID) {
541-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
541+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
542542
return
543543
}
544544
// Parse request JSON body
@@ -725,7 +725,7 @@ func (h *HandlersAdmin) IntervalsPOSTHandler(w http.ResponseWriter, r *http.Requ
725725
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
726726
// Check permissions
727727
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, env.UUID) {
728-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
728+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
729729
return
730730
}
731731
// Parse request JSON body
@@ -781,7 +781,7 @@ func (h *HandlersAdmin) ExpirationPOSTHandler(w http.ResponseWriter, r *http.Req
781781
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
782782
// Check permissions
783783
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, env.UUID) {
784-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
784+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
785785
return
786786
}
787787
// Parse request JSON body
@@ -865,7 +865,7 @@ func (h *HandlersAdmin) NodeActionsPOSTHandler(w http.ResponseWriter, r *http.Re
865865
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
866866
// Check permissions
867867
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
868-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
868+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
869869
return
870870
}
871871
// Parse request JSON body
@@ -911,7 +911,7 @@ func (h *HandlersAdmin) EnvsPOSTHandler(w http.ResponseWriter, r *http.Request)
911911
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
912912
// Check permissions
913913
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
914-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
914+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
915915
return
916916
}
917917
// Parse request JSON body
@@ -1012,7 +1012,7 @@ func (h *HandlersAdmin) SettingsPOSTHandler(w http.ResponseWriter, r *http.Reque
10121012
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
10131013
// Check permissions
10141014
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
1015-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1015+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
10161016
return
10171017
}
10181018
// Parse request JSON body
@@ -1086,7 +1086,7 @@ func (h *HandlersAdmin) UsersPOSTHandler(w http.ResponseWriter, r *http.Request)
10861086
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
10871087
// Check permissions
10881088
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
1089-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1089+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
10901090
return
10911091
}
10921092
// Parse request JSON body
@@ -1232,7 +1232,7 @@ func (h *HandlersAdmin) TagsPOSTHandler(w http.ResponseWriter, r *http.Request)
12321232
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
12331233
// Check permissions
12341234
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
1235-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1235+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
12361236
return
12371237
}
12381238
// Parse request JSON body
@@ -1315,7 +1315,7 @@ func (h *HandlersAdmin) TagNodesPOSTHandler(w http.ResponseWriter, r *http.Reque
13151315
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
13161316
// Check permissions
13171317
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
1318-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1318+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
13191319
return
13201320
}
13211321
// Parse request JSON body
@@ -1380,7 +1380,7 @@ func (h *HandlersAdmin) PermissionsPOSTHandler(w http.ResponseWriter, r *http.Re
13801380
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
13811381
// Check permissions
13821382
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, users.NoEnvironment) {
1383-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1383+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
13841384
return
13851385
}
13861386
// Parse request JSON body
@@ -1445,7 +1445,7 @@ func (h *HandlersAdmin) EnrollPOSTHandler(w http.ResponseWriter, r *http.Request
14451445
ctx := r.Context().Value(sessions.ContextKey(sessions.CtxSession)).(sessions.ContextValue)
14461446
// Check permissions
14471447
if !h.Users.CheckPermissions(ctx[sessions.CtxUser], users.AdminLevel, env.UUID) {
1448-
adminErrorResponse(w, fmt.Sprintf("%s has insuficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
1448+
adminErrorResponse(w, fmt.Sprintf("%s has insufficient permissions", ctx[sessions.CtxUser]), http.StatusForbidden, nil)
14491449
return
14501450
}
14511451
// Parse request JSON body

0 commit comments

Comments
 (0)