@@ -231,6 +231,13 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationHibernate(r *http.Re
231
231
return nil , err
232
232
}
233
233
234
+ // Validate confirmation name if provided
235
+ if hibernateRequest .ConfirmationName != nil {
236
+ if * hibernateRequest .ConfirmationName != appIdentifier .AppName {
237
+ return nil , errors .New ("confirmation name does not match application name" )
238
+ }
239
+ }
240
+
234
241
if ! handler .enforcer .Enforce (token , casbin .ResourceGlobal , casbin .ActionUpdate , "*" ) {
235
242
return nil , errors .New ("unauthorized" )
236
243
}
@@ -243,6 +250,13 @@ func (handler *HelmAppRestHandlerImpl) handleArgoApplicationHibernate(r *http.Re
243
250
return nil , err
244
251
}
245
252
253
+ // Validate confirmation name if provided
254
+ if hibernateRequest .ConfirmationName != nil {
255
+ if * hibernateRequest .ConfirmationName != appIdentifier .AppName {
256
+ return nil , errors .New ("confirmation name does not match application name" )
257
+ }
258
+ }
259
+
246
260
if ! handler .enforcer .Enforce (token , casbin .ResourceGlobal , casbin .ActionUpdate , "*" ) {
247
261
return nil , errors .New ("unauthorized" )
248
262
}
@@ -255,6 +269,14 @@ func (handler *HelmAppRestHandlerImpl) handleHelmApplicationHibernate(r *http.Re
255
269
if err != nil {
256
270
return nil , err
257
271
}
272
+
273
+ // Validate confirmation name if provided
274
+ if hibernateRequest .ConfirmationName != nil {
275
+ if * hibernateRequest .ConfirmationName != appIdentifier .ReleaseName {
276
+ return nil , errors .New ("confirmation name does not match application name" )
277
+ }
278
+ }
279
+
258
280
rbacObject , rbacObject2 := handler .enforcerUtil .GetHelmObjectByClusterIdNamespaceAndAppName (
259
281
appIdentifier .ClusterId ,
260
282
appIdentifier .Namespace ,
@@ -317,6 +339,14 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationUnHibernate(r *http.
317
339
if err != nil {
318
340
return nil , err
319
341
}
342
+
343
+ // Validate confirmation name if provided
344
+ if hibernateRequest .ConfirmationName != nil {
345
+ if * hibernateRequest .ConfirmationName != appIdentifier .AppName {
346
+ return nil , errors .New ("confirmation name does not match application name" )
347
+ }
348
+ }
349
+
320
350
if ! handler .enforcer .Enforce (token , casbin .ResourceGlobal , casbin .ActionUpdate , "*" ) {
321
351
return nil , errors .New ("unauthorized" )
322
352
}
@@ -327,6 +357,14 @@ func (handler *HelmAppRestHandlerImpl) handleArgoApplicationUnHibernate(r *http.
327
357
if err != nil {
328
358
return nil , err
329
359
}
360
+
361
+ // Validate confirmation name if provided
362
+ if hibernateRequest .ConfirmationName != nil {
363
+ if * hibernateRequest .ConfirmationName != appIdentifier .AppName {
364
+ return nil , errors .New ("confirmation name does not match application name" )
365
+ }
366
+ }
367
+
330
368
if ! handler .enforcer .Enforce (token , casbin .ResourceGlobal , casbin .ActionUpdate , "*" ) {
331
369
return nil , errors .New ("unauthorized" )
332
370
}
@@ -339,6 +377,13 @@ func (handler *HelmAppRestHandlerImpl) handleHelmApplicationUnHibernate(r *http.
339
377
return nil , err
340
378
}
341
379
380
+ // Validate confirmation name if provided
381
+ if hibernateRequest .ConfirmationName != nil {
382
+ if * hibernateRequest .ConfirmationName != appIdentifier .ReleaseName {
383
+ return nil , errors .New ("confirmation name does not match application name" )
384
+ }
385
+ }
386
+
342
387
rbacObject , rbacObject2 := handler .enforcerUtil .GetHelmObjectByClusterIdNamespaceAndAppName (
343
388
appIdentifier .ClusterId ,
344
389
appIdentifier .Namespace ,
0 commit comments