Skip to content

feat(MBL-2543): reject secret keys and pick region from key - #925

Merged
sydneycollins-cio merged 10 commits into
mainfrom
mbl-2543-key
Oct 21, 2026
Merged

sydneycollins-cio merged 10 commits into
mainfrom
mbl-2543-key

Conversation

@sydneycollins-cio

@sydneycollins-cio sydneycollins-cio commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Block sk_ keys in apps and grab the region from the new key prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: mbl-2543-key (1792596503)
  • kotlin_compose: mbl-2543-key (1792596495)

Commit 2f677a0 · CI run

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.89583% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.75%. Comparing base (b5cf24d) to head (2f677a0).
⚠️ Report is 71 commits behind head on main.

Files with missing lines Patch % Lines
...tapipelines/migration/AnalyticsStorageMigration.kt 80.64% 3 Missing and 15 partials ⚠️
...ines/src/main/kotlin/io/customer/sdk/CustomerIO.kt 93.33% 2 Missing and 1 partial ⚠️
...main/kotlin/io/customer/sdk/DataPipelinesLogger.kt 0.00% 3 Missing ⚠️
...tomer/messaginginapp/MessagingInAppModuleConfig.kt 81.81% 0 Missing and 2 partials ⚠️
...main/kotlin/io/customer/sdk/core/util/CioApiKey.kt 80.00% 0 Missing and 1 partial ⚠️
...tomer/messaginginapp/gist/data/NetworkUtilities.kt 83.33% 0 Missing and 1 partial ⚠️
...ustomer/messaginginapp/gist/data/sse/SseService.kt 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #925      +/-   ##
============================================
+ Coverage     69.07%   74.75%   +5.68%     
- Complexity      838     2477    +1639     
============================================
  Files           149      287     +138     
  Lines          4601    13599    +8998     
  Branches        628     2333    +1705     
============================================
+ Hits           3178    10166    +6988     
- Misses         1189     2596    +1407     
- Partials        234      837     +603     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Build available to test
Version: mbl-2543-key-SNAPSHOT
Repository: https://central.sonatype.com/repository/maven-snapshots/

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📏 SDK Binary Size Comparison Report

Module Last Recorded Size Current Size Change in Size
core 50.31 KB 51.27 KB ⬆️ +0.96KB
datapipelines 43.91 KB 50.44 KB ⬆️ +6.53KB
messagingpush 77.63 KB 77.63 KB ✅ No Change
messaginginapp 165.14 KB 166.21 KB ⬆️ +1.07KB
messaginginbox 61.19 KB 61.19 KB ✅ No Change
tracking-migration 22.89 KB 22.89 KB ✅ No Change
location 20.40 KB 20.40 KB ✅ No Change
geofence 225.77 KB 225.77 KB ✅ No Change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sydneycollins-cio
sydneycollins-cio marked this pull request as ready for review October 7, 2026 18:44
@sydneycollins-cio
sydneycollins-cio requested a review from a team as a code owner October 7, 2026 18:44
@sydneycollins-cio
sydneycollins-cio marked this pull request as draft October 7, 2026 18:44
@sydneycollins-cio
sydneycollins-cio marked this pull request as ready for review October 7, 2026 20:32
@sydneycollins-cio
sydneycollins-cio added this pull request to stack #932 October 7, 2026 20:57
sydneycollins-cio and others added 3 commits October 15, 2026 18:09
…ny prefix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mahmoud-elmorabea mahmoud-elmorabea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! 💯

One small inconsistency: Right now the usage of a secret key will leave init call at an invalid state and crash at builder.

I think we should align them: either crash or log.

I have always been in favor of SDKs never crashing if something is wrong, I think that's the way to go here as well. However, I do see that leaking a secret key here might be worth breaking that rule but not generalizing it for other cases.

Comment thread core/src/main/kotlin/io/customer/sdk/core/util/CioApiKey.kt Outdated
Comment thread datapipelines/src/main/kotlin/io/customer/sdk/CustomerIO.kt
Comment thread datapipelines/src/main/kotlin/io/customer/sdk/CustomerIOBuilder.kt Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread datapipelines/src/main/kotlin/io/customer/sdk/CustomerIO.kt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread datapipelines/src/main/kotlin/io/customer/sdk/CustomerIO.kt
Module accessors like ModuleLocation.instance() no longer throw after a
refused key; their calls do nothing because the modules are not set up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sydneycollins-cio
sydneycollins-cio removed this pull request from stack #932 October 21, 2026 15:16
sydneycollins-cio and others added 2 commits October 21, 2026 11:21
…#926)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2f677a0. Configure here.

// Drop the modules registered while disabled so only the new config's modules get set up
SDKComponent.modules.clear()
instance = null
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale DataPipeline after disabled release

High Severity

releaseDisabledInstance clears the static CustomerIO instance but not the DataPipeline entry in SDKComponent’s singleton map. The disabled instance registered in init stays cached, so a later initialize with a valid pk_ key leaves modules reading the old pipeline (cdpApiKey "disabled") instead of the new SDK.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f677a0. Configure here.

@sydneycollins-cio
sydneycollins-cio merged commit b5bc060 into main Oct 21, 2026
44 checks passed
@sydneycollins-cio
sydneycollins-cio deleted the mbl-2543-key branch October 21, 2026 18:06
cio-mobile-release Bot pushed a commit that referenced this pull request Oct 21, 2026
## [4.25.0](4.24.0...4.25.0) (2026-10-21)

### Features

* **MBL-2543:** reject secret keys and pick region from key ([#925](#925)) ([b5bc060](b5bc060))
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