[PM-41211] Move remaining invite link logic to sdk - #1461
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR splits Code Review DetailsNo findings met the confidence threshold for posting. Items considered and dropped during validation:
|
🔍 SDK Breaking Change DetectionSDK Version:
Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1461 +/- ##
==========================================
- Coverage 86.16% 86.08% -0.08%
==========================================
Files 533 535 +2
Lines 79699 80082 +383
==========================================
+ Hits 68671 68938 +267
- Misses 11028 11144 +116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
In my opinion, getting the web vault URL is a service that should be provided by the InternalClient |
quexten
left a comment
There was a problem hiding this comment.
The split to admin / user makes sense and looks pretty nice.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-41211
📔 Objective
The invite link feature is currently half-in half-out of the SDK. Consolidate all invite link logic in the SDK.
New functions moved to rust:
All new functions, and new wrappers around existing functions (create and refresh), now return an
OrganizationInviteLinkView. This handles the decryption of the invite secret and the construction of the URL all within the SDK. The client then just receives the constructed URL without having to worry about individual fields likeCodeorsecret. @quexten one nice consequence of this is that theInvitestruct won't need to pass the FFI boundary.One downside is that (as far as I can tell) the SDK doesn't have any environmentService equivalent to get the web vault URL to then construct the full invite link URL. The best it can do is pass a fragment out which TS can then append to the web vault URL. I still think this is an improvement.
As this resulted in the
InviteLinkClientbecoming quite long, it's been split into 2 sub-clients, following the pattern used by Vault. There is an admin-facing client for admin CRUD operations, and a user-facing client for accepting the link.🚨 Breaking Changes
No breaking changes expected: there are shims for all functions currently used by TS. These will be deleted after TS has been changed over.