Skip to content

Mark all public value types as 'Sendable' #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jdmoreira
Copy link
Member

@jdmoreira jdmoreira commented Aug 4, 2025

This is required for the callers of this SDK to be able send these types across actor boundaries.
These annotations fix a bunch of warnings in our sample apps.

All these types are pure value types and have all reasons to be marked as Sendable.

@jdmoreira jdmoreira requested a review from Copilot August 4, 2025 12:40
@jdmoreira jdmoreira self-assigned this Aug 4, 2025
Copy link

@Copilot 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 adds Sendable conformance to all public value types in the YubiKit framework to improve thread safety in concurrent Swift code. This ensures that these types can be safely passed across concurrency boundaries without data races.

Key changes include:

  • Adding Sendable conformance to public enums, structs, and protocols
  • Enabling safer concurrent usage of YubiKit types in async/await contexts
  • Maintaining backwards compatibility while improving type safety

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Data+Extensions.swift Adds Sendable to PIVEncryptionError enum
Connections.swift Adds Sendable to WiredConnection and AnyConnection enums
SmartCardConnection.swift Adds Sendable to SmartCardConnectionError enum
Session.swift Adds Sendable to SessionFeature protocol and SessionError enum
SecurityDomainSession.swift Adds Sendable to SCPError enum
SCP11KeyParams.swift Adds Sendable to SCP11KeyParams struct
SCP03KeyParams.swift Adds Sendable to SCP03KeyParams struct
Response.swift Adds Sendable to Response struct
PIVSessionFeature.swift Adds Sendable to PIVSessionFeature enum
PIVPadding.swift Adds Sendable to PIVPaddingError enum
PIVDataTypes.swift Adds Sendable to multiple PIV-related types and enums
OATHSessionFeature.swift Adds Sendable to OATHSessionFeature enum
OATHSession.swift Adds Sendable to OATHSessionError and DeriveAccessKeyError
OATHSession+Extensions.swift Adds Sendable to CredentialTemplateError and CredentialTemplate
NFCConnection.swift Adds Sendable to NFCConnectionError enum
ManagementSession.swift Adds Sendable to ManagementSessionError enum
ManagementFeature.swift Adds Sendable to ManagementFeature enum
DeviceInfo.swift Adds Sendable to DeviceTransport, FormFactor enums and DeviceInfo struct
DeviceConfig.swift Adds Sendable to DeviceConfig struct
Capability.swift Adds Sendable to Capability enum
RSAKeys.swift Adds Sendable to RSA enum
Keys.swift Adds Sendable to CryptoKeyKind, PublicKey, and PrivateKey enums
ECKeys.swift Adds Sendable to EC enum
Connection.swift Adds Sendable to ConnectionError enum and ResponseError struct

Copy link

@elibon99 elibon99 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants