Skip to content

Conversation

@Anders-planck
Copy link
Collaborator

No description provided.


const mtlsBaseUrl = forcePort444 && !baseUrl.includes(':444')
? (baseUrl.includes(':444')
? baseUrl.replace(':444', ':444')

Check warning

Code scanning / CodeQL

Replacement of a substring with itself Medium

This replaces ':444' with itself.

Copilot Autofix

AI about 1 month ago

The fix is to remove the redundant replace operation and simply return baseUrl in this else-branch.
Specifically, in createACubeMTLSConfig, lines 93–97 build the mtlsBaseUrl.

  • Remove the unnecessary baseUrl.replace(':444', ':444') call (line 95).
  • Let the branch simply refer to baseUrl when ':444' is already present.
  • No further imports or helper methods are necessary.
    Only this region in the file src/core/adapter-loader.ts needs to change.

Suggested changeset 1
src/core/adapter-loader.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/adapter-loader.ts b/src/core/adapter-loader.ts
--- a/src/core/adapter-loader.ts
+++ b/src/core/adapter-loader.ts
@@ -92,7 +92,7 @@
   
   const mtlsBaseUrl = forcePort444 && !baseUrl.includes(':444')
     ? (baseUrl.includes(':444')
-        ? baseUrl.replace(':444', ':444')
+        ? baseUrl
         : baseUrl.replace(/:\d+$/, '') + ':444')
     : baseUrl;
 
EOF
@@ -92,7 +92,7 @@

const mtlsBaseUrl = forcePort444 && !baseUrl.includes(':444')
? (baseUrl.includes(':444')
? baseUrl.replace(':444', ':444')
? baseUrl
: baseUrl.replace(/:\d+$/, '') + ':444')
: baseUrl;

Copilot is powered by AI and may make mistakes. Always verify output.
Anders-planck and others added 4 commits October 21, 2025 15:24
…s integration

- Add getCertificatesInfo() method to ACubeSDK for fast certificate info access
- Update ExpoMutualTLSClass interface with all expo-mutual-tls features
- Implement parseCertificate methods (P12 and PEM parsing support)
- Add getCertificatesInfo() native method to retrieve stored certificate metadata
- Implement proper getCertificateInfo() using expo-mutual-tls getCertificatesInfo()
- Add removeAllListeners() method for proper event cleanup
- Add new SDKError types: MTLS_ADAPTER_NOT_AVAILABLE, CERTIFICATE_INFO_ERROR
- Fix CertificateInfo interface compatibility in Node.js adapter
- Add detailed certificate parsing with subject, issuer, validity, fingerprints
- Extract pemId and cashRegisterUUID from certificate commonName
- Add comprehensive debug logging for certificate operations
- Complete feature parity with @a-cube-io/expo-mutual-tls library

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
feat: add comprehensive certificate info retrieval
@Anders-planck Anders-planck merged commit e7e5365 into master Nov 20, 2025
2 checks passed
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.

2 participants