Skip to content

[minor][feature]: Import bridging header according to where common-core is a submodule#1678

Open
ameyapat wants to merge 22 commits intodevfrom
ameyapat/custom-swift-cryptokit-bridge
Open

[minor][feature]: Import bridging header according to where common-core is a submodule#1678
ameyapat wants to merge 22 commits intodevfrom
ameyapat/custom-swift-cryptokit-bridge

Conversation

@ameyapat
Copy link
Contributor

PR Title Format

Required Format: [Keyword1] [Keyword2]: Description

  • Keyword1: major, minor, or patch (case-insensitive)
  • Keyword2: feature, bugfix, engg, or tests (case-insensitive)

Examples:

  • [MAJOR] [Feature]: new API
  • [minor] [bugfix]: fix crash
  • [PATCH][tests]:add coverage

Proposed changes

Xcode generates bridging header for swift classes to be available in Objective C classes in derived data. The obj C classes must import this header when using the swift classes. If common-core is a submodule in MSAL, it should import MSAL-Swift.h and if in oneAuth, it should import oneAuth-Swift.h

This PR adds a header that makes that determination during pod creation in a common header.

Type of change

  • Feature work
  • Bug fix
  • Documentation
  • Engineering change
  • Test
  • Logging/Telemetry

Risk

  • High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high level infrastructure changes)
  • Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
  • Small – No issues are expected. (Example: Very small bug fixes, string changes, or configuration settings changes)

Additional information

Copy link
Contributor

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

Adds a common header to abstract which generated Swift-to-Objective-C header (*-Swift.h) should be imported when common-core is consumed as a submodule (IdentityCore standalone vs inside MSAL/oneAuth), and wires JWE decryption ObjC code to use it.

Changes:

  • Introduce MSIDSwiftBridgingHeader.h to select the correct *-Swift.h import via build macros.
  • Update JWE decryption Objective-C code to import the new bridging header and call the Swift decryptor via a new ObjC selector.
  • Expose Swift classes to Objective-C (and tweak Xcode build settings) to ensure Swift implementations are reachable from ObjC.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
changelog.txt Adds an entry describing the new bridging-header selection behavior.
IdentityCore/src/util/MSIDConcatKdfProvider.swift Adds ObjC exposure annotation to make the Swift KDF provider usable from ObjC.
IdentityCore/src/MSIDSwiftBridgingHeader.h New shared header that conditionally imports the correct generated *-Swift.h.
IdentityCore/src/JWEResponse/MSIDJweResponse+EcdhAesGcm.m Switches to the shared bridging header and updates the Swift decryptor call-site.
IdentityCore/src/JWEResponse/MSIDAesGcmDecryptor.swift Adds ObjC exposure and a custom ObjC selector for the decrypt method.
IdentityCore/src/IdentityCore_Internal.h Removes the MSID_IDENTITYCORE_SWIFT_AVAILABLE macro block.
IdentityCore/IdentityCore.xcodeproj/project.pbxproj Registers the new header and enables installing the generated ObjC header for iOS configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Jan 29, 2026

@ameyapat I've opened a new pull request, #1679, to work on those changes. Once the pull request is ready, I'll request review from you.

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.

3 participants