Skip to content
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

Major Update: Migrate from NAN to NAPI #104

Merged
merged 23 commits into from
Jan 16, 2024
Merged

Major Update: Migrate from NAN to NAPI #104

merged 23 commits into from
Jan 16, 2024

Conversation

microshine
Copy link
Contributor

@microshine microshine commented Jan 15, 2024

Description:

This update represents a major revision in the module's architecture, shifting from NAN (Native Abstractions for Node.js) to NAPI (Node-API). This change is pivotal for ensuring module compatibility with current and future Node.js releases.

Detailed Changes:

  1. Adoption of NAPI: The core of this update is the transition to NAPI, a stable Node.js API designed to abstract away the underlying JavaScript engine. NAPI provides an ABI (Application Binary Interface) stable across Node.js versions, mitigating the issues related to Node.js engine updates. This shift significantly reduces the need for frequent updates with each new Node.js release, offering a more stable and consistent development experience.

  2. API Consistency Maintained: While this update is significant in terms of internal workings, it's important to note that the external API surface remains unchanged. This design decision ensures backward compatibility, allowing existing applications to upgrade to the new module version without any code changes.

  3. Issue Disable Signing test for Linux OS #47 Resolution: The update includes a fix for Issue Disable Signing test for Linux OS #47, enhancing the module's stability and addressing previously reported bugs.

  4. Enhanced Testing Suite and CI Updates: Complementing the shift to NAPI, the module's testing suite has been expanded to cover new scenarios introduced by this change. This comprehensive testing ensures that both new and existing functionalities perform as expected. Additionally, the CI (Continuous Integration) environment has been updated to align with these changes, optimizing our development and deployment workflow.

  5. Implementation of Dual-function Cryptographic Operations: A significant addition in this update is the implementation of dual-function cryptographic operations, including C_DigestEncryptUpdate, C_DecryptDigestUpdate, C_SignEncryptUpdate, and C_DecryptVerifyUpdate. These operations expand the module's capabilities, allowing for more complex cryptographic tasks within a single operation.

Implications and Recommendations:

This transition to NAPI, while maintaining API compatibility, necessitates a major version bump due to the underlying architectural changes. Users are strongly encouraged to upgrade to this latest version for improved stability and forward compatibility with future Node.js versions. The upgrade process should be seamless, given the preserved API interface.

@microshine microshine linked an issue Jan 15, 2024 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Jan 15, 2024

Coverage Status

coverage: 97.959% (-2.0%) from 100.0%
when pulling 646f836 on napi
into e30a91f on master.

- CK_ECDH2_DERIVE_PARAMS
- CK_ECMQV_DERIVE_PARAMS
- CK_X9_42_DH1_DERIVE_PARAMS
- CK_X9_42_DH2_DERIVE_PARAMS
- CK_X9_42_MQV_DERIVE_PARAMS
- CK_KEA_DERIVE_PARAMS
- CK_RC2_CBC_PARAMS
- CK_RC2_MAC_GENERAL_PARAMS
- CK_RC5_PARAMS
- CK_RC5_CBC_PARAMS
- CK_RC5_MAC_GENERAL_PARAMS
- CK_DES_CBC_ENCRYPT_DATA_PARAMS
- CK_SKIPJACK_PRIVATE_WRAP_PARAMS
- CK_SKIPJACK_RELAYX_PARAMS
- CK_KEY_WRAP_SET_OAEP_PARAMS
- CK_GCM_PARAMS
- CK_CCM_PARAMS
- CK_GOSTR3410_DERIVE_PARAMS
- CK_GOSTR3410_KEY_WRAP_PARAMS
@microshine microshine merged commit ab0046f into master Jan 16, 2024
13 of 16 checks passed
@microshine microshine deleted the napi branch January 16, 2024 21:42
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.

Disable Signing test for Linux OS
2 participants