Skip to content

Commit 36f6ae3

Browse files
Mark reviewed LocalAuthentication methods safe
1 parent 40dbfe5 commit 36f6ae3

3 files changed

Lines changed: 72 additions & 1 deletion

File tree

‎docs/FRAMEWORKS_CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1717
- `CoreText` / `objc2-core-text`.
1818
- `ScreenCaptureKit` / `objc2-screen-capture-kit`.
1919
- `Network` / `objc2-network`.
20+
- `LocalAuthentication` / `objc2-local-authentication`.
2021
* Added a few missing APIs that uses arrays.
2122
* Added `CGBitmapInfo::new`.
2223
* Added `Default` implementations for enumerations, bitflags and structs.

‎framework-crates/objc2-local-authentication/translation-config.toml‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,73 @@ enum.LAPolicy.use-value = true
1515
enum.LACredentialType.use-value = true
1616
enum.LAError.use-value = true
1717
enum.LAAccessControlOperation.use-value = true
18+
19+
unsafe-default-safety.documentation-is-reviewed = true
20+
unsafe-default-safety.bounds-checked-internally = true
21+
22+
# Construction increments process-wide `+newInstanceId` and `+newCommandId`
23+
# counters without atomics or a lock (observed on macOS 26.6.2).
24+
class.LAContext.methods.init.unsafe = true
25+
class.LAContext.methods.new.unsafe = true
26+
class.LARight.methods.init.unsafe = true
27+
class.LARight.methods."initWithRequirement:".unsafe = true
28+
class.LARight.methods.new.unsafe = true
29+
30+
# Increments the process-wide command counter, and its error path replaces the
31+
# process-wide cached biometry type.
32+
class.LAContext.methods."canEvaluatePolicy:error:".unsafe = true
33+
34+
# Reads the process-wide cached biometry type without retaining it, while
35+
# other contexts and evaluation completions replace and release it unguarded.
36+
class.LAContext.methods.biometryType.unsafe = true
37+
class.LAContext.methods.domainState.unsafe = true
38+
class.LAContext.methods.evaluatedPolicyDomainState.unsafe = true
39+
40+
# Deprecated and not reviewed.
41+
class.LAContext.methods.maxBiometryFailures.unsafe = true
42+
class.LAContext.methods."setMaxBiometryFailures:".unsafe = true
43+
44+
# The reply runs on a framework queue and updates process-wide state shared
45+
# with construction. Its error pointer may be null.
46+
class.LAContext.methods."evaluatePolicy:localizedReason:reply:".unsafe = true
47+
class.LAContext.methods."evaluateAccessControl:operation:localizedReason:reply:".unsafe = true
48+
49+
# The completion runs on a framework queue and writes the right's `state`.
50+
# Its error pointer may be null.
51+
class.LARight.methods."authorizeWithLocalizedReason:completion:".unsafe = true
52+
class.LARight.methods."checkCanAuthorizeWithCompletion:".unsafe = true
53+
class.LARight.methods."deauthorizeWithCompletion:".unsafe = true
54+
55+
# Reads `_state` directly while authorization completions write it from a
56+
# framework queue.
57+
class.LARight.methods.state.unsafe = true
58+
59+
# Completion result and error pointers may be null.
60+
class.LARightStore.methods."rightForIdentifier:completion:".unsafe = true
61+
class.LARightStore.methods."saveRight:identifier:completion:".unsafe = true
62+
class.LARightStore.methods."saveRight:identifier:secret:completion:".unsafe = true
63+
class.LARightStore.methods."removeRight:completion:".unsafe = true
64+
class.LARightStore.methods."removeRightForIdentifier:completion:".unsafe = true
65+
class.LARightStore.methods."removeAllRightsWithCompletion:".unsafe = true
66+
class.LAPrivateKey.methods."signData:secKeyAlgorithm:completion:".unsafe = true
67+
class.LAPrivateKey.methods."decryptData:secKeyAlgorithm:completion:".unsafe = true
68+
class.LAPrivateKey.methods."exchangeKeysWithPublicKey:secKeyAlgorithm:secKeyParameters:completion:".unsafe = true
69+
class.LAPublicKey.methods."exportBytesWithCompletion:".unsafe = true
70+
class.LAPublicKey.methods."encryptData:secKeyAlgorithm:completion:".unsafe = true
71+
class.LAPublicKey.methods."verifyData:signature:secKeyAlgorithm:completion:".unsafe = true
72+
class.LASecret.methods."loadDataWithCompletion:".unsafe = true
73+
74+
# The observer is held weakly and called on a framework queue.
75+
class.LAEnvironment.methods."addObserver:".unsafe = true
76+
class.LAEnvironment.methods."removeObserver:".unsafe = true
77+
protocol.LAEnvironmentObserver.methods."environment:stateDidChangeFromOldState:".unsafe = true
78+
79+
# Inherited from `NSObject` with unspecified behaviour, instances come from the
80+
# class factory methods.
81+
class.LAAuthenticationRequirement.methods.init.unsafe = true
82+
class.LAAuthenticationRequirement.methods.new.unsafe = true
83+
class.LABiometryFallbackRequirement.methods.init.unsafe = true
84+
class.LABiometryFallbackRequirement.methods.new.unsafe = true
85+
86+
# Instances are only obtained through `LARightStore`.
87+
class.LAPersistedRight.methods."initWithRequirement:".unsafe = true

0 commit comments

Comments
 (0)