Add trace http auth events on log file. (#7434)

This commit is contained in:
Nicolò Maio 2023-06-09 12:34:32 +02:00 committed by GitHub
parent f5807dadd3
commit 9282581f3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 0 deletions

View file

@ -41,6 +41,7 @@ local auth_toggles = {
["local"] = "toggle_local_auth",
["ldap"] = "toggle_ldap_auth",
["http"] = "toggle_http_auth",
["authentication_log"] = "toggle_http_auth_log",
["radius"] = "toggle_radius_auth",
["menu_entries"] = {
["help"] = "toggle_menu_entry_help",
@ -990,6 +991,13 @@ if auth.has_capability(auth.capabilities.preferences) then
default = "0",
to_switch = elementToSwitch
})
prefsToggleButton(subpage_active, {
field = "http_auth_server_log",
pref = "http_authenticator.log_positive_event_enabled",
default = "0"
})
local showElements = (ntop.getPref("ntopng.prefs.http_authenticator.auth_enabled") == "1")
@ -1003,6 +1011,20 @@ if auth.has_capability(auth.capabilities.preferences) then
pattern = getURLPattern()
}
})
local showElements = (ntop.getPref("ntopng.prefs.http_authenticator.log_positive_event_enabled") == "1")
prefsInputFieldPrefs(subpage_active.entries["http_auth_server_log"].title,
subpage_active.entries["http_auth_server_log"].description, "ntopng.prefs.http_authenticator.log_positive_event_enabled", "http_auth_url",
"", nil, showElements, true, true --[[ allowUrls ]] , {
attributes = {
spellcheck = "false",
maxlength = 255,
required = "required",
pattern = getURLPattern()
}
})
end
-- #####################