Skip to content

fix missing MFA session events#2371

Merged
wojcik91 merged 20 commits into
devfrom
fix_mfa_connect_event
Mar 18, 2026
Merged

fix missing MFA session events#2371
wojcik91 merged 20 commits into
devfrom
fix_mfa_connect_event

Conversation

@wojcik91
Copy link
Copy Markdown
Contributor

Add missing MFA-connected event. Also handle emitting events during MFA re-authorization.

Closes #2356 and #1965

@wojcik91 wojcik91 self-assigned this Mar 17, 2026
filipslezaklab
filipslezaklab previously approved these changes Mar 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/defguard_session_manager/src/session_state.rs Outdated
Comment thread crates/defguard_session_manager/src/session_state.rs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/defguard_core/src/grpc/proxy/client_mfa.rs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/defguard_session_manager/src/session_state.rs
@wojcik91 wojcik91 requested a review from Copilot March 17, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/defguard_session_manager/src/lib.rs Outdated
Comment thread crates/defguard_core/src/grpc/proxy/client_mfa.rs
Comment thread crates/defguard_core/src/grpc/proxy/client_mfa.rs Outdated
Comment thread crates/defguard_event_router/src/handlers/bidi.rs Outdated
Comment thread crates/defguard_event_router/src/handlers/bidi.rs Outdated
Comment thread crates/defguard_event_router/src/handlers/bidi.rs Outdated
Comment thread crates/defguard_core/src/grpc/proxy/client_mfa.rs Outdated
moubctez
moubctez previously approved these changes Mar 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 298 to 306
if location.mfa_enabled() {
// FIXME: remove once MFA-related data is no longer stored here
// update device network config
if let Some(mut device_network_info) =
WireguardNetworkDevice::find(&mut *transaction, device.id, location.id).await?
{
device_network_info.is_authorized = false;
device_network_info.preshared_key = None;
device_network_info.update(&mut *transaction).await?;
Comment on lines 309 to 310
self.send_peer_disconnect_message(location, &device)?;
}
peer_stats_update: PeerStatsUpdate,
event_tx: &UnboundedSender<SessionManagerEvent>,
) -> Result<(), SessionManagerError> {
// mark new MFA session as connected if necessary
@wojcik91 wojcik91 merged commit b123ce0 into dev Mar 18, 2026
7 checks passed
@wojcik91 wojcik91 deleted the fix_mfa_connect_event branch March 18, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants