Skip to content

Conversation

@p3dr0rv
Copy link
Contributor

@p3dr0rv p3dr0rv commented Dec 31, 2025

This pull request enhances the passkey authentication flow by adding support for OpenTelemetry tracing via SpanContext propagation. The main changes involve updating the PasskeyWebListener and related setup to accept and pass along a SpanContext, enabling better observability and traceability for passkey-related operations.

Tracing and observability improvements:

  • Updated the PasskeyWebListener constructor and all relevant call sites to accept an optional SpanContext, allowing trace context propagation throughout the passkey authentication process. [1] [2] [3] [4]
  • Modified instantiations of PasskeyReplyChannel within PasskeyWebListener to forward the SpanContext, ensuring that trace information is included in downstream operations. [1] [2]
  • Added the necessary import for io.opentelemetry.api.trace.SpanContext in PasskeyWebListener.kt.
    AB#3470497
image

Copilot AI review requested due to automatic review settings December 31, 2025 00:47
@p3dr0rv p3dr0rv requested a review from a team as a code owner December 31, 2025 00:47
@github-actions
Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#3470497 to an Azure Boards work item.

@github-actions github-actions bot changed the title Add SpanContext support to PasskeyWebListener and WebViewAuthorizationFragment Add SpanContext support to PasskeyWebListener and WebViewAuthorizationFragment, Fixes AB#3470497 Dec 31, 2025
@p3dr0rv p3dr0rv requested a review from a team as a code owner December 31, 2025 00:49
Copy link
Contributor

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

This PR enhances observability for the passkey authentication flow by adding OpenTelemetry SpanContext support. The changes enable trace context propagation from the AuthorizationActivity through PasskeyWebListener to PasskeyReplyChannel, allowing passkey operations to be properly traced as child spans in the telemetry hierarchy.

Key changes:

  • Added SpanContext parameter to PasskeyWebListener constructor and hook() method
  • Updated the single call site in WebViewAuthorizationFragment to extract and pass the SpanContext from AuthorizationActivity
  • Propagated SpanContext to all PasskeyReplyChannel instantiations within PasskeyWebListener

Reviewed changes

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

File Description
PasskeyWebListener.kt Added spanContext parameter to constructor, updated hook() method signature, and forwarded SpanContext to all PasskeyReplyChannel instantiations for proper trace propagation
WebViewAuthorizationFragment.java Retrieves SpanContext from AuthorizationActivity and passes it to PasskeyWebListener.hook() to enable telemetry context propagation

"Received WebAuthN request of type: ${webAuthNMessage.type} from origin: $sourceOrigin"
)
val passkeyReplyChannel = PasskeyReplyChannel(javaScriptReplyProxy, webAuthNMessage.type)
val passkeyReplyChannel = PasskeyReplyChannel(
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is spanContext then being used to parent the new span?

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.

3 participants