Log action
This commit is contained in:
parent
f38ed373b8
commit
0257bdc212
2 changed files with 12 additions and 0 deletions
|
|
@ -120,6 +120,7 @@ async fn main() {
|
|||
for policy_group in policy_groups.iter() {
|
||||
if let Some(policy) = policy_group.evaluate(first_line) {
|
||||
action = policy.action;
|
||||
log::debug!("{} {}", policy.action.to_str(), policy.name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -169,6 +170,7 @@ async fn main() {
|
|||
);
|
||||
}
|
||||
}
|
||||
log::debug!(" Challenge={:?}, Allow={:?}", valid_challenge, allow);
|
||||
|
||||
if allow {
|
||||
do_proxy(config.pass_addr, client_stream).await;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@ impl std::str::FromStr for Action {
|
|||
}
|
||||
}
|
||||
|
||||
impl Action {
|
||||
pub fn to_str(self) -> &'static str {
|
||||
match self {
|
||||
Action::Allow => "Allow",
|
||||
Action::Challenge => "Challenge",
|
||||
Action::Drop => "Drop",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Policy {
|
||||
// Will be used when we add log
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue