Skip to content

Fix duplicate peer usrpwd transport reconciliation#2578

Open
BOURBONCASK wants to merge 2 commits intoeclipse-zenoh:mainfrom
BOURBONCASK:fix/usrpwd-duplicate-transport-auth-id
Open

Fix duplicate peer usrpwd transport reconciliation#2578
BOURBONCASK wants to merge 2 commits intoeclipse-zenoh:mainfrom
BOURBONCASK:fix/usrpwd-duplicate-transport-auth-id

Conversation

@BOURBONCASK
Copy link
Copy Markdown

@BOURBONCASK BOURBONCASK commented Apr 18, 2026

Description

What does this PR do?

This PR fixes duplicate peer transport reconciliation when transport.auth.usrpwd is enabled.

The transport layer no longer treats the authenticated principal as part of transport compatibility, and instead stores the usrpwd principal as transport-local metadata. When a duplicate transport is merged, the principal can now be upgraded from Unknown to Known(username) after a successful OpenAck.

The PR also refreshes interceptors after such principal upgrades so that username-based access control sees the updated authenticated principal.

In addition, it adds:

  • a transport-level regression test for duplicate peer transport reconciliation with usrpwd
  • an integration test covering ACL refresh after a duplicate transport upgrades the principal

Why is this change needed?

In a peer-to-peer duplicate connect scenario, inbound and outbound paths do not carry symmetric usrpwd identity information:

  • the accept path can learn the remote username
  • the open path does not know the remote username and starts as unknown

Before this change, that difference leaked into transport compatibility and caused duplicate peer connections to be rejected with repeated OpenSyn -> Close(INVALID) errors.

Even if duplicate reconciliation succeeds, the authenticated principal still needs to be propagated to runtime interceptors, otherwise username-based ACL decisions may continue to observe stale metadata.

Related Issues

Validation

  • cargo test -p zenoh-transport --test unicast_authenticator --features transport_tcp,auth_usrpwd authenticator_tcp_usrpwd_peer_duplicate_transport -- --exact --nocapture
  • cargo test -p zenoh --test authentication --features unstable test::test_authentication_usrpwd_duplicate_peer_acl_refresh -- --exact --nocapture
  • cargo test -p zenoh --test authentication --features unstable test::test_authentication_usrpwd -- --exact --nocapture
  • cargo test -p zenoh --test authentication --features unstable test::test_authentication_subject_combinations -- --exact --nocapture
  • cargo check -p zenoh --features internal

🏷️ Label-Based Checklist

No specific label requirements detected.

Current labels: No labels

Add one of these labels to this PR to see relevant checklist items: api-sync, breaking-change, bug, ci, dependencies, documentation, enhancement, new feature, internal

This section updates automatically when labels change.

Signed-off-by: yifei.ma <yifeima98@gmail.com>
Signed-off-by: yifei.ma <yifeima98@gmail.com>
@BOURBONCASK BOURBONCASK marked this pull request as ready for review April 18, 2026 08:03
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.

Repeated OpenSyn -> Close(INVALID) with usrpwd in a peer-to-peer duplicate connect scenario

1 participant