[SecurityInterface] Update bindings up to Xcode 27.0 Beta 4 - #26281
[SecurityInterface] Update bindings up to Xcode 27.0 Beta 4#26281dalexsoto wants to merge 5 commits into
Conversation
Add complete macOS bindings for the SecurityInterface framework, including authorization views, certificate panels, identity selection, keychain panels, informal delegates, enums, notifications, and constants. Add safe managed support for the Security types used by these APIs: authorization callback tables and rights, the non-retaining authorization engine handle, keychain references, and keychain settings. Provide strongly typed certificate, identity, and policy APIs plus Action-based sheet completion overloads. Register SecurityInterface in the macOS framework lists, resolve the xtro todo, update the app-size baseline, and add runtime, ABI, ownership, API-shape, and framework-linking coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3afd7cac-e572-41ec-89e3-c727fd15b3c2
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s macOS binding surface to include the SecurityInterface framework (Xcode 27.0 Beta 3), adds managed convenience wrappers around several SecurityInterface/Security types, wires the framework into the build/link infrastructure, and refreshes the xtro expectations + test suites accordingly.
Changes:
- Register SecurityInterface as a macOS framework and enable
HAS_SECURITYINTERFACEin .NET defines. - Add SecurityInterface bindings + managed wrappers (sheet completion
Action<NSModalResponse>overloads, strongly-typed certificate/identity/policy APIs, keychain/keychain-settings helpers, and authorization callback helpers). - Update xtro todo/ignore + add monotouch tests and cecil known-failure entries required by the new surface.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/common/Frameworks.cs | Registers SecurityInterface in the macOS frameworks list. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-SecurityInterface.todo | Deletes resolved todo entries for SecurityInterface. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-SecurityInterface.ignore | Adds ignores for informal-protocol selectors that xtro reports on NSObject. |
| tests/xtro-sharpie/api-annotations-dotnet/macOS-Security.ignore | Removes now-bound enums from Security ignore list. |
| tests/monotouch-test/SecurityInterface/SFFieldsAndEnumsTest.cs | Adds validation tests for new fields/enums and Security enums used by the bindings. |
| tests/monotouch-test/SecurityInterface/SFChooseIdentityPanelTest.cs | Adds basic construction/property tests for choose-identity UI types. |
| tests/monotouch-test/SecurityInterface/SFCertificateViewTest.cs | Adds certificate view behavior and notification existence tests. |
| tests/monotouch-test/SecurityInterface/SFAuthorizationViewTest.cs | Adds authorization view smoke tests + AuthorizationRights round-trip test. |
| tests/monotouch-test/SecurityInterface/SecurityInterfaceApiShapeTest.cs | Verifies presence of strongly-typed APIs and one-shot sheet dispatcher semantics. |
| tests/monotouch-test/SecurityInterface/SecKeychainTest.cs | Adds basic SecKeychain wrapper tests. |
| tests/monotouch-test/SecurityInterface/SecKeychainSettingsTest.cs | Adds SecKeychainSettings layout + round-trip tests. |
| tests/monotouch-test/SecurityInterface/AuthorizationRightsTest.cs | Adds AuthorizationRights/AuthorizationRight behavior + native layout tests. |
| tests/monotouch-test/SecurityInterface/AuthorizationManualBindingsTest.cs | Adds callback-table interop tests for AuthorizationCallbacks/AuthorizationEngine. |
| tests/dotnet/UnitTests/ProjectTest.cs | Updates expected framework list to include SecurityInterface. |
| tests/cecil-tests/HandleSafety.KnownFailures.cs | Adds a known failure for new callback-based handle usage. |
| tests/cecil-tests/HandleSafety.cs | Adds handle-safety exceptions for AuthorizationCallbacks’ non-owning handle wrapper. |
| tests/cecil-tests/Documentation.KnownFailures.txt | Updates known-failure list for generated Dispose docs. |
| tests/cecil-tests/ApiTest.KnownFailures.cs | Adds known failure entry for Preserve usage on SecKeychain ctor. |
| src/SecurityInterface/SFKeychainSettingsPanel.cs | Adds managed overloads for modal/sheet flows and Action-based completion. |
| src/SecurityInterface/SFKeychainSavePanel.cs | Adds strongly-typed Keychain property + Action-based sheet overload. |
| src/SecurityInterface/SFChooseIdentityPanel.cs | Adds strongly-typed policies helpers + Action-based sheet overload. |
| src/SecurityInterface/SFCertificateView.cs | Adds strongly typed Certificate/Policies helpers. |
| src/SecurityInterface/SFCertificatePanel.cs | Adds policies helpers and Action-based sheet overloads for cert/trust panels. |
| src/SecurityInterface/SFAuthorizationView.cs | Adds managed wrappers for authorization string + rights. |
| src/SecurityInterface/SFAuthorizationPluginView.cs | Adds safe managed constructor and strongly typed properties. |
| src/SecurityInterface/SecurityInterfaceSheetDispatcher.cs | Adds dispatcher glue for Action-based sheet completions. |
| src/SecurityInterface/Enums.cs | Introduces strongly typed SecurityInterface enums. |
| src/securityinterface.cs | Adds the SecurityInterface binding definitions (macOS only). |
| src/Security/SecKeychainSettings.cs | Introduces blittable SecKeychainSettings struct wrapper (macOS only). |
| src/Security/SecKeychain.cs | Adds SecKeychain NativeObject wrapper (macOS only). |
| src/Security/AuthorizationRights.cs | Adds managed AuthorizationRights collection wrapper (macOS only). |
| src/Security/AuthorizationEnums.cs | Moves/refreshes AuthorizationStatus/AuthorizationFlags enums into a dedicated file. |
| src/Security/AuthorizationEngine.cs | Adds AuthorizationEngine wrapper (macOS only). |
| src/Security/AuthorizationCallbacks.cs | Adds AuthorizationCallbacks wrapper + related enums (macOS only). |
| src/Security/Authorization.cs | Removes duplicated AuthorizationStatus/AuthorizationFlags definitions now moved to AuthorizationEnums.cs. |
| src/rsp/dotnet/macos-defines-dotnet.rsp | Adds HAS_SECURITYINTERFACE. |
| src/frameworks.sources | Adds SecurityInterface source lists + framework registration for macOS. |
| src/build/dotnet/generator-frameworks.g.cs | Adds SecurityInterface to generated framework availability infrastructure. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9e228af-33c5-4ac3-ac5e-f8839d48f8bc
The native init method returns nil, so callers must use the shared panel accessor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9e228af-33c5-4ac3-ac5e-f8839d48f8bc
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Model authorization callbacks as pointer-backed disposable tables, support owned C# callback tables, and tie plugin-view callback copies to native object lifetime. Convert property candidates and modal APIs to idiomatic bindings, remove obsolete macOS introduction metadata, optimize authorization-right copying, and mark SecKeychain obsolete. Replace the table-cell linker hardcode with declarative native-symbol metadata and extend focused coverage for the updated API and ownership behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3afd7cac-e572-41ec-89e3-c727fd15b3c2
|
@rolfbjarne Addressed the review in f457523.
Final validation includes |
This comment has been minimized.
This comment has been minimized.
The new SFAuthorizationPluginView binding declares a P/Invoke for
objc_setAssociatedObject to tie the lifetime of the copied callbacks
buffer to the native object.
objc_setAssociatedObject is declared in <objc/runtime.h>, which is not a
framework umbrella header, so xtro-sharpie's DllImportCheck can never
match it and always reports it as !unknown-pinvoke!. Because the entry
point resolves through /usr/lib/libobjc.dylib, xtro attributes it to the
ObjCRuntime "framework", and since SecurityInterface is macOS-only the
entry only shows up for macOS.
This left one unclassified entry, which failed the xtro test:
@MonkeyWrench: SetSummary: 1 unclassified found.
Classify it in macOS-ObjCRuntime.ignore, next to the other libobjc and
non-framework P/Invokes we already ignore.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ebf4376b-3b4c-4492-acef-18607e6f4ea1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #39fa0ab] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 200 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Summary
This supersedes #25141 and incorporates all review feedback from that PR.
Validation
make worldCLLocationButton