Skip to content

W-22917328: Rename beacon_child_consumer_{key,secret} to auto_installed_app_org_consumer_{key,secret}#4057

Open
wmathurin wants to merge 2 commits into
forcedotcom:devfrom
wmathurin:rename-beacon-child-consumer-keys
Open

W-22917328: Rename beacon_child_consumer_{key,secret} to auto_installed_app_org_consumer_{key,secret}#4057
wmathurin wants to merge 2 commits into
forcedotcom:devfrom
wmathurin:rename-beacon-child-consumer-keys

Conversation

@wmathurin

@wmathurin wmathurin commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the token endpoint wire-format keys and adds a legacy fallback for servers that haven't yet rolled out version 264.

When parsing the token response, the SDK now:

  1. Checks for auto_installed_app_org_consumer_{key,secret} (new field name)
  2. Falls back to beacon_child_consumer_{key,secret} if the new field is absent

A TODO comment marks both fallback constants and the fallback logic for removal once server version 264 has rolled out everywhere.

All code symbol names (kSFOAuthBeaconChildConsumerKey, beaconChildConsumerKey property, etc.) are unchanged.

Files changed

  • SFSDKOAuthConstants.h — new constant values + legacy fallback constants added
  • SFOAuthCredentials.m — parsing updated with new-then-old fallback
  • SFSDKOAuthTokenEndpointResponseTests.m — test key strings updated
  • SFOAuthCredentialsTests.m — test key strings updated

Test plan

  • SalesforceSDKCore unit test suite passes (iPhone 16 / iOS 18.6)
  • AuthFlowTester UI tests pass (running externally)

Related

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all1 ran1 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.65%. Comparing base (4ed3b2d) to head (1c73e4c).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...lesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4057      +/-   ##
==========================================
- Coverage   71.00%   66.65%   -4.36%     
==========================================
  Files         246      246              
  Lines       21477    21481       +4     
==========================================
- Hits        15250    14318     -932     
- Misses       6227     7163     +936     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.79% <ø> (-0.19%) ⬇️
Core 59.17% <50.00%> (-6.74%) ⬇️
SmartStore 73.60% <ø> (ø)
MobileSync 89.06% <ø> (ø)
Files with missing lines Coverage Δ
...lesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m 95.80% <50.00%> (-1.72%) ⬇️

... and 34 files with indirect coverage changes

🚀 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 Jun 10, 2026

Copy link
Copy Markdown
TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^18 Test Results647 ran646 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^18 Test Results
testMissingMyDomain()❌ failure

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^26 Test Results647 ran647 ✅
TestResult
No test annotations available

…y,secret} to auto_installed_app_org_consumer_{key,secret}

Updates only the string values parsed from the token endpoint response.
All code symbol names (constants, properties, methods) are unchanged.
…eld absent

Checks auto_installed_app_org_consumer_{key,secret} first; falls back to
the old beacon_child_consumer_{key,secret} name for servers that have not
yet rolled out version 264.
@wmathurin

Copy link
Copy Markdown
Contributor Author

I decided to only change the value of the fields we look for in the response and keep beacon in our code and tests. The changes were getting large and would make cherry picking harder. Further more AutoInstalledApp is a mouthful compared to Beacon.

if (params[kSFOAuthTokenFormat]) {
self.tokenFormat = params[kSFOAuthTokenFormat];
}
// TODO: Remove kSFOAuthLegacyBeaconChildConsumer* fallback once server version 264 has rolled out everywhere.

@wmathurin wmathurin Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That way we can go against older instances and it should still work.

@github-actions

Copy link
Copy Markdown
1 Warning
⚠️ Static Analysis found an issue with one or more files you modified. Please fix the issue(s).

Clang Static Analysis Issues

File Type Category Description Line Col
SFOAuthCredentials Dereference of null pointer Logic error Access to instance variable '_credentialsChangeSet' results in a dereference of a null pointer (loaded from variable 'self') 194 27
SFOAuthCredentials Nullability Memory error nil passed to a callee that requires a non-null 1st parameter 297 20

Generated by 🚫 Danger

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce 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.

👍🏻

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