Skip to content

[ID-1150] prep for rust bindings#31

Merged
thereisnogabe merged 9 commits into
mainfrom
gabe-id-1150-migrate-idkit-swift-to-host-rust-bindings
Nov 19, 2025
Merged

[ID-1150] prep for rust bindings#31
thereisnogabe merged 9 commits into
mainfrom
gabe-id-1150-migrate-idkit-swift-to-host-rust-bindings

Conversation

@thereisnogabe

Copy link
Copy Markdown
Contributor

Gabe Cohen and others added 4 commits November 6, 2025 11:08
This commit adds backwards-compatible convenience methods and updates the
generated UniFFI bindings to match the latest Rust core implementation.

## New Swift Convenience Wrappers

### Request+Convenience.swift
Backwards-compatible initializers that mirror IDKit v2 API:
- `init(credentialType:signal:faceAuth:)` - Accepts string signals
- `init(credentialType:abiEncodedSignal:faceAuth:)` - Accepts ABI-encoded Data
- `Signal.data` - Computed property exposing raw bytes as Data
- `Signal.string` - Computed property exposing string form

### Session+Compatibility.swift
Async/await helpers and convenience accessors:
- `status(pollInterval:)` - AsyncThrowingStream for status updates
- `statusStream(pollInterval:)` - Backwards-compatible alias
- `verificationURL` - Computed property returning URL instead of String
- `requestUUID` - Computed property returning UUID instead of String
- `SessionError` - Swift-friendly error enum

## Updated Generated Bindings

### Session method renamed
- `poll()` → `pollForStatus()` - Matches Rust implementation
- Updated documentation to clarify non-blocking polling behavior
- Updated FFI function names and checksums

### Headers updated
- Updated `idkitFFI.h` with latest function signatures

## Migration Notes

These changes maintain v2 API compatibility while exposing the v3 Rust core:
- Existing code using v2 API continues to work
- New code can use either v2 convenience methods or v3 core APIs
- Generated types (Status, Proof, Constraints, etc.) remain unchanged

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The Package.swift requires valid HTTPS URLs for binary targets.
This commit adds a placeholder URL that will be replaced by the
publish-swift.yml workflow when the first release is created.

Note: CI will fail to download this placeholder URL, but that's expected
until the first official release is published from the idkit repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Syncs generated Swift bindings and convenience extensions from main idkit
repo after upgrading to UniFFI 0.30.

Key changes:
- Updated all generated Swift files (idkit.swift, idkit_core.swift)
- Updated C headers and modulemaps
- Fixed Request+Convenience.swift to use unsafeFromHandle (UniFFI 0.30 API)
- API change: unsafeFromRawPointer() → unsafeFromHandle()
- API change: uniffiClonePointer() → uniffiCloneHandle()

Generated from idkit commit: 1290765
@thereisnogabe thereisnogabe marked this pull request as ready for review November 7, 2025 18:15
@thereisnogabe thereisnogabe changed the title prep for rust bindings [ID-1150] prep for rust bindings Nov 7, 2025
@thereisnogabe thereisnogabe merged commit 725129f into main Nov 19, 2025
5 of 13 checks passed
@thereisnogabe thereisnogabe deleted the gabe-id-1150-migrate-idkit-swift-to-host-rust-bindings branch November 19, 2025 23:21
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.

2 participants