Skip to content

Conversation

@JaredSnider-Bitwarden
Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden commented Dec 11, 2025

🎟️ Tracking

n/a but blocks #549 and #596

📔 Objective

To add UNIFFI support to the bw-auth crate

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@claude
Copy link

claude bot commented Dec 11, 2025

Claude finished @JaredSnider-Bitwarden's task —— View job


Code Review Complete

Tasks:

  • Launch code review agent to analyze PR changes
  • Complete review and post findings

Review Summary

The bitwarden-code-reviewer agent has completed a thorough review of this PR and posted inline comments directly on the code.

Overall Assessment: MAJOR CONCERNS - Missing UniFFI Attributes

While the UniFFI scaffolding and configuration are correctly implemented, the PR is incomplete. Several public structs and enums in the send_access module are missing required UniFFI attributes.

Critical Issues

Missing UniFFI attributes on public request types in access_token_request.rs:

The following publicly exported types need #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] or #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]:

  1. SendPasswordCredentials (struct) - Missing uniffi::Record
  2. SendEmailCredentials (struct) - Missing uniffi::Record
  3. SendEmailOtpCredentials (struct) - Missing uniffi::Record
  4. SendAccessCredentials (enum) - Missing uniffi::Enum
  5. SendAccessTokenRequest (struct) - Missing uniffi::Record

These types are publicly exported and used in the public API (SendAccessClient::request_send_access_token), so they must have UniFFI attributes according to the CLAUDE.md guidelines.

What Was Done Correctly ✅

  • Cargo.toml configuration (UniFFI feature and dependencies)
  • Library scaffolding (uniffi::setup_scaffolding!())
  • uniffi.toml configuration
  • UniFFI attributes on response types (SendAccessTokenResponse)
  • UniFFI attributes on error types (all error enums)
  • Correct use of uniffi::custom_newtype! for UnexpectedIdentityError

Required Changes

Add the missing attributes to crates/bitwarden-auth/src/send_access/access_token_request.rs:

#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
pub struct SendPasswordCredentials { ... }

#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
pub struct SendEmailCredentials { ... }

#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
pub struct SendEmailOtpCredentials { ... }

#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[serde(untagged)]
pub enum SendAccessCredentials { ... }

#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
pub struct SendAccessTokenRequest { ... }

Verification:

cargo check --features uniffi -p bitwarden-auth
cargo build --features uniffi -p bitwarden-auth

Recommendation: Request changes - the missing attributes will cause issues when mobile clients try to use these types.


[bindings.swift]
ffi_module_name = "BitwardenAuthFFI"
module_name = "BitwardenAuth"
generate_immutable_records = true No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Missing trailing newline: This file should end with a newline character to match repository conventions. Most editors add this automatically, and it's a common git best practice.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Logo
Checkmarx One – Scan Summary & Details746d14f7-7b02-46d6-85dc-f3a851bee154

Great job! No new security vulnerabilities introduced in this pull request

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

🔍 SDK Breaking Change Detection Results

SDK Version: auth/bw-auth-add-uniffi-support (410c830)
Completed: 2025-12-11 20:12:45 UTC
Total Time: 218s

Client Status Details
typescript ✅ No breaking changes detected TypeScript compilation passed with new SDK version - View Details

Breaking change detection completed. View SDK workflow

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.57%. Comparing base (fc6d317) to head (410c830).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...rden-auth/src/send_access/access_token_response.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
- Coverage   78.57%   78.57%   -0.01%     
==========================================
  Files         283      283              
  Lines       29187    29188       +1     
==========================================
  Hits        22934    22934              
- Misses       6253     6254       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JaredSnider-Bitwarden JaredSnider-Bitwarden marked this pull request as ready for review December 11, 2025 21:23
Copy link

Choose a reason for hiding this comment

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

👍 Approving with my limited rust knowledge, but following a conversation with Jared it sounds like the correct boxes have been ticked for being done correctly.

@JaredSnider-Bitwarden JaredSnider-Bitwarden merged commit bd636a4 into main Dec 12, 2025
113 checks passed
@JaredSnider-Bitwarden JaredSnider-Bitwarden deleted the auth/bw-auth-add-uniffi-support branch December 12, 2025 14:59
bw-ghapp bot pushed a commit to bitwarden/sdk-swift that referenced this pull request Dec 12, 2025
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