mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-09-27 03:01:49 +02:00
extract proxy session management and add clear proxy sessions when updating a proxy config
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ type Proxy struct {
|
||||
CampaignRepository *repository.Campaign
|
||||
CampaignTemplateService *CampaignTemplate
|
||||
DomainService *Domain
|
||||
ProxySessionManager *ProxySessionManager
|
||||
}
|
||||
|
||||
// ProxyServiceConfig represents the YAML configuration for proxy
|
||||
@@ -623,6 +624,15 @@ func (m *Proxy) UpdateByID(
|
||||
return err
|
||||
}
|
||||
|
||||
// clear all sessions for this proxy since config has changed
|
||||
// this ensures sessions get the new config (capture rules, rewrite rules, etc.)
|
||||
if m.ProxySessionManager != nil {
|
||||
m.Logger.Debugw("clearing all sessions for updated proxy",
|
||||
"proxyID", id.String(),
|
||||
)
|
||||
m.ProxySessionManager.ClearSessionsForProxy(id.String())
|
||||
}
|
||||
|
||||
ae.Details["id"] = id.String()
|
||||
m.AuditLogAuthorized(ae)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user