diff --git a/docs/FRAMEWORKS_CHANGELOG.md b/docs/FRAMEWORKS_CHANGELOG.md index 4df936e6b..839dd66b0 100644 --- a/docs/FRAMEWORKS_CHANGELOG.md +++ b/docs/FRAMEWORKS_CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `OSAKit` / `objc2-osa-kit`. - `ScreenCaptureKit` / `objc2-screen-capture-kit`. - `Network` / `objc2-network`. + - `LocalAuthentication` / `objc2-local-authentication`. * Added a few missing APIs that uses arrays. * Added `CGBitmapInfo::new`. * Added `Default` implementations for enumerations, bitflags and structs. diff --git a/framework-crates/objc2-local-authentication/translation-config.toml b/framework-crates/objc2-local-authentication/translation-config.toml index 97e19b941..4cac6d751 100644 --- a/framework-crates/objc2-local-authentication/translation-config.toml +++ b/framework-crates/objc2-local-authentication/translation-config.toml @@ -15,3 +15,84 @@ enum.LAPolicy.use-value = true enum.LACredentialType.use-value = true enum.LAError.use-value = true enum.LAAccessControlOperation.use-value = true + +unsafe-default-safety.documentation-is-reviewed = true +unsafe-default-safety.bounds-checked-internally = true + +# Construction increments process-wide `+newInstanceId` and `+newCommandId` +# counters without atomics or a lock (observed on macOS 26.6.2). +class.LAContext.methods.init.unsafe = true +class.LAContext.methods.new.unsafe = true +class.LARight.methods.init.unsafe = true +class.LARight.methods."initWithRequirement:".unsafe = true +class.LARight.methods.new.unsafe = true + +# Takes a command ID and runs the evaluation whose reply replaces the cached +# biometry type. +class.LAContext.methods."canEvaluatePolicy:error:".unsafe = true + +# Each call takes an ID from the process-wide command counter. +class.LAContext.methods.invalidate.unsafe = true +class.LAContext.methods."isCredentialSet:".unsafe = true +class.LAContext.methods."setCredential:type:".unsafe = true +class.LAContext.methods.localizedFallbackTitle.unsafe = true +class.LAContext.methods."setLocalizedFallbackTitle:".unsafe = true +class.LAContext.methods.localizedCancelTitle.unsafe = true +class.LAContext.methods."setLocalizedCancelTitle:".unsafe = true +class.LAContext.methods.touchIDAuthenticationAllowableReuseDuration.unsafe = true +class.LAContext.methods."setTouchIDAuthenticationAllowableReuseDuration:".unsafe = true +class.LAContext.methods.localizedReason.unsafe = true +class.LAContext.methods."setLocalizedReason:".unsafe = true +class.LAContext.methods.interactionNotAllowed.unsafe = true +class.LAContext.methods."setInteractionNotAllowed:".unsafe = true + +# Reads or replaces the process-wide cached biometry type without a lock. +class.LAContext.methods.biometryType.unsafe = true +class.LAContext.methods.domainState.unsafe = true + +# Deprecated and not reviewed. +class.LAContext.methods.evaluatedPolicyDomainState.unsafe = true +class.LAContext.methods.maxBiometryFailures.unsafe = true +class.LAContext.methods."setMaxBiometryFailures:".unsafe = true + +# Takes a command ID, and the `evaluatePolicy` reply replaces the cached +# biometry type on a framework queue. +class.LAContext.methods."evaluatePolicy:localizedReason:reply:".unsafe = true +class.LAContext.methods."evaluateAccessControl:operation:localizedReason:reply:".unsafe = true + +# Runs on a framework queue and takes command IDs through the right's context. +# Authorizing and deauthorizing also write the right's `state`. +class.LARight.methods."authorizeWithLocalizedReason:completion:".unsafe = true +class.LARight.methods."checkCanAuthorizeWithCompletion:".unsafe = true +class.LARight.methods."deauthorizeWithCompletion:".unsafe = true + +# Reads `_state` directly while authorization completions write it from a +# framework queue. +class.LARight.methods.state.unsafe = true + +# The observer is held weakly and called on a framework queue. +class.LAEnvironment.methods."addObserver:".unsafe = true +class.LAEnvironment.methods."removeObserver:".unsafe = true +protocol.LAEnvironmentObserver.methods."environment:stateDidChangeFromOldState:".unsafe = true + +# Inherited from `NSObject` with unspecified behaviour, instances come from the +# class factory methods. +class.LAAuthenticationRequirement.methods.init.unsafe = true +class.LAAuthenticationRequirement.methods.new.unsafe = true +class.LABiometryFallbackRequirement.methods.init.unsafe = true +class.LABiometryFallbackRequirement.methods.new.unsafe = true + +# Instances are only obtained through `LARightStore`. +class.LAPersistedRight.methods."initWithRequirement:".unsafe = true + +# Creates or uses an `LAContext` internally, which increments the counters above. +class.LARightStore.methods."rightForIdentifier:completion:".unsafe = true +class.LARightStore.methods."saveRight:identifier:completion:".unsafe = true +class.LARightStore.methods."saveRight:identifier:secret:completion:".unsafe = true +class.LAPrivateKey.methods."signData:secKeyAlgorithm:completion:".unsafe = true +class.LAPrivateKey.methods."decryptData:secKeyAlgorithm:completion:".unsafe = true +class.LAPrivateKey.methods."exchangeKeysWithPublicKey:secKeyAlgorithm:secKeyParameters:completion:".unsafe = true +class.LAPublicKey.methods."exportBytesWithCompletion:".unsafe = true +class.LAPublicKey.methods."encryptData:secKeyAlgorithm:completion:".unsafe = true +class.LAPublicKey.methods."verifyData:signature:secKeyAlgorithm:completion:".unsafe = true +class.LASecret.methods."loadDataWithCompletion:".unsafe = true diff --git a/generated b/generated index 248bc7075..aae6373a7 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 248bc7075cfb8caf12a861069da11d4a9aa1f0fd +Subproject commit aae6373a71628d5a02074a5069ebf25e6a54567b